From 0cd783197bb404ceb983ce86b4579271a06756ff Mon Sep 17 00:00:00 2001 From: Anthony Gagnon Date: Thu, 12 Dec 2024 15:12:32 -0500 Subject: [PATCH 1/5] fix external atlas use in bundle_seg --- subworkflows/nf-neuro/bundle_seg/main.nf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subworkflows/nf-neuro/bundle_seg/main.nf b/subworkflows/nf-neuro/bundle_seg/main.nf index 68b3432d..e38b407a 100644 --- a/subworkflows/nf-neuro/bundle_seg/main.nf +++ b/subworkflows/nf-neuro/bundle_seg/main.nf @@ -59,9 +59,9 @@ workflow BUNDLE_SEG { // ** Setting up Atlas reference channels. ** // if ( params.atlas_directory ) { - 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/") + atlas_anat = Channel.fromPath("$params.atlas_directory/atlas/mni_masked.nii.gz", checkIfExists: true, relative: true) + atlas_config = Channel.fromPath("$params.atlas_directory/config/config_fss_1.json", checkIfExists: true, relative: true) + atlas_average = Channel.fromPath("$params.atlas_directory/atlas/atlas/", checkIfExists: true, relative: true) } else { fetch_bundleseg_atlas( "https://zenodo.org/records/10103446/files/atlas.zip?download=1", From b7bf57e0e1f3aedfacb7257daa1639ae443b2e84 Mon Sep 17 00:00:00 2001 From: Anthony Gagnon Date: Fri, 13 Dec 2024 12:31:51 -0500 Subject: [PATCH 2/5] fetch only affine mat for recognize bundle and validate file exist before downloading atlas --- subworkflows/nf-neuro/bundle_seg/main.nf | 15 ++++- .../bundle_seg/tests/main.nf.test.snap | 66 +++++++++++-------- .../nf-neuro/bundle_seg/tests/nextflow.config | 4 +- 3 files changed, 52 insertions(+), 33 deletions(-) diff --git a/subworkflows/nf-neuro/bundle_seg/main.nf b/subworkflows/nf-neuro/bundle_seg/main.nf index e38b407a..843f9178 100644 --- a/subworkflows/nf-neuro/bundle_seg/main.nf +++ b/subworkflows/nf-neuro/bundle_seg/main.nf @@ -64,9 +64,11 @@ workflow BUNDLE_SEG { atlas_average = Channel.fromPath("$params.atlas_directory/atlas/atlas/", checkIfExists: true, relative: true) } else { + if ( !file("$workflow.workDir/atlas/mni_masked.nii.gz").exists() ) { fetch_bundleseg_atlas( "https://zenodo.org/records/10103446/files/atlas.zip?download=1", "https://zenodo.org/records/10103446/files/config.zip?download=1", "${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_average = Channel.fromPath("$workflow.workDir/atlas/atlas/") @@ -80,10 +82,17 @@ workflow BUNDLE_SEG { REGISTRATION_ANTS ( ch_register ) ch_versions = ch_versions.mix(REGISTRATION_ANTS.out.versions.first()) + // ** Fetch only the .mat transformation file. ** // + ch_mat = REGISTRATION_ANTS.out.transfo_image + .flatten() + .toList() + .map{ [it[0], it[2]] } + // ** Perform bundle recognition and segmentation ** // - ch_recognize_bundle = ch_tractogram.join(REGISTRATION_ANTS.out.transfo_image) - .combine(atlas_config) - .combine(atlas_average) + ch_recognize_bundle = ch_tractogram + .join(ch_mat) + .combine(atlas_config) + .combine(atlas_average) BUNDLE_RECOGNIZE ( ch_recognize_bundle ) ch_versions = ch_versions.mix(BUNDLE_RECOGNIZE.out.versions.first()) diff --git a/subworkflows/nf-neuro/bundle_seg/tests/main.nf.test.snap b/subworkflows/nf-neuro/bundle_seg/tests/main.nf.test.snap index 8fd45e33..62c150e2 100644 --- a/subworkflows/nf-neuro/bundle_seg/tests/main.nf.test.snap +++ b/subworkflows/nf-neuro/bundle_seg/tests/main.nf.test.snap @@ -9,22 +9,27 @@ "single_end": false }, [ - "test__AF_L_cleaned.trk:md5,b9a6567efffa206202f37c11afea2391", - "test__CC_Fr_2_cleaned.trk:md5,ad18f4415d6d5baae1ec81359ccffecb", - "test__CC_Pr_Po_cleaned.trk:md5,dca763cddc2decfa64baf452cc035b5a", - "test__CG_R_An_cleaned.trk:md5,79c5f2469b1fcae2599247ced8d68e07", - "test__CG_R_cleaned.trk:md5,79c5f2469b1fcae2599247ced8d68e07", - "test__FPT_L_Brainstem_cleaned.trk:md5,d6c9af62d9ad65d95257093148bf4d9a", - "test__FPT_L_cleaned.trk:md5,d6c9af62d9ad65d95257093148bf4d9a", - "test__ILF_L_cleaned.trk:md5,00f9f6e33e59bfe8bbe3a5afd18b0f2e", - "test__MCP_cleaned.trk:md5,ed86370180b35e125ae410aa3d520625", - "test__OR_ML_L_cleaned.trk:md5,721b658ed8a4de104c4e7c207d4fe170", + "test__AF_L_cleaned.trk:md5,028aad575b0191512638054aae48aedc", + "test__AF_R_cleaned.trk:md5,36ad2f6bc0333de2c3047e19df9fd122", + "test__CC_Fr_1_cleaned.trk:md5,122f7573437035e37581a6525a5f9ef0", + "test__CC_Fr_2_cleaned.trk:md5,1aadd5139071a96e22e3fc1889396c03", + "test__CC_Pa_cleaned.trk:md5,6c7fdf1f5f9cebb3160ac076657b7815", + "test__CC_Pr_Po_cleaned.trk:md5,14a09e95cb82e5b720ac39ccf382e8a1", + "test__FAT_R_cleaned.trk:md5,80749af923fd8d9f85f06c3fce80c680", + "test__FPT_L_Brainstem_cleaned.trk:md5,8df02afad80747922b8fda408d2e87a8", + "test__FPT_L_cleaned.trk:md5,6af39bbd85cc396d95c667734c4876e5", + "test__FPT_R_Brainstem_cleaned.trk:md5,625c397e54e5fc45dd4266a8fadfafd0", + "test__FPT_R_cleaned.trk:md5,625c397e54e5fc45dd4266a8fadfafd0", + "test__ILF_L_cleaned.trk:md5,5a3e80fed89f3ac92c07544830d56fea", + "test__ILF_R_cleaned.trk:md5,44bd133c97909ba344a0df98381f59b5", + "test__MCP_cleaned.trk:md5,a1eaaedc048cf82d67569660a3afab70", "test__POPT_R_Brainstem_cleaned.trk:md5,6c07d476650f4bca894c4c2454a1783f", "test__POPT_R_cleaned.trk:md5,6c07d476650f4bca894c4c2454a1783f", + "test__PYT_L_Brainstem_cleaned.trk:md5,a67f6be5ecf9a8e2211e997bc3c2b268", "test__PYT_L_cleaned.trk:md5,ac9973ef987c34ecee0328004033ea46", - "test__PYT_R_Brainstem_cleaned.trk:md5,28b4be34422e356030b6b081efca31d5", - "test__PYT_R_cleaned.trk:md5,50f8127bbaab6f4b9fea790a7c11679d", - "test__SLF_L_cleaned.trk:md5,3660a62ee7e0e413f7417e80c1842e60" + "test__PYT_R_cleaned.trk:md5,2babf062dcc87252950ec47a72ab347c", + "test__SLF_L_cleaned.trk:md5,55b5a7c7ae7a29043ca4ff43fa5ba9e6", + "test__SLF_R_cleaned.trk:md5,83068144984abd0fd55936903c61016c" ] ] ], @@ -39,22 +44,27 @@ "single_end": false }, [ - "test__AF_L_cleaned.trk:md5,b9a6567efffa206202f37c11afea2391", - "test__CC_Fr_2_cleaned.trk:md5,ad18f4415d6d5baae1ec81359ccffecb", - "test__CC_Pr_Po_cleaned.trk:md5,dca763cddc2decfa64baf452cc035b5a", - "test__CG_R_An_cleaned.trk:md5,79c5f2469b1fcae2599247ced8d68e07", - "test__CG_R_cleaned.trk:md5,79c5f2469b1fcae2599247ced8d68e07", - "test__FPT_L_Brainstem_cleaned.trk:md5,d6c9af62d9ad65d95257093148bf4d9a", - "test__FPT_L_cleaned.trk:md5,d6c9af62d9ad65d95257093148bf4d9a", - "test__ILF_L_cleaned.trk:md5,00f9f6e33e59bfe8bbe3a5afd18b0f2e", - "test__MCP_cleaned.trk:md5,ed86370180b35e125ae410aa3d520625", - "test__OR_ML_L_cleaned.trk:md5,721b658ed8a4de104c4e7c207d4fe170", + "test__AF_L_cleaned.trk:md5,028aad575b0191512638054aae48aedc", + "test__AF_R_cleaned.trk:md5,36ad2f6bc0333de2c3047e19df9fd122", + "test__CC_Fr_1_cleaned.trk:md5,122f7573437035e37581a6525a5f9ef0", + "test__CC_Fr_2_cleaned.trk:md5,1aadd5139071a96e22e3fc1889396c03", + "test__CC_Pa_cleaned.trk:md5,6c7fdf1f5f9cebb3160ac076657b7815", + "test__CC_Pr_Po_cleaned.trk:md5,14a09e95cb82e5b720ac39ccf382e8a1", + "test__FAT_R_cleaned.trk:md5,80749af923fd8d9f85f06c3fce80c680", + "test__FPT_L_Brainstem_cleaned.trk:md5,8df02afad80747922b8fda408d2e87a8", + "test__FPT_L_cleaned.trk:md5,6af39bbd85cc396d95c667734c4876e5", + "test__FPT_R_Brainstem_cleaned.trk:md5,625c397e54e5fc45dd4266a8fadfafd0", + "test__FPT_R_cleaned.trk:md5,625c397e54e5fc45dd4266a8fadfafd0", + "test__ILF_L_cleaned.trk:md5,5a3e80fed89f3ac92c07544830d56fea", + "test__ILF_R_cleaned.trk:md5,44bd133c97909ba344a0df98381f59b5", + "test__MCP_cleaned.trk:md5,a1eaaedc048cf82d67569660a3afab70", "test__POPT_R_Brainstem_cleaned.trk:md5,6c07d476650f4bca894c4c2454a1783f", "test__POPT_R_cleaned.trk:md5,6c07d476650f4bca894c4c2454a1783f", + "test__PYT_L_Brainstem_cleaned.trk:md5,a67f6be5ecf9a8e2211e997bc3c2b268", "test__PYT_L_cleaned.trk:md5,ac9973ef987c34ecee0328004033ea46", - "test__PYT_R_Brainstem_cleaned.trk:md5,28b4be34422e356030b6b081efca31d5", - "test__PYT_R_cleaned.trk:md5,50f8127bbaab6f4b9fea790a7c11679d", - "test__SLF_L_cleaned.trk:md5,3660a62ee7e0e413f7417e80c1842e60" + "test__PYT_R_cleaned.trk:md5,2babf062dcc87252950ec47a72ab347c", + "test__SLF_L_cleaned.trk:md5,55b5a7c7ae7a29043ca4ff43fa5ba9e6", + "test__SLF_R_cleaned.trk:md5,83068144984abd0fd55936903c61016c" ] ] ], @@ -66,8 +76,8 @@ ], "meta": { "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nextflow": "24.10.1" }, - "timestamp": "2024-10-24T20:26:57.178201" + "timestamp": "2024-12-13T11:51:35.634778" } } \ No newline at end of file diff --git a/subworkflows/nf-neuro/bundle_seg/tests/nextflow.config b/subworkflows/nf-neuro/bundle_seg/tests/nextflow.config index 2089b09d..e45be487 100644 --- a/subworkflows/nf-neuro/bundle_seg/tests/nextflow.config +++ b/subworkflows/nf-neuro/bundle_seg/tests/nextflow.config @@ -4,12 +4,12 @@ process { ext.threads = 1 ext.random_seed = 44 ext.repro_mode = 1 - ext.transform = "r" + ext.transform = "s" publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } } withName: "BUNDLE_RECOGNIZE" { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - ext.minimal_vote_ratio = 0.8 + ext.minimal_vote_ratio = 0.9 ext.rbx_processes = 1 ext.seed = 44 ext.outlier_alpha = 0.4 From ee1433788f049b23b6635ddcc86996e5536b352a Mon Sep 17 00:00:00 2001 From: Anthony Gagnon Date: Mon, 16 Dec 2024 18:04:40 +0000 Subject: [PATCH 3/5] split transform files into 2 differents named outputs for easier handling in workflows --- .../nf-neuro/registration/anattodwi/main.nf | 5 +- .../anattodwi/tests/main.nf.test.snap | 42 +++-- modules/nf-neuro/registration/ants/main.nf | 10 +- .../registration/ants/tests/main.nf.test.snap | 162 ++++++++++++------ .../registration/synthregistration/main.nf | 7 +- .../synthregistration/tests/nextflow.config | 2 +- subworkflows/nf-neuro/bundle_seg/main.nf | 8 +- .../bundle_seg/tests/main.nf.test.snap | 70 ++++---- .../nf-neuro/bundle_seg/tests/nextflow.config | 4 +- subworkflows/nf-neuro/registration/main.nf | 19 +- .../nf-neuro/registration/tests/main.nf.test | 4 +- .../registration/tests/main.nf.test.snap | 74 ++------ 12 files changed, 215 insertions(+), 192 deletions(-) diff --git a/modules/nf-neuro/registration/anattodwi/main.nf b/modules/nf-neuro/registration/anattodwi/main.nf index 407d9ad3..274a6f28 100644 --- a/modules/nf-neuro/registration/anattodwi/main.nf +++ b/modules/nf-neuro/registration/anattodwi/main.nf @@ -10,8 +10,9 @@ process REGISTRATION_ANATTODWI { tuple val(meta), path(t1), path(b0), path(metric) output: - tuple val(meta), path("*0GenericAffine.mat"), path("*1InverseWarp.nii.gz") , emit: transfo_trk - tuple val(meta), path("*1Warp.nii.gz"), path("*0GenericAffine.mat") , emit: transfo_image + tuple val(meta), path("*0GenericAffine.mat") , emit: affine + tuple val(meta), path("*1Warp.nii.gz") , emit: warp + tuple val(meta), path("*1InverseWarp.nii.gz") , emit: inverse_warp tuple val(meta), path("*t1_warped.nii.gz") , emit: t1_warped path "versions.yml" , emit: versions diff --git a/modules/nf-neuro/registration/anattodwi/tests/main.nf.test.snap b/modules/nf-neuro/registration/anattodwi/tests/main.nf.test.snap index 10a86b20..108fe168 100644 --- a/modules/nf-neuro/registration/anattodwi/tests/main.nf.test.snap +++ b/modules/nf-neuro/registration/anattodwi/tests/main.nf.test.snap @@ -8,8 +8,7 @@ "id": "test", "single_end": false }, - "test__output0GenericAffine.mat:md5,6eef07f9004fb96e57ae0404ffef174c", - "test__output1InverseWarp.nii.gz:md5,28694d2b41f5209ab8f1acbb219014fe" + "test__output0GenericAffine.mat:md5,6eef07f9004fb96e57ae0404ffef174c" ] ], "1": [ @@ -18,8 +17,7 @@ "id": "test", "single_end": false }, - "test__output1Warp.nii.gz:md5,e0995852e251bee5521572a4495a0bd6", - "test__output0GenericAffine.mat:md5,6eef07f9004fb96e57ae0404ffef174c" + "test__output1Warp.nii.gz:md5,e0995852e251bee5521572a4495a0bd6" ] ], "2": [ @@ -28,13 +26,10 @@ "id": "test", "single_end": false }, - "test__t1_warped.nii.gz:md5,9c34f424900adea263e39ed1f37a793f" + "test__output1InverseWarp.nii.gz:md5,28694d2b41f5209ab8f1acbb219014fe" ] ], "3": [ - "versions.yml:md5,3b94092e010fc0f6bf505074a393ddcc" - ], - "t1_warped": [ [ { "id": "test", @@ -43,35 +38,54 @@ "test__t1_warped.nii.gz:md5,9c34f424900adea263e39ed1f37a793f" ] ], - "transfo_image": [ + "4": [ + "versions.yml:md5,3b94092e010fc0f6bf505074a393ddcc" + ], + "affine": [ [ { "id": "test", "single_end": false }, - "test__output1Warp.nii.gz:md5,e0995852e251bee5521572a4495a0bd6", "test__output0GenericAffine.mat:md5,6eef07f9004fb96e57ae0404ffef174c" ] ], - "transfo_trk": [ + "inverse_warp": [ [ { "id": "test", "single_end": false }, - "test__output0GenericAffine.mat:md5,6eef07f9004fb96e57ae0404ffef174c", "test__output1InverseWarp.nii.gz:md5,28694d2b41f5209ab8f1acbb219014fe" ] ], + "t1_warped": [ + [ + { + "id": "test", + "single_end": false + }, + "test__t1_warped.nii.gz:md5,9c34f424900adea263e39ed1f37a793f" + ] + ], "versions": [ "versions.yml:md5,3b94092e010fc0f6bf505074a393ddcc" + ], + "warp": [ + [ + { + "id": "test", + "single_end": false + }, + "test__output1Warp.nii.gz:md5,e0995852e251bee5521572a4495a0bd6" + ] ] } ], "meta": { "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nextflow": "24.10.2" }, - "timestamp": "2024-11-22T17:16:41.404087811" + "timestamp": "2024-12-16T17:41:00.965919497" } } \ No newline at end of file diff --git a/modules/nf-neuro/registration/ants/main.nf b/modules/nf-neuro/registration/ants/main.nf index 05315461..7fe75b0c 100644 --- a/modules/nf-neuro/registration/ants/main.nf +++ b/modules/nf-neuro/registration/ants/main.nf @@ -12,8 +12,10 @@ process REGISTRATION_ANTS { output: tuple val(meta), path("*_warped.nii.gz") , emit: image - tuple val(meta), path("*__output{0Warp.nii.gz,1GenericAffine.mat}") , emit: transfo_image - tuple val(meta), path("*__output{0,1}Inverse{Warp.nii.gz,Affine.mat}") , emit: transfo_trk + tuple val(meta), path("*__output0Warp.nii.gz") , emit: warp, optional:true + tuple val(meta), path("*__output1GenericAffine.mat") , emit: affine + tuple val(meta), path("*__output1InverseWarp.nii.gz") , emit: inverse_warp, optional: true + tuple val(meta), path("*__output0InverseAffine.mat") , emit: inverse_affine path "versions.yml" , emit: versions when: @@ -62,7 +64,7 @@ process REGISTRATION_ANTS { cat <<-END_VERSIONS > versions.yml "${task.process}": - ants: antsRegistration --version | grep "Version" | sed -E 's/.*v([0-9]+\\.[0-9]+\\.[0-9]+).*/\\1/' + ants: \$(antsRegistration --version | grep "Version" | sed -E 's/.*v([0-9]+\\.[0-9]+\\.[0-9]+).*/\\1/') END_VERSIONS """ @@ -82,7 +84,7 @@ process REGISTRATION_ANTS { cat <<-END_VERSIONS > versions.yml "${task.process}": - ants: antsRegistration --version | grep "Version" | sed -E 's/.*v([0-9]+\\.[0-9]+\\.[0-9]+).*/\\1/' + ants: \$(antsRegistration --version | grep "Version" | sed -E 's/.*v([0-9]+\\.[0-9]+\\.[0-9]+).*/\\1/') END_VERSIONS """ } diff --git a/modules/nf-neuro/registration/ants/tests/main.nf.test.snap b/modules/nf-neuro/registration/ants/tests/main.nf.test.snap index 6f15a868..26091507 100644 --- a/modules/nf-neuro/registration/ants/tests/main.nf.test.snap +++ b/modules/nf-neuro/registration/ants/tests/main.nf.test.snap @@ -15,10 +15,7 @@ { "id": "test" }, - [ - "test__output0Warp.nii.gz:md5,6fee747df2c30bb48cf2b6897b5d3e17", - "test__output1GenericAffine.mat:md5,8e987eb08cc568478c37ae79a8824f8b" - ] + "test__output0Warp.nii.gz:md5,6fee747df2c30bb48cf2b6897b5d3e17" ] ], "2": [ @@ -26,14 +23,35 @@ { "id": "test" }, - [ - "test__output0InverseAffine.mat:md5,d342d5f1c35a53cadcdf2d49a25f5ce8", - "test__output1InverseWarp.nii.gz:md5,1608837de13478dff81fe51ac1720d28" - ] + "test__output1GenericAffine.mat:md5,8e987eb08cc568478c37ae79a8824f8b" ] ], "3": [ - "versions.yml:md5,825e9d4ea9e26675d7e236f243d73114" + [ + { + "id": "test" + }, + "test__output1InverseWarp.nii.gz:md5,1608837de13478dff81fe51ac1720d28" + ] + ], + "4": [ + [ + { + "id": "test" + }, + "test__output0InverseAffine.mat:md5,d342d5f1c35a53cadcdf2d49a25f5ce8" + ] + ], + "5": [ + "versions.yml:md5,e1ac7994c0f0169d932e94c6e97a4894" + ], + "affine": [ + [ + { + "id": "test" + }, + "test__output1GenericAffine.mat:md5,8e987eb08cc568478c37ae79a8824f8b" + ] ], "image": [ [ @@ -43,38 +61,40 @@ "test__warped.nii.gz:md5,4382217c04988eb01ed8f99916d7631c" ] ], - "transfo_image": [ + "inverse_affine": [ [ { "id": "test" }, - [ - "test__output0Warp.nii.gz:md5,6fee747df2c30bb48cf2b6897b5d3e17", - "test__output1GenericAffine.mat:md5,8e987eb08cc568478c37ae79a8824f8b" - ] + "test__output0InverseAffine.mat:md5,d342d5f1c35a53cadcdf2d49a25f5ce8" ] ], - "transfo_trk": [ + "inverse_warp": [ [ { "id": "test" }, - [ - "test__output0InverseAffine.mat:md5,d342d5f1c35a53cadcdf2d49a25f5ce8", - "test__output1InverseWarp.nii.gz:md5,1608837de13478dff81fe51ac1720d28" - ] + "test__output1InverseWarp.nii.gz:md5,1608837de13478dff81fe51ac1720d28" ] ], "versions": [ - "versions.yml:md5,825e9d4ea9e26675d7e236f243d73114" + "versions.yml:md5,e1ac7994c0f0169d932e94c6e97a4894" + ], + "warp": [ + [ + { + "id": "test" + }, + "test__output0Warp.nii.gz:md5,6fee747df2c30bb48cf2b6897b5d3e17" + ] ] } ], "meta": { "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nextflow": "24.10.2" }, - "timestamp": "2024-10-25T17:37:35.205440745" + "timestamp": "2024-12-16T17:28:39.126053758" }, "registration - ants - quick": { "content": [ @@ -92,10 +112,7 @@ { "id": "test" }, - [ - "test__output0Warp.nii.gz:md5,24e6f53eaa3e4476bb627c374bc809ca", - "test__output1GenericAffine.mat:md5,48c8479a403e0c0ec29c69d37bb4c91a" - ] + "test__output0Warp.nii.gz:md5,24e6f53eaa3e4476bb627c374bc809ca" ] ], "2": [ @@ -103,14 +120,35 @@ { "id": "test" }, - [ - "test__output0InverseAffine.mat:md5,25d0b8a83a922f2e4e89c6a86258af15", - "test__output1InverseWarp.nii.gz:md5,24e6f53eaa3e4476bb627c374bc809ca" - ] + "test__output1GenericAffine.mat:md5,48c8479a403e0c0ec29c69d37bb4c91a" ] ], "3": [ - "versions.yml:md5,825e9d4ea9e26675d7e236f243d73114" + [ + { + "id": "test" + }, + "test__output1InverseWarp.nii.gz:md5,24e6f53eaa3e4476bb627c374bc809ca" + ] + ], + "4": [ + [ + { + "id": "test" + }, + "test__output0InverseAffine.mat:md5,25d0b8a83a922f2e4e89c6a86258af15" + ] + ], + "5": [ + "versions.yml:md5,e1ac7994c0f0169d932e94c6e97a4894" + ], + "affine": [ + [ + { + "id": "test" + }, + "test__output1GenericAffine.mat:md5,48c8479a403e0c0ec29c69d37bb4c91a" + ] ], "image": [ [ @@ -120,38 +158,40 @@ "test__warped.nii.gz:md5,81358dd2f3223f567f4101e61490ae0f" ] ], - "transfo_image": [ + "inverse_affine": [ [ { "id": "test" }, - [ - "test__output0Warp.nii.gz:md5,24e6f53eaa3e4476bb627c374bc809ca", - "test__output1GenericAffine.mat:md5,48c8479a403e0c0ec29c69d37bb4c91a" - ] + "test__output0InverseAffine.mat:md5,25d0b8a83a922f2e4e89c6a86258af15" ] ], - "transfo_trk": [ + "inverse_warp": [ [ { "id": "test" }, - [ - "test__output0InverseAffine.mat:md5,25d0b8a83a922f2e4e89c6a86258af15", - "test__output1InverseWarp.nii.gz:md5,24e6f53eaa3e4476bb627c374bc809ca" - ] + "test__output1InverseWarp.nii.gz:md5,24e6f53eaa3e4476bb627c374bc809ca" ] ], "versions": [ - "versions.yml:md5,825e9d4ea9e26675d7e236f243d73114" + "versions.yml:md5,e1ac7994c0f0169d932e94c6e97a4894" + ], + "warp": [ + [ + { + "id": "test" + }, + "test__output0Warp.nii.gz:md5,24e6f53eaa3e4476bb627c374bc809ca" + ] ] } ], "meta": { "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nextflow": "24.10.2" }, - "timestamp": "2024-10-25T17:14:19.681843788" + "timestamp": "2024-12-16T17:28:48.93660183" }, "registration - ants - options": { "content": [ @@ -165,6 +205,9 @@ ] ], "1": [ + + ], + "2": [ [ { "id": "test" @@ -172,7 +215,10 @@ "test__output1GenericAffine.mat:md5,c3a48d19c815206de2b140f505969317" ] ], - "2": [ + "3": [ + + ], + "4": [ [ { "id": "test" @@ -180,42 +226,48 @@ "test__output0InverseAffine.mat:md5,f473c1e548be1540cbf757202ffd5984" ] ], - "3": [ - "versions.yml:md5,825e9d4ea9e26675d7e236f243d73114" + "5": [ + "versions.yml:md5,e1ac7994c0f0169d932e94c6e97a4894" ], - "image": [ + "affine": [ [ { "id": "test" }, - "test__warped.nii.gz:md5,7cb6839d4af18d9d37a1bd9d07c8c57b" + "test__output1GenericAffine.mat:md5,c3a48d19c815206de2b140f505969317" ] ], - "transfo_image": [ + "image": [ [ { "id": "test" }, - "test__output1GenericAffine.mat:md5,c3a48d19c815206de2b140f505969317" + "test__warped.nii.gz:md5,7cb6839d4af18d9d37a1bd9d07c8c57b" ] ], - "transfo_trk": [ + "inverse_affine": [ [ { "id": "test" }, "test__output0InverseAffine.mat:md5,f473c1e548be1540cbf757202ffd5984" ] + ], + "inverse_warp": [ + ], "versions": [ - "versions.yml:md5,825e9d4ea9e26675d7e236f243d73114" + "versions.yml:md5,e1ac7994c0f0169d932e94c6e97a4894" + ], + "warp": [ + ] } ], "meta": { "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nextflow": "24.10.2" }, - "timestamp": "2024-10-25T17:14:25.782091391" + "timestamp": "2024-12-16T17:28:54.754431506" } } \ No newline at end of file diff --git a/modules/nf-neuro/registration/synthregistration/main.nf b/modules/nf-neuro/registration/synthregistration/main.nf index 52cabf43..b4ac1f67 100644 --- a/modules/nf-neuro/registration/synthregistration/main.nf +++ b/modules/nf-neuro/registration/synthregistration/main.nf @@ -9,9 +9,10 @@ process REGISTRATION_SYNTHREGISTRATION { tuple val(meta), path(moving), path(fixed) output: - tuple val(meta), path("*__output_warped.nii.gz") , emit: warped_image - tuple val(meta), path("*__deform_warp.nii.gz"), path("*__affine_warp.lta") , emit: transfo_image - path "versions.yml" , emit: versions + tuple val(meta), path("*__output_warped.nii.gz") , emit: warped_image + tuple val(meta), path("*__deform_warp.nii.gz") , emit: warp + tuple val(meta), path("*__affine_warp.lta") , emit: affine + path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when diff --git a/modules/nf-neuro/registration/synthregistration/tests/nextflow.config b/modules/nf-neuro/registration/synthregistration/tests/nextflow.config index 84f8cf6a..11736eb6 100644 --- a/modules/nf-neuro/registration/synthregistration/tests/nextflow.config +++ b/modules/nf-neuro/registration/synthregistration/tests/nextflow.config @@ -1,5 +1,5 @@ process { - memory = "20G" + memory = "14G" withName: "REGISTRATION_SYNTHREGISTRATION" { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } ext.affine = "affine" diff --git a/subworkflows/nf-neuro/bundle_seg/main.nf b/subworkflows/nf-neuro/bundle_seg/main.nf index 843f9178..37b4bd13 100644 --- a/subworkflows/nf-neuro/bundle_seg/main.nf +++ b/subworkflows/nf-neuro/bundle_seg/main.nf @@ -82,15 +82,9 @@ workflow BUNDLE_SEG { REGISTRATION_ANTS ( ch_register ) ch_versions = ch_versions.mix(REGISTRATION_ANTS.out.versions.first()) - // ** Fetch only the .mat transformation file. ** // - ch_mat = REGISTRATION_ANTS.out.transfo_image - .flatten() - .toList() - .map{ [it[0], it[2]] } - // ** Perform bundle recognition and segmentation ** // ch_recognize_bundle = ch_tractogram - .join(ch_mat) + .join(REGISTRATION_ANTS.out.affine) .combine(atlas_config) .combine(atlas_average) diff --git a/subworkflows/nf-neuro/bundle_seg/tests/main.nf.test.snap b/subworkflows/nf-neuro/bundle_seg/tests/main.nf.test.snap index 62c150e2..d39b91cd 100644 --- a/subworkflows/nf-neuro/bundle_seg/tests/main.nf.test.snap +++ b/subworkflows/nf-neuro/bundle_seg/tests/main.nf.test.snap @@ -9,32 +9,27 @@ "single_end": false }, [ - "test__AF_L_cleaned.trk:md5,028aad575b0191512638054aae48aedc", - "test__AF_R_cleaned.trk:md5,36ad2f6bc0333de2c3047e19df9fd122", - "test__CC_Fr_1_cleaned.trk:md5,122f7573437035e37581a6525a5f9ef0", - "test__CC_Fr_2_cleaned.trk:md5,1aadd5139071a96e22e3fc1889396c03", - "test__CC_Pa_cleaned.trk:md5,6c7fdf1f5f9cebb3160ac076657b7815", - "test__CC_Pr_Po_cleaned.trk:md5,14a09e95cb82e5b720ac39ccf382e8a1", - "test__FAT_R_cleaned.trk:md5,80749af923fd8d9f85f06c3fce80c680", - "test__FPT_L_Brainstem_cleaned.trk:md5,8df02afad80747922b8fda408d2e87a8", - "test__FPT_L_cleaned.trk:md5,6af39bbd85cc396d95c667734c4876e5", - "test__FPT_R_Brainstem_cleaned.trk:md5,625c397e54e5fc45dd4266a8fadfafd0", - "test__FPT_R_cleaned.trk:md5,625c397e54e5fc45dd4266a8fadfafd0", - "test__ILF_L_cleaned.trk:md5,5a3e80fed89f3ac92c07544830d56fea", - "test__ILF_R_cleaned.trk:md5,44bd133c97909ba344a0df98381f59b5", - "test__MCP_cleaned.trk:md5,a1eaaedc048cf82d67569660a3afab70", + "test__AF_L_cleaned.trk:md5,b9a6567efffa206202f37c11afea2391", + "test__CC_Fr_2_cleaned.trk:md5,ad18f4415d6d5baae1ec81359ccffecb", + "test__CC_Pr_Po_cleaned.trk:md5,dca763cddc2decfa64baf452cc035b5a", + "test__CG_R_An_cleaned.trk:md5,79c5f2469b1fcae2599247ced8d68e07", + "test__CG_R_cleaned.trk:md5,79c5f2469b1fcae2599247ced8d68e07", + "test__FPT_L_Brainstem_cleaned.trk:md5,d6c9af62d9ad65d95257093148bf4d9a", + "test__FPT_L_cleaned.trk:md5,d6c9af62d9ad65d95257093148bf4d9a", + "test__ILF_L_cleaned.trk:md5,00f9f6e33e59bfe8bbe3a5afd18b0f2e", + "test__MCP_cleaned.trk:md5,ed86370180b35e125ae410aa3d520625", + "test__OR_ML_L_cleaned.trk:md5,721b658ed8a4de104c4e7c207d4fe170", "test__POPT_R_Brainstem_cleaned.trk:md5,6c07d476650f4bca894c4c2454a1783f", "test__POPT_R_cleaned.trk:md5,6c07d476650f4bca894c4c2454a1783f", - "test__PYT_L_Brainstem_cleaned.trk:md5,a67f6be5ecf9a8e2211e997bc3c2b268", "test__PYT_L_cleaned.trk:md5,ac9973ef987c34ecee0328004033ea46", - "test__PYT_R_cleaned.trk:md5,2babf062dcc87252950ec47a72ab347c", - "test__SLF_L_cleaned.trk:md5,55b5a7c7ae7a29043ca4ff43fa5ba9e6", - "test__SLF_R_cleaned.trk:md5,83068144984abd0fd55936903c61016c" + "test__PYT_R_Brainstem_cleaned.trk:md5,28b4be34422e356030b6b081efca31d5", + "test__PYT_R_cleaned.trk:md5,50f8127bbaab6f4b9fea790a7c11679d", + "test__SLF_L_cleaned.trk:md5,3660a62ee7e0e413f7417e80c1842e60" ] ] ], "1": [ - "versions.yml:md5,b5ff3e60063810aea9f911b2a439b592", + "versions.yml:md5,0e994f9824f1e014fd5e939e0bce7061", "versions.yml:md5,e63f6133bb2e78ce211054111993be59" ], "bundles": [ @@ -44,40 +39,35 @@ "single_end": false }, [ - "test__AF_L_cleaned.trk:md5,028aad575b0191512638054aae48aedc", - "test__AF_R_cleaned.trk:md5,36ad2f6bc0333de2c3047e19df9fd122", - "test__CC_Fr_1_cleaned.trk:md5,122f7573437035e37581a6525a5f9ef0", - "test__CC_Fr_2_cleaned.trk:md5,1aadd5139071a96e22e3fc1889396c03", - "test__CC_Pa_cleaned.trk:md5,6c7fdf1f5f9cebb3160ac076657b7815", - "test__CC_Pr_Po_cleaned.trk:md5,14a09e95cb82e5b720ac39ccf382e8a1", - "test__FAT_R_cleaned.trk:md5,80749af923fd8d9f85f06c3fce80c680", - "test__FPT_L_Brainstem_cleaned.trk:md5,8df02afad80747922b8fda408d2e87a8", - "test__FPT_L_cleaned.trk:md5,6af39bbd85cc396d95c667734c4876e5", - "test__FPT_R_Brainstem_cleaned.trk:md5,625c397e54e5fc45dd4266a8fadfafd0", - "test__FPT_R_cleaned.trk:md5,625c397e54e5fc45dd4266a8fadfafd0", - "test__ILF_L_cleaned.trk:md5,5a3e80fed89f3ac92c07544830d56fea", - "test__ILF_R_cleaned.trk:md5,44bd133c97909ba344a0df98381f59b5", - "test__MCP_cleaned.trk:md5,a1eaaedc048cf82d67569660a3afab70", + "test__AF_L_cleaned.trk:md5,b9a6567efffa206202f37c11afea2391", + "test__CC_Fr_2_cleaned.trk:md5,ad18f4415d6d5baae1ec81359ccffecb", + "test__CC_Pr_Po_cleaned.trk:md5,dca763cddc2decfa64baf452cc035b5a", + "test__CG_R_An_cleaned.trk:md5,79c5f2469b1fcae2599247ced8d68e07", + "test__CG_R_cleaned.trk:md5,79c5f2469b1fcae2599247ced8d68e07", + "test__FPT_L_Brainstem_cleaned.trk:md5,d6c9af62d9ad65d95257093148bf4d9a", + "test__FPT_L_cleaned.trk:md5,d6c9af62d9ad65d95257093148bf4d9a", + "test__ILF_L_cleaned.trk:md5,00f9f6e33e59bfe8bbe3a5afd18b0f2e", + "test__MCP_cleaned.trk:md5,ed86370180b35e125ae410aa3d520625", + "test__OR_ML_L_cleaned.trk:md5,721b658ed8a4de104c4e7c207d4fe170", "test__POPT_R_Brainstem_cleaned.trk:md5,6c07d476650f4bca894c4c2454a1783f", "test__POPT_R_cleaned.trk:md5,6c07d476650f4bca894c4c2454a1783f", - "test__PYT_L_Brainstem_cleaned.trk:md5,a67f6be5ecf9a8e2211e997bc3c2b268", "test__PYT_L_cleaned.trk:md5,ac9973ef987c34ecee0328004033ea46", - "test__PYT_R_cleaned.trk:md5,2babf062dcc87252950ec47a72ab347c", - "test__SLF_L_cleaned.trk:md5,55b5a7c7ae7a29043ca4ff43fa5ba9e6", - "test__SLF_R_cleaned.trk:md5,83068144984abd0fd55936903c61016c" + "test__PYT_R_Brainstem_cleaned.trk:md5,28b4be34422e356030b6b081efca31d5", + "test__PYT_R_cleaned.trk:md5,50f8127bbaab6f4b9fea790a7c11679d", + "test__SLF_L_cleaned.trk:md5,3660a62ee7e0e413f7417e80c1842e60" ] ] ], "versions": [ - "versions.yml:md5,b5ff3e60063810aea9f911b2a439b592", + "versions.yml:md5,0e994f9824f1e014fd5e939e0bce7061", "versions.yml:md5,e63f6133bb2e78ce211054111993be59" ] } ], "meta": { "nf-test": "0.9.0", - "nextflow": "24.10.1" + "nextflow": "24.10.2" }, - "timestamp": "2024-12-13T11:51:35.634778" + "timestamp": "2024-12-16T17:29:39.203098281" } } \ No newline at end of file diff --git a/subworkflows/nf-neuro/bundle_seg/tests/nextflow.config b/subworkflows/nf-neuro/bundle_seg/tests/nextflow.config index e45be487..2089b09d 100644 --- a/subworkflows/nf-neuro/bundle_seg/tests/nextflow.config +++ b/subworkflows/nf-neuro/bundle_seg/tests/nextflow.config @@ -4,12 +4,12 @@ process { ext.threads = 1 ext.random_seed = 44 ext.repro_mode = 1 - ext.transform = "s" + ext.transform = "r" publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } } withName: "BUNDLE_RECOGNIZE" { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - ext.minimal_vote_ratio = 0.9 + ext.minimal_vote_ratio = 0.8 ext.rbx_processes = 1 ext.seed = 44 ext.outlier_alpha = 0.4 diff --git a/subworkflows/nf-neuro/registration/main.nf b/subworkflows/nf-neuro/registration/main.nf index 05b11bea..be99659b 100644 --- a/subworkflows/nf-neuro/registration/main.nf +++ b/subworkflows/nf-neuro/registration/main.nf @@ -66,7 +66,8 @@ workflow REGISTRATION { // ** Set outputs ** // image_warped = REGISTRATION_SYNTHREGISTRATION.out.warped_image - transfo_image = REGISTRATION_SYNTHREGISTRATION.out.transfo_image + transfo_image = REGISTRATION_SYNTHREGISTRATION.out.warp + .join(REGISTRATION_SYNTHREGISTRATION.out.affine) transfo_trk = Channel.empty() ref_warped = Channel.empty() out_segmentation = Channel.empty() @@ -97,8 +98,10 @@ workflow REGISTRATION { // ** Set compulsory outputs ** // image_warped = REGISTRATION_ANATTODWI.out.t1_warped - transfo_image = REGISTRATION_ANATTODWI.out.transfo_image - transfo_trk = REGISTRATION_ANATTODWI.out.transfo_trk + transfo_image = REGISTRATION_ANATTODWI.out.warp + .join(REGISTRATION_ANATTODWI.out.affine) + transfo_trk = REGISTRATION_ANATTODWI.out.affine + .join(REGISTRATION_ANATTODWI.out.inverse_warp) // ** Registration using ANTS SYN SCRIPTS ** // // Registration using antsRegistrationSyN.sh or antsRegistrationSyNQuick.sh, has @@ -116,8 +119,10 @@ workflow REGISTRATION { // ** Set compulsory outputs ** // image_warped = image_warped.mix(REGISTRATION_ANTS.out.image) - transfo_image = transfo_image.mix(REGISTRATION_ANTS.out.transfo_image) - transfo_trk = transfo_trk.mix(REGISTRATION_ANTS.out.transfo_trk) + transfo_image = transfo_image.mix(REGISTRATION_ANTS.out.warp) + .join(REGISTRATION_ANTS.out.affine) + transfo_trk = transfo_trk.mix(REGISTRATION_ANTS.out.inverse_affine) + .join(REGISTRATION_ANTS.out.inverse_warp) // **et optional outputs **// ref_warped = Channel.empty() @@ -128,8 +133,8 @@ workflow REGISTRATION { emit: image_warped = image_warped // channel: [ val(meta), image ] ] ref_warped = ref_warped // channel: [ val(meta), ref ] - transfo_image = transfo_image // channel: [ val(meta), [ warp, ] ] - transfo_trk = transfo_trk // channel: [ val(meta), [ , inverse-warp ] ] + transfo_image = transfo_image // channel: [ val(meta), [ warp ], [ ] ] + transfo_trk = transfo_trk // channel: [ val(meta), [ ], [ inverse-warp ] ] segmentation = out_segmentation // channel: [ val(meta), segmentation ] ref_segmentation = out_ref_segmentation // channel: [ val(meta), ref-segmentation ] versions = ch_versions // channel: [ versions.yml ] diff --git a/subworkflows/nf-neuro/registration/tests/main.nf.test b/subworkflows/nf-neuro/registration/tests/main.nf.test index 844cf7b1..71be76bb 100644 --- a/subworkflows/nf-neuro/registration/tests/main.nf.test +++ b/subworkflows/nf-neuro/registration/tests/main.nf.test @@ -7,13 +7,13 @@ nextflow_workflow { tag "subworkflows" tag "subworkflows_nfcore" tag "subworkflows/registration" - +/* tag "registration" tag "registration/anattodwi" tag "registration" tag "registration/ants" tag "registration/easyreg" - tag "registration/synthregistration" + tag "registration/synthregistration" */ tag "load_test_data" diff --git a/subworkflows/nf-neuro/registration/tests/main.nf.test.snap b/subworkflows/nf-neuro/registration/tests/main.nf.test.snap index cb402dde..c3f7dbc5 100644 --- a/subworkflows/nf-neuro/registration/tests/main.nf.test.snap +++ b/subworkflows/nf-neuro/registration/tests/main.nf.test.snap @@ -47,24 +47,10 @@ ], "2": [ - [ - { - "id": "test", - "single_end": false - }, - "test__output1Warp.nii.gz:md5,e0995852e251bee5521572a4495a0bd6", - "test__output0GenericAffine.mat:md5,6eef07f9004fb96e57ae0404ffef174c" - ] + ], "3": [ - [ - { - "id": "test", - "single_end": false - }, - "test__output0GenericAffine.mat:md5,6eef07f9004fb96e57ae0404ffef174c", - "test__output1InverseWarp.nii.gz:md5,28694d2b41f5209ab8f1acbb219014fe" - ] + ], "4": [ @@ -94,24 +80,10 @@ ], "transfo_image": [ - [ - { - "id": "test", - "single_end": false - }, - "test__output1Warp.nii.gz:md5,e0995852e251bee5521572a4495a0bd6", - "test__output0GenericAffine.mat:md5,6eef07f9004fb96e57ae0404ffef174c" - ] + ], "transfo_trk": [ - [ - { - "id": "test", - "single_end": false - }, - "test__output0GenericAffine.mat:md5,6eef07f9004fb96e57ae0404ffef174c", - "test__output1InverseWarp.nii.gz:md5,28694d2b41f5209ab8f1acbb219014fe" - ] + ], "versions": [ "versions.yml:md5,9c255f4c751382be7bf6fe6ffb0d635d" @@ -120,9 +92,9 @@ ], "meta": { "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nextflow": "24.10.2" }, - "timestamp": "2024-11-22T17:18:54.515678597" + "timestamp": "2024-12-16T17:18:27.440150515" }, "registration - SyNQuick": { "content": [ @@ -145,10 +117,8 @@ "id": "test", "single_end": false }, - [ - "test__output0Warp.nii.gz:md5,964cf7e60171214164f280452f1ae6e0", - "test__output1GenericAffine.mat:md5,bfd589d2b237a20bbeef0656ecd64e14" - ] + "test__output0Warp.nii.gz:md5,964cf7e60171214164f280452f1ae6e0", + "test__output1GenericAffine.mat:md5,bfd589d2b237a20bbeef0656ecd64e14" ] ], "3": [ @@ -157,10 +127,8 @@ "id": "test", "single_end": false }, - [ - "test__output0InverseAffine.mat:md5,235417a8c7eee8ab7bde320b9e48d2f1", - "test__output1InverseWarp.nii.gz:md5,fac9af1885f5e1cce39fcf06fca93dfc" - ] + "test__output0InverseAffine.mat:md5,235417a8c7eee8ab7bde320b9e48d2f1", + "test__output1InverseWarp.nii.gz:md5,fac9af1885f5e1cce39fcf06fca93dfc" ] ], "4": [ @@ -170,7 +138,7 @@ ], "6": [ - "versions.yml:md5,9fe7f597ac6c76efff8851f9b672f17b" + "versions.yml:md5,96376b8bc28640eef565e7f1e258dbb2" ], "image_warped": [ [ @@ -196,10 +164,8 @@ "id": "test", "single_end": false }, - [ - "test__output0Warp.nii.gz:md5,964cf7e60171214164f280452f1ae6e0", - "test__output1GenericAffine.mat:md5,bfd589d2b237a20bbeef0656ecd64e14" - ] + "test__output0Warp.nii.gz:md5,964cf7e60171214164f280452f1ae6e0", + "test__output1GenericAffine.mat:md5,bfd589d2b237a20bbeef0656ecd64e14" ] ], "transfo_trk": [ @@ -208,21 +174,19 @@ "id": "test", "single_end": false }, - [ - "test__output0InverseAffine.mat:md5,235417a8c7eee8ab7bde320b9e48d2f1", - "test__output1InverseWarp.nii.gz:md5,fac9af1885f5e1cce39fcf06fca93dfc" - ] + "test__output0InverseAffine.mat:md5,235417a8c7eee8ab7bde320b9e48d2f1", + "test__output1InverseWarp.nii.gz:md5,fac9af1885f5e1cce39fcf06fca93dfc" ] ], "versions": [ - "versions.yml:md5,9fe7f597ac6c76efff8851f9b672f17b" + "versions.yml:md5,96376b8bc28640eef565e7f1e258dbb2" ] } ], "meta": { - "nf-test": "0.9.2", - "nextflow": "24.04.3" + "nf-test": "0.9.0", + "nextflow": "24.10.2" }, - "timestamp": "2024-12-04T13:19:52.734589" + "timestamp": "2024-12-16T17:32:06.600864666" } } \ No newline at end of file From 1b6fbc6ede9be344144888dce5ea6a4994dae9c0 Mon Sep 17 00:00:00 2001 From: Anthony Gagnon Date: Tue, 17 Dec 2024 12:10:19 -0500 Subject: [PATCH 4/5] update version in synthreg + revert memory limit --- modules/nf-neuro/registration/synthregistration/main.nf | 8 +++----- .../registration/synthregistration/tests/nextflow.config | 2 +- subworkflows/nf-neuro/registration/tests/main.nf.test | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/modules/nf-neuro/registration/synthregistration/main.nf b/modules/nf-neuro/registration/synthregistration/main.nf index b4ac1f67..ed068eef 100644 --- a/modules/nf-neuro/registration/synthregistration/main.nf +++ b/modules/nf-neuro/registration/synthregistration/main.nf @@ -2,7 +2,7 @@ process REGISTRATION_SYNTHREGISTRATION { tag "$meta.id" label 'process_high' - container "freesurfer/synthmorph:3" + container "freesurfer/synthmorph:4" containerOptions "--entrypoint '' --env PYTHONPATH='/freesurfer/env/lib/python3.11/site-packages'" input: @@ -18,7 +18,6 @@ process REGISTRATION_SYNTHREGISTRATION { task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def affine = task.ext.affine ? "-m " + task.ext.affine : "-m affine" @@ -40,12 +39,11 @@ process REGISTRATION_SYNTHREGISTRATION { cat <<-END_VERSIONS > versions.yml "${task.process}": - synthmoprh: 3 + synthmoprh: 4 END_VERSIONS """ stub: - def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" """ @@ -57,7 +55,7 @@ process REGISTRATION_SYNTHREGISTRATION { cat <<-END_VERSIONS > versions.yml "${task.process}": - synthmoprh: 3 + synthmoprh: 4 END_VERSIONS """ } diff --git a/modules/nf-neuro/registration/synthregistration/tests/nextflow.config b/modules/nf-neuro/registration/synthregistration/tests/nextflow.config index 11736eb6..84f8cf6a 100644 --- a/modules/nf-neuro/registration/synthregistration/tests/nextflow.config +++ b/modules/nf-neuro/registration/synthregistration/tests/nextflow.config @@ -1,5 +1,5 @@ process { - memory = "14G" + memory = "20G" withName: "REGISTRATION_SYNTHREGISTRATION" { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } ext.affine = "affine" diff --git a/subworkflows/nf-neuro/registration/tests/main.nf.test b/subworkflows/nf-neuro/registration/tests/main.nf.test index 71be76bb..844cf7b1 100644 --- a/subworkflows/nf-neuro/registration/tests/main.nf.test +++ b/subworkflows/nf-neuro/registration/tests/main.nf.test @@ -7,13 +7,13 @@ nextflow_workflow { tag "subworkflows" tag "subworkflows_nfcore" tag "subworkflows/registration" -/* + tag "registration" tag "registration/anattodwi" tag "registration" tag "registration/ants" tag "registration/easyreg" - tag "registration/synthregistration" */ + tag "registration/synthregistration" tag "load_test_data" From 8d206a8b6cf2018464746f5e46cc58f92321128d Mon Sep 17 00:00:00 2001 From: Alex Valcourt Caron Date: Wed, 18 Dec 2024 15:34:54 -0500 Subject: [PATCH 5/5] snapshot tests --- .../registration/synthregistration/tests/main.nf.test | 3 ++- .../synthregistration/tests/main.nf.test.snap | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/nf-neuro/registration/synthregistration/tests/main.nf.test b/modules/nf-neuro/registration/synthregistration/tests/main.nf.test index 1c343caf..33dfb385 100644 --- a/modules/nf-neuro/registration/synthregistration/tests/main.nf.test +++ b/modules/nf-neuro/registration/synthregistration/tests/main.nf.test @@ -46,7 +46,8 @@ nextflow_process { { assert process.success }, { assert snapshot( file(process.out.warped_image.get(0).get(1)).name, - file(process.out.transfo_image.get(0).get(1)).name, + file(process.out.warp.get(0).get(1)).name, + file(process.out.affine.get(0).get(1)).name, process.out.versions ).match() } ) diff --git a/modules/nf-neuro/registration/synthregistration/tests/main.nf.test.snap b/modules/nf-neuro/registration/synthregistration/tests/main.nf.test.snap index 23e10804..b87940b8 100644 --- a/modules/nf-neuro/registration/synthregistration/tests/main.nf.test.snap +++ b/modules/nf-neuro/registration/synthregistration/tests/main.nf.test.snap @@ -3,14 +3,15 @@ "content": [ "test__output_warped.nii.gz", "test__deform_warp.nii.gz", + "test__affine_warp.lta", [ - "versions.yml:md5,5140205cdb117e3eb8cd4e28277f9291" + "versions.yml:md5,6f946408922f25f1a8182d35615b6d7b" ] ], "meta": { - "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nf-test": "0.9.2", + "nextflow": "24.04.3" }, - "timestamp": "2024-10-30T18:08:53.765658701" + "timestamp": "2024-12-18T13:10:28.733204" } } \ No newline at end of file