diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..496ee2c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store \ No newline at end of file diff --git a/main.nf b/main.nf index e48f43b..00e34a5 100644 --- a/main.nf +++ b/main.nf @@ -3,6 +3,7 @@ include { DENOISING_MPPCA } from './modules/nf-neuro/denoising/mppca/main.nf' include { PREPROC_SINGLEEDDY } from './modules/local/preproc/singleeddy/main.nf' include { UTILS_EXTRACTB0 } from './modules/nf-neuro/utils/extractb0/main.nf' include { NNUNET } from './subworkflows/local/nnunet/' +include { BET } from './subworkflows/local/bet/main.nf' include { MOUSE_N4 } from './modules/local/mouse/n4/main.nf' include { IMAGE_RESAMPLE as RESAMPLE_DWI} from './modules/nf-neuro/image/resample/main.nf' include { IMAGE_RESAMPLE as RESAMPLE_MASK} from './modules/nf-neuro/image/resample/main.nf' @@ -36,13 +37,17 @@ workflow get_data { log.info "" log.info " [input]" log.info " ├-- S1" - log.info " | ├-- *dwi.nii.gz" log.info " | ├-- *dwi.bval" - log.info " | └-- *dwi.bvec" + log.info " | ├-- *dwi.bvec" + log.info " | ├-- *dwi.nii.gz" + log.info " | ├-- *anat.nii.gz (optional)" + log.info " | └-- *mask.nii.gz (optional)" log.info " └-- S2" - log.info " ├-- *dwi.nii.gz" - log.info " ├-- *dwi.bval" - log.info " └-- *dwi.bvec" + log.info " ├-- *dwi.bval" + log.info " ├-- *dwi.bvec" + log.info " ├-- *dwi.nii.gz" + log.info " ├-- *anat.nii.gz (optional)" + log.info " └-- *mask.nii.gz (optional)" log.info "" log.info "" error "Please resubmit your command with the previous file structure." @@ -57,6 +62,10 @@ workflow get_data { .map { mask_file -> def sid = mask_file.parent.name [[id: sid], mask_file] } + anat_channel = Channel.fromPath("$input/**/*anat.nii.gz") + .map { anat_file -> def sid = anat_file.parent.name + [[id: sid], anat_file] } + template_channel = Channel.fromPath("$projectDir/assets/reference_rgb_mqc.png") lut_channel = Channel.of([ @@ -68,6 +77,7 @@ workflow get_data { emit: dwi = dwi_channel mask = mask_channel + anat = anat_channel template_rgb = template_channel lut = lut_channel } @@ -96,6 +106,8 @@ workflow { } ch_ref_rgb = data.template_rgb ch_lut = data.lut + ch_bet = data.anat + ch_mask = Channel.empty() if ( params.run_preqc ) { PRE_QC(ch_dwi_bvalbvec.dwi.join(ch_dwi_bvalbvec.bvs_files).combine(ch_ref_rgb)) @@ -105,6 +117,7 @@ workflow { log.warn('Using the output from the preqc module is highly experimental. Please be careful.') ch_after_preqc = PRE_QC.out.dwi bvs_after_preqc = PRE_QC.out.bvs + } else { ch_after_preqc = Channel.empty() @@ -136,21 +149,31 @@ workflow { else { ch_after_eddy = ch_eddy } - UTILS_EXTRACTB0(ch_after_eddy) - ch_nnunet = ch_after_eddy.join(UTILS_EXTRACTB0.out.b0) - .join(data.mask, by: 0, remainder: true) - .map { meta, dwi, bval, bvec, b0, mask -> - [meta, dwi, bval, b0, mask ?: [ ]]} // Use empty list if mask is null - - NNUNET(ch_nnunet) + + if (params.invivo) { + BET(ch_bet) + ch_mask = BET.out.mask + } + else if ( params.data_masked ) { + ch_mask = data.mask + } + else { + ch_nnunet = ch_after_eddy.join(UTILS_EXTRACTB0.out.b0) + .map { meta, dwi, bval, bvec, b0 -> + [meta, dwi, bval, b0 ?: [ ]]} + + NNUNET(ch_nnunet) + + ch_mask = NNUNET.out.mask + } if ( params.run_n4 ) { ch_N4 = ch_after_eddy .map{ meta, dwi, _bval, _bvec -> tuple(meta, dwi)} .join(UTILS_EXTRACTB0.out.b0) - .join(NNUNET.out.mask) + .join(ch_mask) MOUSE_N4(ch_N4) ch_after_n4 = MOUSE_N4.out.dwi_n4 } @@ -161,7 +184,7 @@ workflow { if ( params.run_resampling ) { RESAMPLE_DWI(ch_after_n4.map{ meta, dwi -> [meta, dwi, []] }) // Add an empty list for the optional reference image - RESAMPLE_MASK(NNUNET.out.mask.map{ meta, mask -> [meta, mask, []] }) + RESAMPLE_MASK(ch_mask.map{ meta, mask -> [meta, mask, []] }) IMAGE_CONVERT(RESAMPLE_MASK.out.image) dwi_after_resample = RESAMPLE_DWI.out.image @@ -169,7 +192,7 @@ workflow { } else { dwi_after_resample = ch_after_n4 - IMAGE_CONVERT(NNUNET.out.mask) + IMAGE_CONVERT(ch_mask) mask_after_resample = IMAGE_CONVERT.out.image } @@ -187,13 +210,15 @@ workflow { ch_multiqc_files = ch_multiqc_files.mix(RECONST_DTIMETRICS.out.mqc) /* FODF */ - RECONST_FRF(ch_for_reconst.map{ it + [[], [], []]}) - ch_for_reconst_fodf = ch_for_reconst - .join(RECONST_DTIMETRICS.out.fa) - .join(RECONST_DTIMETRICS.out.md) - .join(RECONST_FRF.out.frf) - .map{ it + [[], []]} - RECONST_FODF(ch_for_reconst_fodf) + if ( params.run_fodf_metrics ) { + RECONST_FRF(ch_for_reconst.map{ it + [[], [], []]}) + ch_for_reconst_fodf = ch_for_reconst + .join(RECONST_DTIMETRICS.out.fa) + .join(RECONST_DTIMETRICS.out.md) + .join(RECONST_FRF.out.frf) + .map{ it + [[], []]} + RECONST_FODF(ch_for_reconst_fodf) + } /* QBALL */ RECONST_QBALL(ch_for_reconst) diff --git a/modules/local/mouse/betnnunet/main.nf b/modules/local/mouse/betnnunet/main.nf index 851b19d..070fb3c 100644 --- a/modules/local/mouse/betnnunet/main.nf +++ b/modules/local/mouse/betnnunet/main.nf @@ -5,7 +5,7 @@ process MOUSE_BETNNUNET { container "scilus/nnunet_bet_mouse:0.1.0_cpu" input: - tuple val(meta), path(dwi), path(b0), path(mask) + tuple val(meta), path(dwi), path(b0) output: tuple val(meta), path("*__mask.nii.gz") , emit: mask path "versions.yml" , emit: versions @@ -17,21 +17,16 @@ process MOUSE_BETNNUNET { def prefix = task.ext.prefix ?: "${meta.id}" """ - if [[ -f "$mask" ]] - then - mv $mask ${prefix}__mask.nii.gz - else export nnUNet_raw="Database/RAW/" export nnUNet_preprocessed="Database/PRE/" export nnUNet_results="Database/RESULTS/" - mkdir -p Database/RAW/Dataset012_ExVivoBrainFSboth/imagesTs - ln -s /Database/RAW/Dataset012_ExVivoBrainFSboth/dataset.json Database/RAW/Dataset012_ExVivoBrainFSboth/dataset.json - ln -s /Database/RESULTS Database/RESULTS - mv $b0 Database/RAW/Dataset012_ExVivoBrainFSboth/imagesTs/exvivobrain_000_0000.nii.gz - mv $dwi Database/RAW/Dataset012_ExVivoBrainFSboth/imagesTs/exvivobrain_000_0001.nii.gz - nnUNetv2_predict -i Database/RAW/Dataset012_ExVivoBrainFSboth/imagesTs -o ./ -d 012 -c 3d_fullres -f all -npp 1 -nps 1 -device 'cpu' -tr nnUNetTrainer -chk checkpoint_best.pth - mv exvivobrain_000.nii.gz ${prefix}__mask.nii.gz - fi + mkdir -p Database/RAW/Dataset012_ExVivoBrainFSboth/imagesTs + ln -s /Database/RAW/Dataset012_ExVivoBrainFSboth/dataset.json Database/RAW/Dataset012_ExVivoBrainFSboth/dataset.json + ln -s /Database/RESULTS Database/RESULTS + mv $b0 Database/RAW/Dataset012_ExVivoBrainFSboth/imagesTs/exvivobrain_000_0000.nii.gz + mv $dwi Database/RAW/Dataset012_ExVivoBrainFSboth/imagesTs/exvivobrain_000_0001.nii.gz + nnUNetv2_predict -i Database/RAW/Dataset012_ExVivoBrainFSboth/imagesTs -o ./ -d 012 -c 3d_fullres -f all -npp 1 -nps 1 -device 'cpu' -tr nnUNetTrainer -chk checkpoint_best.pth + mv exvivobrain_000.nii.gz ${prefix}__mask.nii.gz cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/local/mouse/brainextraction/environment.yml b/modules/local/mouse/brainextraction/environment.yml new file mode 100644 index 0000000..054a77f --- /dev/null +++ b/modules/local/mouse/brainextraction/environment.yml @@ -0,0 +1,3 @@ +channels: [] +dependencies: [] +name: "mouse_bet" diff --git a/modules/local/mouse/brainextraction/main.nf b/modules/local/mouse/brainextraction/main.nf new file mode 100644 index 0000000..2242f0b --- /dev/null +++ b/modules/local/mouse/brainextraction/main.nf @@ -0,0 +1,37 @@ +process MOUSE_BRAINEXTRACTION { + tag "$meta.id" + label 'process_high' + + container "scilus/antspynet:dev" + + input: + tuple val(meta), path(anat) + output: + tuple val(meta), path("*__mask.nii.gz") , emit: mask + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def prefix = task.ext.prefix ?: "${meta.id}" + + """ + antsMouseBrainExtraction $anat ${prefix}__mask.nii.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + ants: \$(antsMouseBrainExtraction --version 2>&1 | sed -n 's/ANTs Version: v\\([0-9.]\\+\\)/\\1/p') + END_VERSIONS + """ + + stub: + """ + antsMouseBrainExtraction -h + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + ants: \$(antsMouseBrainExtraction --version 2>&1 | sed -n 's/ANTs Version: v\\([0-9.]\\+\\)/\\1/p') + END_VERSIONS + """ +} \ No newline at end of file diff --git a/modules/local/mouse/brainextraction/meta.yml b/modules/local/mouse/brainextraction/meta.yml new file mode 100755 index 0000000..f6c6a88 --- /dev/null +++ b/modules/local/mouse/brainextraction/meta.yml @@ -0,0 +1,44 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/scilus/nf-neuro/main/modules/meta-schema.json +name: "brainextraction" +description: Extraction of the brain from anatomical images using BET +keywords: + - BET + - T1 +tools: + - "scilpy": + description: "The Sherbrooke Connectivity Imaging Lab (SCIL) Python dMRI processing toolbox." + homepage: "https://github.com/scilus/scilpy.git" + - "FSL": + description: "FSL Toolbox and Scilpy Toolbox" + homepage: "https://fsl.fmrib.ox.ac.uk/fsl/fslwiki" +input: + # Only when we have meta + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + + - anat: + type: file + description: Anat Nifti image + pattern: "*.{nii,nii.gz}" + + +output: + #Only when we have meta + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + + - mask: + type: file + description: mask brain-extracted + pattern: "*__mask.{nii,nii.gz}" + + +authors: + - "@EliseCos" \ No newline at end of file diff --git a/modules/local/mouse/convertbet/environment.yml b/modules/local/mouse/convertbet/environment.yml new file mode 100644 index 0000000..b92d504 --- /dev/null +++ b/modules/local/mouse/convertbet/environment.yml @@ -0,0 +1,3 @@ +channels: [] +dependencies: [] +name: "mouse_convertbet" diff --git a/modules/local/mouse/convertbet/main.nf b/modules/local/mouse/convertbet/main.nf new file mode 100644 index 0000000..990d9d2 --- /dev/null +++ b/modules/local/mouse/convertbet/main.nf @@ -0,0 +1,51 @@ +process MOUSE_CONVERTBET { + tag "$meta.id" + label 'process_low' + + container "scilus/scilus:2.2.0" + + input: + tuple val(meta), path(image) + output: + tuple val(meta), path("*_mask.nii.gz") , emit: mask + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def prefix = task.ext.prefix ?: "${meta.id}" + def nb_vox = task.ext.nb_vox ?: "" + """ + fslmaths ${image} -bin ${prefix}_mask.nii.gz + + scil_volume_math erosion ${prefix}_mask.nii.gz $nb_vox ${prefix}_mask.nii.gz --data_type uint8 -f + ImageMath 3 ${prefix}_mask.nii.gz GetLargestComponent ${prefix}_mask.nii.gz + scil_volume_math dilation ${prefix}_mask.nii.gz $nb_vox ${prefix}_mask.nii.gz --data_type uint8 -f + ImageMath 3 ${prefix}_mask.nii.gz FillHoles ${prefix}_mask.nii.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + scilpy: \$(uv -q -n pip list | grep scilpy | tr -s ' ' | cut -d' ' -f2) + fsl: \$(flirt -version 2>&1 | sed -n 's/FLIRT version \\([0-9.]\\+\\)/\\1/p') + ants: \$(ImageMath --version 2>&1 | sed -n 's/ANTs Version: v\\([0-9.]\\+\\)/\\1/p') + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + fslmaths + scil_volume_math -h + ImageMath + + touch ${prefix}_mask.nii.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + scilpy: \$(uv pip -q -n list | grep scilpy | tr -s ' ' | cut -d' ' -f2) + fsl: \$(flirt -version 2>&1 | sed -n 's/FLIRT version \\([0-9.]\\+\\)/\\1/p') + ants: \$(ImageMath --version 2>&1 | sed -n 's/ANTs Version: v\\([0-9.]\\+\\)/\\1/p') + END_VERSIONS + """ +} \ No newline at end of file diff --git a/modules/local/mouse/convertbet/meta.yml b/modules/local/mouse/convertbet/meta.yml new file mode 100755 index 0000000..fc7e4b5 --- /dev/null +++ b/modules/local/mouse/convertbet/meta.yml @@ -0,0 +1,44 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/scilus/nf-neuro/main/modules/meta-schema.json +name: "mouse_convertjson" +description: Convert stats to JSON +keywords: + - stats + - convert +tools: + - "scilpy": + description: "The Sherbrooke Connectivity Imaging Lab (SCIL) Python dMRI processing toolbox." + homepage: "https://github.com/scilus/scilpy.git" +input: + # Only when we have meta + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + + - stats: + type: list + description: DWI Nifti image + pattern: "*.{nii,nii.gz}" + +output: + #Only when we have meta + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + + - stats_json: + type: file + description: File with stats + pattern: "stats_reorganized.json" + + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@EliseCos" \ No newline at end of file diff --git a/modules/local/mouse/convertjson/main.nf b/modules/local/mouse/convertjson/main.nf index 5702964..f112f1a 100644 --- a/modules/local/mouse/convertjson/main.nf +++ b/modules/local/mouse/convertjson/main.nf @@ -25,6 +25,7 @@ process MOUSE_CONVERTJSON { """ stub: + def prefix = task.ext.prefix ?: "${meta.id}" """ touch ${prefix}__stats_reorganized.json diff --git a/modules/local/mouse/preparebet/environment.yml b/modules/local/mouse/preparebet/environment.yml new file mode 100644 index 0000000..9e99afe --- /dev/null +++ b/modules/local/mouse/preparebet/environment.yml @@ -0,0 +1,3 @@ +channels: [] +dependencies: [] +name: "mouse_preparebet" diff --git a/modules/local/mouse/preparebet/main.nf b/modules/local/mouse/preparebet/main.nf new file mode 100644 index 0000000..365730f --- /dev/null +++ b/modules/local/mouse/preparebet/main.nf @@ -0,0 +1,40 @@ +process MOUSE_PREPAREBET { + tag "$meta.id" + label 'process_high' + + container "scilus/scilus:2.2.0" + + input: + tuple val(meta), path(anat) + output: + tuple val(meta), path("*_n4_second.nii.gz") , emit: betready + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + + N4BiasFieldCorrection -d 3 -i ${anat} -o ${prefix}__n4_first.nii.gz -s 4 -c [20x20x10,1e-6] + N4BiasFieldCorrection -d 3 -i ${prefix}__n4_first.nii.gz -o ${prefix}__n4_second.nii.gz -s 2 -c [30x20x10,1e-6] + + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + N4BiasFieldCorrection -h + + touch ${prefix}__n4_second.nii.gz + + cat <<-END_VERSIONS > versions.yml + ants: \$(N4BiasFieldCorrection --version 2>&1 | sed -n 's/ANTs Version: v\\([0-9.]\\+\\)/\\1/p') + END_VERSIONS + """ +} diff --git a/modules/local/mouse/preparebet/meta.yml b/modules/local/mouse/preparebet/meta.yml new file mode 100755 index 0000000..2ab9ed4 --- /dev/null +++ b/modules/local/mouse/preparebet/meta.yml @@ -0,0 +1,40 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/scilus/nf-neuro/main/modules/meta-schema.json +name: "preparebet" +description: Prepare anatomical images for brain extraction with BET +keywords: + - volume + - mask +tools: + - "scilpy": + description: "The Sherbrooke Connectivity Imaging Lab (SCIL) Python dMRI processing toolbox." + homepage: "https://github.com/scilus/scilpy.git" +input: + # Only when we have meta + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + + - anat: + type: list + description: Anat Nifti image + pattern: "*.{nii,nii.gz}" + + +output: + #Only when we have meta + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@EliseCos" \ No newline at end of file diff --git a/modules/local/mouse/register/main.nf b/modules/local/mouse/register/main.nf index 01bfec9..0bf5cd7 100644 --- a/modules/local/mouse/register/main.nf +++ b/modules/local/mouse/register/main.nf @@ -184,8 +184,9 @@ process MOUSE_REGISTRATION { cat <<-END_VERSIONS > versions.yml "${task.process}": - scilpy: \$(uv -q -n pip list | grep scilpy | tr -s ' ' | cut -d' ' -f2) + scilpy: \$(uv -q -n pip list | grep scilpy | tr -s ' ' | cut -d' ' -f2) fsl: \$(flirt -version 2>&1 | sed -n 's/FLIRT version \\([0-9.]\\+\\)/\\1/p') + ants: \$(antsRegistration --version 2>&1 | sed -n 's/ANTs Version: v\\([0-9.]\\+\\)/\\1/p') END_VERSIONS """ @@ -206,9 +207,10 @@ process MOUSE_REGISTRATION { cat <<-END_VERSIONS > versions.yml "${task.process}": - scilpy: \$(uv -q -n pip list | grep scilpy | tr -s ' ' | cut -d' ' -f2) + scilpy: \$(uv -q -n pip list | grep scilpy | tr -s ' ' | cut -d' ' -f2) mrtrix: \$(dwidenoise -version 2>&1 | sed -n 's/== dwidenoise \\([0-9.]\\+\\).*/\\1/p') fsl: \$(flirt -version 2>&1 | sed -n 's/FLIRT version \\([0-9.]\\+\\)/\\1/p') + ants: \$(antsRegistration --version 2>&1 | sed -n 's/ANTs Version: v\\([0-9.]\\+\\)/\\1/p') END_VERSIONS """ } diff --git a/nextflow.config b/nextflow.config index 0c56e62..05bffac 100644 --- a/nextflow.config +++ b/nextflow.config @@ -14,6 +14,12 @@ params { // Eddy run_eddy = true processes = 10 + + // Masked + data_masked = false + + // Invivo + invivo = false // N4 run_n4 = true @@ -28,6 +34,7 @@ params { nvox_min = 100 // FODF || QBALL + run_fodf_metrics = true use_fodf_for_tracking = false sh_order = 6 min_fodf_value = 1000 @@ -225,6 +232,14 @@ profiles { pre_qc { params.run_preqc = true + params.use_preqc = true + } + + invivo { + params.invivo = true + params.run_resampling = false + params.run_fodf_metrics = false + params.run_tracking = false } } @@ -264,6 +279,10 @@ process { ] } + withName: "MOUSE_BET" { + ext.nb_vox = 3 + } + withName: "UTILS_EXTRACTB0" { ext.b0_threshold = params.b0_threshold } @@ -318,7 +337,7 @@ process { ext.atlas_resolution = "" ext.run_qc = true publishDir = [ - path: { "${params.outdir}/${meta.id}/anat/"}, + [ path: { "${params.outdir}/${meta.id}/anat/"}, saveAs: { filename -> if ( filename.contains("ANO.nii.gz") ) { "${meta.id}_atlas-Allen_desc-ANO_dseg.nii.gz"} @@ -327,19 +346,18 @@ process { else if ( filename.contains("0GenericAffine.mat") ) { "${meta.id}_from-Allen_to-dwi_affine.mat"} else if ( filename.contains("1Warp.nii.gz") ) { "${meta.id}_from-Allen_to-dwi_warp.nii.gz"} else if ( filename.contains("1InverseWarp.nii.gz") ) { "${meta.id}_from-dwi_to-Allen_warp.nii.gz"} - else if ( filename.contains("b0.nii.gz") ) { "${meta.id}_desc-process_b0.nii.gz"} else if ( filename.contains("versions.yml") ) { null } else { params.lean_output ? null : filename } - }, - path: { "${params.outdir}/${meta.id}/anat/"}, + } ], + [ path: { "${params.outdir}/${meta.id}/dwi/"}, saveAs: { filename -> if ( filename.contains("b0.nii.gz") ) { "${meta.id}_desc-process_b0.nii.gz"} else if ( filename.contains("versions.yml") ) { null } else { params.lean_output ? null : filename } - } + }] ] } diff --git a/subworkflows/local/bet/main.nf b/subworkflows/local/bet/main.nf new file mode 100644 index 0000000..be97e8f --- /dev/null +++ b/subworkflows/local/bet/main.nf @@ -0,0 +1,27 @@ +include { MOUSE_PREPAREBET } from '../../../modules/local/mouse/preparebet/main.nf' +include { MOUSE_BRAINEXTRACTION } from '../../../modules/local/mouse/brainextraction/main.nf' +include { MOUSE_CONVERTBET } from '../../../modules/local/mouse/convertbet/main.nf' + +workflow BET { + + take: + ch_bet // channel: [ val(meta), dwi, bval, b0, mask] + + main: + + ch_versions = Channel.empty() + ch_multiqc_files = Channel.empty() + + + MOUSE_PREPAREBET(ch_bet) + + MOUSE_BRAINEXTRACTION(MOUSE_PREPAREBET.out.betready) + + MOUSE_CONVERTBET(MOUSE_BRAINEXTRACTION.out.mask) + + + emit: + mask = MOUSE_CONVERTBET.out.mask // channel: [ val(meta), mask ] + mqc = ch_multiqc_files // channel: [ val(meta), mqc ] + versions = ch_versions // channel: [ versions.yml ] +}