Module initialization
This tutorial series explains how to contribute a module to nf-neuro. For the exercise, you will recreate an already available module, DENOISING_NLMEANS, so you can refer to its implementation if needed. The purpose of this module is denoising anatomical MRI images, like T1w and T2w images, using the Non-Local Means (NLM) algorithm. We’ll use the implementation available in scilpy, via the script scil_denoising_nlmeans.py.
First steps
Section titled “First steps”[Skip if working in the devcontainer] If not done already, clone the nf-neuro repository locally and navigate to it :
git clone https://github.com/nf-neuro/modules.gitcd nf-neuroCreate a new branch for your module. To help you and maintainers track changes, use the convention module/<category>_<tool>
to name your branch (we’ll use : module/denoising_nlmeans) :
git checkout -b module/denoising_nlmeansGenerate the template
Section titled “Generate the template”Open a terminal (with access to the nf-core command). Use cd to move to the location of the nf-neuro repository
and generate the module’s skeleton :
nf-core modules createAnswer the prompts using the information below :
- Name of tool/subtool :
denoising/nlmeans- This is the
<category>/<tool>of the module you plan creating
- This is the
- Bioconda package : select
no.- There are no offical neuroconda package distributor yet, so we don’t support it, but you are welcome to investiguate !
- Nextflow integrates conda, refer to the nf-core documentation for more information on the matter.
- Github author : your Github handle (prefixed with
@), or@scilusif you prefer no accreditation. - Resource label : for denoising/nlmeans, select
process_medium, since it can parallelize computations- Resource allocation with labels can vary depending on infrastructure and availability.
- All labels below get allocated around 4Gb of RAM. For CPU, a rule of thumb is :
- process_single : 1 CPU core
- process_low : 2 CPU cores
- process_medium : 4 CPU cores
- process_high : 6 CPU cores
- Meta map : select
yes.
Alternatively, you can use the following command to supply nearly all information :
nf-core modules create --author @scilus --label process_medium --meta denoising/nlmeansYou will still have to interact with the bioconda prompt, still select no.
The command will generate your new module template in the ./modules/nf-neuro/denoising/nlmeans directory. Navigate to it and familiarize yourself with the various files generated. After that, switch to the next section of the tutorial and proceed to edit the main.nf file.