From 77106a82cd420f56656cbda2df463dccb102bfc5 Mon Sep 17 00:00:00 2001 From: anroy1 Date: Wed, 30 Oct 2024 02:24:37 +0000 Subject: [PATCH 1/4] fix bundleseg if atlas is provided --- modules/nf-neuro/bundle/recognize/main.nf | 4 ++-- subworkflows/nf-neuro/bundle_seg/main.nf | 13 ++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/modules/nf-neuro/bundle/recognize/main.nf b/modules/nf-neuro/bundle/recognize/main.nf index bec2b290..da74a9d9 100644 --- a/modules/nf-neuro/bundle/recognize/main.nf +++ b/modules/nf-neuro/bundle/recognize/main.nf @@ -1,10 +1,10 @@ process BUNDLE_RECOGNIZE { tag "$meta.id" - label 'process_single' + label 'process_high' container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? 'https://scil.usherbrooke.ca/containers/scilus_2.0.0.sif': - 'scilus/scilus:2.0.0' }" + 'scilus/scilus:2.0.2' }" input: tuple val(meta), path(tractograms), path(transform), path(config), path(directory) diff --git a/subworkflows/nf-neuro/bundle_seg/main.nf b/subworkflows/nf-neuro/bundle_seg/main.nf index 58502005..17591fe8 100644 --- a/subworkflows/nf-neuro/bundle_seg/main.nf +++ b/subworkflows/nf-neuro/bundle_seg/main.nf @@ -52,17 +52,16 @@ workflow BUNDLE_SEG { take: ch_fa // channel: [ val(meta), [ fa ] ] ch_tractogram // channel: [ val(meta), [ tractogram ] ] - atlas_directory // channel: [ directory ], optional: True main: ch_versions = Channel.empty() // ** Setting up Atlas reference channels. ** // - if ( atlas_directory ) { - atlas_anat = Channel.fromPath("$atlas_directory/*.{nii,nii.gz}") - atlas_config = Channel.fromPath("$atlas_directory/*.json") - atlas_directory = Channel.fromPath("$atlas_directory/atlas/") + if ( params.atlas_directory ) { + atlas_anat = Channel.fromPath("$atlas_directory/atlas/mni_masked.nii.gz.nii.gz") + atlas_config = Channel.fromPath("$atlas_directory/config/config_fss_1.json") + atlas_average = Channel.fromPath("$atlas_directory/atlas/atlas/") } else { fetch_bundleseg_atlas( "https://zenodo.org/records/10103446/files/atlas.zip?download=1", @@ -70,7 +69,7 @@ workflow BUNDLE_SEG { "${workflow.workDir}/") atlas_anat = Channel.fromPath("$workflow.workDir/atlas/mni_masked.nii.gz") atlas_config = Channel.fromPath("$workflow.workDir/config/config_fss_1.json") - atlas_directory = Channel.fromPath("$workflow.workDir/atlas/atlas/") + atlas_average = Channel.fromPath("$workflow.workDir/atlas/atlas/") } // ** Register the atlas to subject's space. Set up atlas file as moving image ** // @@ -84,7 +83,7 @@ workflow BUNDLE_SEG { // ** Perform bundle recognition and segmentation ** // ch_recognize_bundle = ch_tractogram.join(REGISTRATION_ANTS.out.transfo_image) .combine(atlas_config) - .combine(atlas_directory) + .combine(atlas_average) BUNDLE_RECOGNIZE ( ch_recognize_bundle ) ch_versions = ch_versions.mix(BUNDLE_RECOGNIZE.out.versions.first()) From 478ab2f083aa5a81f08de2306272f931c0a748d0 Mon Sep 17 00:00:00 2001 From: anroy1 Date: Thu, 31 Oct 2024 12:27:07 +0000 Subject: [PATCH 2/4] Delete third input channel for bundleseg --- subworkflows/nf-neuro/bundle_seg/tests/main.nf.test | 1 - 1 file changed, 1 deletion(-) diff --git a/subworkflows/nf-neuro/bundle_seg/tests/main.nf.test b/subworkflows/nf-neuro/bundle_seg/tests/main.nf.test index 46e11741..4ab62733 100644 --- a/subworkflows/nf-neuro/bundle_seg/tests/main.nf.test +++ b/subworkflows/nf-neuro/bundle_seg/tests/main.nf.test @@ -43,7 +43,6 @@ nextflow_workflow { file("\${test_data_directory}/pft.trk") ] } - input[2] = [] """ } } From e66ce3675645e03b0cc420cf713a8ac9d1c6e5f8 Mon Sep 17 00:00:00 2001 From: Arnaud Bore Date: Thu, 31 Oct 2024 13:44:52 -0400 Subject: [PATCH 3/4] Update modules/nf-neuro/bundle/recognize/main.nf --- modules/nf-neuro/bundle/recognize/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-neuro/bundle/recognize/main.nf b/modules/nf-neuro/bundle/recognize/main.nf index da74a9d9..627785a5 100644 --- a/modules/nf-neuro/bundle/recognize/main.nf +++ b/modules/nf-neuro/bundle/recognize/main.nf @@ -3,7 +3,7 @@ process BUNDLE_RECOGNIZE { label 'process_high' container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://scil.usherbrooke.ca/containers/scilus_2.0.0.sif': + 'https://scil.usherbrooke.ca/containers/scilus_2.0.2.sif': 'scilus/scilus:2.0.2' }" input: From 63ed46344c1dcc0fba432e05c769b0ae5ff8286a Mon Sep 17 00:00:00 2001 From: Arnaud Bore Date: Thu, 31 Oct 2024 13:45:56 -0400 Subject: [PATCH 4/4] Update subworkflows/nf-neuro/bundle_seg/main.nf --- subworkflows/nf-neuro/bundle_seg/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subworkflows/nf-neuro/bundle_seg/main.nf b/subworkflows/nf-neuro/bundle_seg/main.nf index 17591fe8..68b3432d 100644 --- a/subworkflows/nf-neuro/bundle_seg/main.nf +++ b/subworkflows/nf-neuro/bundle_seg/main.nf @@ -59,7 +59,7 @@ workflow BUNDLE_SEG { // ** Setting up Atlas reference channels. ** // if ( params.atlas_directory ) { - atlas_anat = Channel.fromPath("$atlas_directory/atlas/mni_masked.nii.gz.nii.gz") + atlas_anat = Channel.fromPath("$atlas_directory/atlas/mni_masked.nii.gz") atlas_config = Channel.fromPath("$atlas_directory/config/config_fss_1.json") atlas_average = Channel.fromPath("$atlas_directory/atlas/atlas/") }