Skip to content

Commit

Permalink
Manage synth conditionnality through params instead of input
Browse files Browse the repository at this point in the history
  • Loading branch information
anroy1 committed Aug 31, 2024
1 parent fdb32e5 commit 0a16b4d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
6 changes: 3 additions & 3 deletions subworkflows/nf-scil/preproc_t1/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ include { BETCROP_SYNTHBET} from '../../../modules/nf-scil/betcrop/synthbet/main
include { BETCROP_CROPVOLUME as BETCROP_CROPVOLUME_T1 } from '../../../modules/nf-scil/betcrop/cropvolume/main'
include { BETCROP_CROPVOLUME as BETCROP_CROPVOLUME_MASK } from '../../../modules/nf-scil/betcrop/cropvolume/main'

params.run_synth = params.run_synth ?: false

workflow PREPROC_T1 {

take:
Expand All @@ -18,8 +20,6 @@ workflow PREPROC_T1 {
ch_ref_resample // channel: [ val(meta), [ ref ] ] , optional
ch_weights // channel: [ val(meta), [ weights ] ] , optional

val_synth(false) // value: (default: false) , optional

main:

ch_versions = Channel.empty()
Expand All @@ -40,7 +40,7 @@ workflow PREPROC_T1 {
ch_versions = ch_versions.mix(IMAGE_RESAMPLE.out.versions.first())

// ** Brain extraction ** //
if ( val_synth ) {
if ( params.run_synth ) {
ch_bet = IMAGE_RESAMPLE.out.image.join(ch_weights)
BETCROP_SYNTHBET ( ch_bet )
ch_versions = ch_versions.mix(BETCROP_SYNTHBET.out.versions.first())
Expand Down
3 changes: 0 additions & 3 deletions subworkflows/nf-scil/preproc_t1/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ nextflow_workflow {
[ id:'test', single_end:false ],
[]
]}
input[7] = false
"""
}
}
Expand Down Expand Up @@ -135,7 +134,6 @@ nextflow_workflow {
[ id:'test', single_end:false ],
[]
]}
input[7] = false
"""
}
}
Expand Down Expand Up @@ -195,7 +193,6 @@ test("preproc_t1_synth") {
[ id:'test', single_end:false ],
[]
]}
input[7] = true
"""
}
}
Expand Down
12 changes: 6 additions & 6 deletions subworkflows/nf-scil/preproc_t1/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@
],
"meta": {
"nf-test": "0.9.0-rc1",
"nextflow": "24.04.3"
"nextflow": "24.04.4"
},
"timestamp": "2024-07-30T20:24:23.951944"
"timestamp": "2024-08-27T16:07:20.834954"
},
"preproc_t1_synth": {
"content": [
Expand Down Expand Up @@ -337,9 +337,9 @@
],
"meta": {
"nf-test": "0.9.0-rc1",
"nextflow": "24.04.3"
"nextflow": "24.04.4"
},
"timestamp": "2024-07-30T19:21:50.686836"
"timestamp": "2024-08-27T16:12:58.594953"
},
"preproc_t1_classic": {
"content": [
Expand Down Expand Up @@ -508,8 +508,8 @@
],
"meta": {
"nf-test": "0.9.0-rc1",
"nextflow": "24.04.3"
"nextflow": "24.04.4"
},
"timestamp": "2024-07-30T20:05:33.018053"
"timestamp": "2024-08-27T15:48:27.520928"
}
}
4 changes: 4 additions & 0 deletions subworkflows/nf-scil/preproc_t1/tests/nextflow_synth.config
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ process {
memory = 8.GB
}
}

params {
run_synth = true
}

0 comments on commit 0a16b4d

Please sign in to comment.