Skip to content

Commit

Permalink
added required parameters specifying dti and fodf shells for more rep…
Browse files Browse the repository at this point in the history
…roducibility
  • Loading branch information
gagnonanthony committed Jan 9, 2025
1 parent c4ce1b5 commit 7340fce
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 5 deletions.
6 changes: 6 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,8 @@ process {
withName: 'NF_PEDIATRIC:PEDIATRIC:PREPROC_DWI:NORMALIZE_DWI' {
ext.fa_mask_threshold = params.dwi_normalize_fa_mask_threshold
ext.dwi_shell_tolerance = params.dwi_normalize_shell_tolerance
ext.dti_shells = params.dti_shells
ext.max_dti_shell_value = params.dti_max_shell_value
publishDir = [
path: { "${params.outdir}/${meta.id}/dwi/"},
mode: params.publish_dir_mode,
Expand Down Expand Up @@ -458,6 +460,7 @@ process {
ext.dwi_shell_tolerance = params.dti_shell_tolerance
ext.max_dti_shell_value = params.dti_max_shell_value
ext.b0_thr_extract_b0 = params.dti_b0_threshold
ext.dti_shells = params.dti_shells

// ** DTI metrics to output ** //
ext.ad = true
Expand Down Expand Up @@ -502,6 +505,8 @@ process {
ext.dwi_shell_tolerance = params.frf_dwi_shell_tolerance
ext.max_dti_shell_value = params.frf_max_dti_shell_value
ext.min_fodf_shell_value = params.frf_min_fodf_shell_value
ext.fodf_shells = params.fodf_shells
ext.dti_shells = params.dti_shells
ext.b0_thr_extract_b0 = params.frf_b0_threshold
ext.set_method = params.frf_set_method
ext.set_frf = params.frf_set_frf
Expand All @@ -522,6 +527,7 @@ process {
withName: 'NF_PEDIATRIC:PEDIATRIC:RECONST_FODF' {
ext.dwi_shell_tolerance = params.fodf_shell_tolerance
ext.min_fodf_shell_value = params.fodf_min_fodf_shell_value
ext.fodf_shells = params.fodf_shells
ext.b0_thr_extract_b0 = params.fodf_b0_threshold
ext.sh_order = params.fodf_sh_order
ext.sh_basis = params.fodf_sh_basis
Expand Down
2 changes: 2 additions & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ params {
dti_shell_tolerance = 50
dti_max_shell_value = 1500
dti_b0_threshold = 20
dti_shells = null

// FRF
frf_fa = 0.7
Expand All @@ -121,6 +122,7 @@ params {
// FODF Metrics
fodf_shell_tolerance = 50
fodf_min_fodf_shell_value = 100
fodf_shells = null
fodf_b0_threshold = 20
fodf_sh_order = 8
fodf_sh_basis = "descoteaux07"
Expand Down
20 changes: 17 additions & 3 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@
"fa_icon": "fas fa-brain",
"description": "Options for DTI processing.",
"help_text": "These options are used to configure the DTI processing steps in the pipeline. You can use these options to customise the behaviour of the DTI processing steps.",
"required": ["dti_shells"],
"properties": {
"dti_shell_tolerance": {
"type": "integer",
Expand All @@ -419,14 +420,20 @@
"description": "Maximum shell value used in the DTI processing step.",
"fa_icon": "fas fa-brain",
"default": 1500,
"hidden": false
"hidden": true
},
"dti_b0_threshold": {
"type": "integer",
"description": "B0 threshold used in the DTI processing step.",
"fa_icon": "fas fa-brain",
"default": 20,
"hidden": true
},
"dti_shells": {
"type": "string",
"description": "Shells used in the DTI processing step.",
"fa_icon": "fas fa-brain",
"hidden": false
}
}
},
Expand Down Expand Up @@ -477,14 +484,14 @@
"description": "Maximum DTI shell value used.",
"fa_icon": "fas fa-brain",
"default": 1500,
"hidden": false
"hidden": true
},
"frf_min_fodf_shell_value": {
"type": "integer",
"description": "Minimum FODF shell value used.",
"fa_icon": "fas fa-brain",
"default": 100,
"hidden": false
"hidden": true
},
"frf_b0_threshold": {
"type": "integer",
Expand Down Expand Up @@ -530,6 +537,7 @@
"fa_icon": "fas fa-brain",
"description": "Options for FODF processing.",
"help_text": "These options are used to configure the FODF processing steps in the pipeline. You can use these options to customise the behaviour of the FODF processing steps.",
"required": ["fodf_shells"],
"properties": {
"fodf_shell_tolerance": {
"type": "integer",
Expand All @@ -543,6 +551,12 @@
"description": "Minimum FODF shell value used.",
"fa_icon": "fas fa-brain",
"default": 100,
"hidden": true
},
"fodf_shells": {
"type": "string",
"description": "Shells used in the FODF processing step.",
"fa_icon": "fas fa-brain",
"hidden": false
},
"fodf_b0_threshold": {
Expand Down
1 change: 1 addition & 0 deletions subworkflows/nf-neuro/preproc_t1/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ workflow PREPROC_T1 {
ch_bet = IMAGE_RESAMPLE.out.image
.join(ch_template)
.join(ch_probability_map)
.map{ it + [[], []] }

BETCROP_ANTSBET ( ch_bet )
ch_versions = ch_versions.mix(BETCROP_ANTSBET.out.versions.first())
Expand Down
3 changes: 2 additions & 1 deletion subworkflows/nf-neuro/preproc_t1/preproc_t1.diff
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Changes in component 'nf-neuro/preproc_t1'
Changes in 'preproc_t1/main.nf':
--- subworkflows/nf-neuro/preproc_t1/main.nf
+++ subworkflows/nf-neuro/preproc_t1/main.nf
@@ -88,9 +88,10 @@
@@ -88,9 +88,11 @@
// The template and probability maps are mandatory if running antsBET. Since the
// error message from nextflow when they are absent is either non-informative or
// missing, we use ifEmpty to provide a more informative one.
Expand All @@ -13,6 +13,7 @@ Changes in 'preproc_t1/main.nf':
- .join(ch_probability_map.ifEmpty{ error("ANTS BET needs a tissue probability map") })
+ .join(ch_template)
+ .join(ch_probability_map)
+ .map{ it + [[], []] }

BETCROP_ANTSBET ( ch_bet )
ch_versions = ch_versions.mix(BETCROP_ANTSBET.out.versions.first())
Expand Down
2 changes: 1 addition & 1 deletion workflows/pediatric.nf
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ workflow PEDIATRIC {

ch_template = Channel.fromPath(params.t1_bet_template, checkIfExists: true)
ch_probability_map = Channel.fromPath(params.t1_bet_template_probability_map, checkIfExists: true)
.map{ it + [[], []] }

if ( params.t1_synthstrip_weights ) {
ch_t1_weights = Channel.fromPath(params.t1_synthstrip_weights, checkIfExists: false)
} else {
Expand Down

0 comments on commit 7340fce

Please sign in to comment.