diff --git a/modules/nf-neuro/registration/anattodwi/main.nf b/modules/nf-neuro/registration/anattodwi/main.nf index 8e4e745b..f0aaaac8 100644 --- a/modules/nf-neuro/registration/anattodwi/main.nf +++ b/modules/nf-neuro/registration/anattodwi/main.nf @@ -2,9 +2,7 @@ process REGISTRATION_ANATTODWI { tag "$meta.id" label 'process_single' - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://scil.usherbrooke.ca/containers/scilus_2.0.2.sif': - 'scilus/scilus:19c87b72bcbc683fb827097dda7f917940fda123' }" + container "scilus/scilus:2.2.0" input: tuple val(meta), path(t1), path(b0), path(metric) @@ -73,11 +71,11 @@ process REGISTRATION_ANATTODWI { # Iterate over images. for image in t1_warped b0; do - scil_viz_volume_screenshot.py *\${image}.nii.gz \${image}_coronal.png \ + scil_viz_volume_screenshot *\${image}.nii.gz \${image}_coronal.png \ --slices \$coronal_mid --axis coronal \$viz_params - scil_viz_volume_screenshot.py *\${image}.nii.gz \${image}_sagittal.png \ + scil_viz_volume_screenshot *\${image}.nii.gz \${image}_sagittal.png \ --slices \$sagittal_mid --axis sagittal \$viz_params - scil_viz_volume_screenshot.py *\${image}.nii.gz \${image}_axial.png \ + scil_viz_volume_screenshot *\${image}.nii.gz \${image}_axial.png \ --slices \$axial_mid --axis axial \$viz_params if [ \$image != b0 ]; @@ -107,6 +105,7 @@ process REGISTRATION_ANATTODWI { cat <<-END_VERSIONS > versions.yml "${task.process}": + scilpy: \$(uv pip -q -n list | grep scilpy | tr -s ' ' | cut -d' ' -f2) ants: \$(antsRegistration --version | grep "Version" | sed -E 's/.*v([0-9.a-zA-Z-]+).*/\\1/') mrtrix: \$(mrinfo -version 2>&1 | grep "== mrinfo" | sed -E 's/== mrinfo ([0-9.]+).*/\\1/') imagemagick: \$(convert -version | sed -n 's/.*ImageMagick \\([0-9]\\{1,\\}\\.[0-9]\\{1,\\}\\.[0-9]\\{1,\\}\\).*/\\1/p') @@ -117,7 +116,17 @@ process REGISTRATION_ANATTODWI { def prefix = task.ext.prefix ?: "${meta.id}" """ + set +e + function handle_code () { + local code=\$? + ignore=( 1 ) + [[ " \${ignore[@]} " =~ " \$code " ]] || exit \$code + } + trap 'handle_code' ERR + antsRegistration -h + scil_viz_volume_screenshot -h + convert -h touch ${prefix}__t1_warped.nii.gz touch ${prefix}__output0GenericAffine.mat @@ -127,6 +136,7 @@ process REGISTRATION_ANATTODWI { cat <<-END_VERSIONS > versions.yml "${task.process}": + scilpy: \$(uv pip -q -n list | grep scilpy | tr -s ' ' | cut -d' ' -f2) ants: \$(antsRegistration --version | grep "Version" | sed -E 's/.*v([0-9.a-zA-Z-]+).*/\\1/') mrtrix: \$(mrinfo -version 2>&1 | grep "== mrinfo" | sed -E 's/== mrinfo ([0-9.]+).*/\\1/') imagemagick: \$(convert -version | sed -n 's/.*ImageMagick \\([0-9]\\{1,\\}\\.[0-9]\\{1,\\}\\.[0-9]\\{1,\\}\\).*/\\1/p') 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 aebfc5f2..86591bc5 100644 --- a/modules/nf-neuro/registration/anattodwi/tests/main.nf.test.snap +++ b/modules/nf-neuro/registration/anattodwi/tests/main.nf.test.snap @@ -8,7 +8,7 @@ "id": "test", "single_end": false }, - "test__output0GenericAffine.mat:md5,6eef07f9004fb96e57ae0404ffef174c" + "test__output0GenericAffine.mat:md5,18d03f6c1fd587b00b3bc9363eb8ed4f" ] ], "1": [ @@ -17,7 +17,7 @@ "id": "test", "single_end": false }, - "test__output1Warp.nii.gz:md5,e0995852e251bee5521572a4495a0bd6" + "test__output1Warp.nii.gz:md5,aa42d4dd6f227d986cd99df45425d5c5" ] ], "2": [ @@ -26,7 +26,7 @@ "id": "test", "single_end": false }, - "test__output1InverseWarp.nii.gz:md5,28694d2b41f5209ab8f1acbb219014fe" + "test__output1InverseWarp.nii.gz:md5,6a04d7c100075b4ba7a276a55a4094bd" ] ], "3": [ @@ -35,7 +35,7 @@ "id": "test", "single_end": false }, - "test__t1_warped.nii.gz:md5,9c34f424900adea263e39ed1f37a793f" + "test__t1_warped.nii.gz:md5,39c30c6251cba224989bc74a31540121" ] ], "4": [ @@ -44,11 +44,11 @@ "id": "test", "single_end": false }, - "test_registration_anattodwi_mqc.gif:md5,74a7cf404c443726487683c23bd926c0" + "test_registration_anattodwi_mqc.gif:md5,687252d31b0109f99a174b4e3960e4e6" ] ], "5": [ - "versions.yml:md5,f368bc76bf8d1f1a68caea3597b0c65b" + "versions.yml:md5,77dc5dd2d9f2f2b772043eef8471eb13" ], "affine": [ [ @@ -56,7 +56,7 @@ "id": "test", "single_end": false }, - "test__output0GenericAffine.mat:md5,6eef07f9004fb96e57ae0404ffef174c" + "test__output0GenericAffine.mat:md5,18d03f6c1fd587b00b3bc9363eb8ed4f" ] ], "inverse_warp": [ @@ -65,7 +65,7 @@ "id": "test", "single_end": false }, - "test__output1InverseWarp.nii.gz:md5,28694d2b41f5209ab8f1acbb219014fe" + "test__output1InverseWarp.nii.gz:md5,6a04d7c100075b4ba7a276a55a4094bd" ] ], "mqc": [ @@ -74,7 +74,7 @@ "id": "test", "single_end": false }, - "test_registration_anattodwi_mqc.gif:md5,74a7cf404c443726487683c23bd926c0" + "test_registration_anattodwi_mqc.gif:md5,687252d31b0109f99a174b4e3960e4e6" ] ], "t1_warped": [ @@ -83,11 +83,11 @@ "id": "test", "single_end": false }, - "test__t1_warped.nii.gz:md5,9c34f424900adea263e39ed1f37a793f" + "test__t1_warped.nii.gz:md5,39c30c6251cba224989bc74a31540121" ] ], "versions": [ - "versions.yml:md5,f368bc76bf8d1f1a68caea3597b0c65b" + "versions.yml:md5,77dc5dd2d9f2f2b772043eef8471eb13" ], "warp": [ [ @@ -95,27 +95,27 @@ "id": "test", "single_end": false }, - "test__output1Warp.nii.gz:md5,e0995852e251bee5521572a4495a0bd6" + "test__output1Warp.nii.gz:md5,aa42d4dd6f227d986cd99df45425d5c5" ] ] } ], "meta": { - "nf-test": "0.9.2", - "nextflow": "24.10.3" + "nf-test": "0.9.0", + "nextflow": "25.04.7" }, - "timestamp": "2025-02-20T14:58:42.372471" + "timestamp": "2025-09-22T21:23:44.360834413" }, "registration - anattodwi -stub-run": { "content": [ [ - "versions.yml:md5,f368bc76bf8d1f1a68caea3597b0c65b" + "versions.yml:md5,77dc5dd2d9f2f2b772043eef8471eb13" ] ], "meta": { - "nf-test": "0.9.2", - "nextflow": "24.10.3" + "nf-test": "0.9.0", + "nextflow": "25.04.7" }, - "timestamp": "2025-02-20T14:58:49.169195" + "timestamp": "2025-09-22T21:24:00.939016823" } } \ 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 d12fcf53..9b16683a 100644 --- a/modules/nf-neuro/registration/ants/main.nf +++ b/modules/nf-neuro/registration/ants/main.nf @@ -3,9 +3,7 @@ process REGISTRATION_ANTS { tag "$meta.id" label 'process_medium' - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - "https://scil.usherbrooke.ca/containers/scilus_latest.sif": - "scilus/scilus:19c87b72bcbc683fb827097dda7f917940fda123"}" + container "scilus/scilus:2.2.0" input: tuple val(meta), path(fixedimage), path(movingimage), path(mask) /* optional, input = [] */ @@ -80,11 +78,11 @@ process REGISTRATION_ANTS { # Iterate over images. for image in fixedimage warped; do - scil_viz_volume_screenshot.py *\${image}.nii.gz \${image}_coronal.png \ + scil_viz_volume_screenshot *\${image}.nii.gz \${image}_coronal.png \ --slices \$coronal_dim --axis coronal \$viz_params - scil_viz_volume_screenshot.py *\${image}.nii.gz \${image}_sagittal.png \ + scil_viz_volume_screenshot *\${image}.nii.gz \${image}_sagittal.png \ --slices \$sagittal_dim --axis sagittal \$viz_params - scil_viz_volume_screenshot.py *\${image}.nii.gz \${image}_axial.png \ + scil_viz_volume_screenshot *\${image}.nii.gz \${image}_axial.png \ --slices \$axial_dim --axis axial \$viz_params if [ \$image != fixedimage ]; then @@ -109,6 +107,7 @@ process REGISTRATION_ANTS { cat <<-END_VERSIONS > versions.yml "${task.process}": + scilpy: \$(uv pip -q -n list | grep scilpy | tr -s ' ' | cut -d' ' -f2) ants: \$(antsRegistration --version | grep "Version" | sed -E 's/.*v([0-9.a-zA-Z-]+).*/\\1/') mrtrix: \$(mrinfo -version 2>&1 | grep "== mrinfo" | sed -E 's/== mrinfo ([0-9.]+).*/\\1/') imagemagick: \$(convert -version | grep "Version:" | sed -E 's/.*ImageMagick ([0-9.-]+).*/\\1/') @@ -130,6 +129,8 @@ process REGISTRATION_ANTS { antsRegistrationSyNQuick.sh -h antsApplyTransforms -h + convert -h + scil_viz_volume_screenshot -h touch ${prefix}__t1_warped.nii.gz touch ${prefix}__output0GenericAffine.mat @@ -139,6 +140,7 @@ process REGISTRATION_ANTS { cat <<-END_VERSIONS > versions.yml "${task.process}": + scilpy: \$(uv pip -q -n list | grep scilpy | tr -s ' ' | cut -d' ' -f2) ants: \$(antsRegistration --version | grep "Version" | sed -E 's/.*v([0-9.a-zA-Z-]+).*/\\1/') mrtrix: \$(mrinfo -version 2>&1 | grep "== mrinfo" | sed -E 's/== mrinfo ([0-9.]+).*/\\1/') imagemagick: \$(convert -version | grep "Version:" | sed -E 's/.*ImageMagick ([0-9.-]+).*/\\1/') 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 782a7ab3..c2e97b65 100644 --- a/modules/nf-neuro/registration/ants/tests/main.nf.test.snap +++ b/modules/nf-neuro/registration/ants/tests/main.nf.test.snap @@ -7,7 +7,7 @@ { "id": "test" }, - "test__warped.nii.gz:md5,4382217c04988eb01ed8f99916d7631c" + "test__warped.nii.gz:md5,6491f46d2c2cae09338effb989ec3bf7" ] ], "1": [ @@ -15,7 +15,7 @@ { "id": "test" }, - "test__output0GenericAffine.mat:md5,8e987eb08cc568478c37ae79a8824f8b" + "test__output0GenericAffine.mat:md5,3b6d0eaddd216d15bf50a116c2f09065" ] ], "2": [ @@ -23,7 +23,7 @@ { "id": "test" }, - "test__output1InverseAffine.mat:md5,d342d5f1c35a53cadcdf2d49a25f5ce8" + "test__output1InverseAffine.mat:md5,14b90a8217065e42b21102de73a489c1" ] ], "3": [ @@ -31,7 +31,7 @@ { "id": "test" }, - "test__output1Warp.nii.gz:md5,6fee747df2c30bb48cf2b6897b5d3e17" + "test__output1Warp.nii.gz:md5,db8e148adf0e32d551cf5e75ca3e76ab" ] ], "4": [ @@ -39,21 +39,21 @@ { "id": "test" }, - "test__output0InverseWarp.nii.gz:md5,1608837de13478dff81fe51ac1720d28" + "test__output0InverseWarp.nii.gz:md5,3069b784eaa199078d21ecbd5366e27b" ] ], "5": [ ], "6": [ - "versions.yml:md5,2f2f86409f3c1a7fedd6a4c670fde0fa" + "versions.yml:md5,b79ebe5518288b629eb72580d6e6b785" ], "affine": [ [ { "id": "test" }, - "test__output0GenericAffine.mat:md5,8e987eb08cc568478c37ae79a8824f8b" + "test__output0GenericAffine.mat:md5,3b6d0eaddd216d15bf50a116c2f09065" ] ], "image": [ @@ -61,7 +61,7 @@ { "id": "test" }, - "test__warped.nii.gz:md5,4382217c04988eb01ed8f99916d7631c" + "test__warped.nii.gz:md5,6491f46d2c2cae09338effb989ec3bf7" ] ], "inverse_affine": [ @@ -69,7 +69,7 @@ { "id": "test" }, - "test__output1InverseAffine.mat:md5,d342d5f1c35a53cadcdf2d49a25f5ce8" + "test__output1InverseAffine.mat:md5,14b90a8217065e42b21102de73a489c1" ] ], "inverse_warp": [ @@ -77,30 +77,30 @@ { "id": "test" }, - "test__output0InverseWarp.nii.gz:md5,1608837de13478dff81fe51ac1720d28" + "test__output0InverseWarp.nii.gz:md5,3069b784eaa199078d21ecbd5366e27b" ] ], "mqc": [ ], "versions": [ - "versions.yml:md5,2f2f86409f3c1a7fedd6a4c670fde0fa" + "versions.yml:md5,b79ebe5518288b629eb72580d6e6b785" ], "warp": [ [ { "id": "test" }, - "test__output1Warp.nii.gz:md5,6fee747df2c30bb48cf2b6897b5d3e17" + "test__output1Warp.nii.gz:md5,db8e148adf0e32d551cf5e75ca3e76ab" ] ] } ], "meta": { "nf-test": "0.9.0", - "nextflow": "25.04.3" + "nextflow": "25.04.7" }, - "timestamp": "2025-06-05T15:46:55.295203257" + "timestamp": "2025-09-22T21:59:53.198912314" }, "registration - ants - quick": { "content": [ @@ -110,7 +110,7 @@ { "id": "test" }, - "test__warped.nii.gz:md5,81358dd2f3223f567f4101e61490ae0f" + "test__warped.nii.gz:md5,45822afae6c0dc33551b690f6f10dbe4" ] ], "1": [ @@ -118,7 +118,7 @@ { "id": "test" }, - "test__output0GenericAffine.mat:md5,48c8479a403e0c0ec29c69d37bb4c91a" + "test__output0GenericAffine.mat:md5,17e711c6a2f73415269b4272344890bc" ] ], "2": [ @@ -126,7 +126,7 @@ { "id": "test" }, - "test__output1InverseAffine.mat:md5,25d0b8a83a922f2e4e89c6a86258af15" + "test__output1InverseAffine.mat:md5,e5df1f989e0340746d9742ff2d0a7a99" ] ], "3": [ @@ -134,7 +134,7 @@ { "id": "test" }, - "test__output1Warp.nii.gz:md5,24e6f53eaa3e4476bb627c374bc809ca" + "test__output1Warp.nii.gz:md5,813a4218d33d5acfebadc4ba0e49df8b" ] ], "4": [ @@ -142,7 +142,7 @@ { "id": "test" }, - "test__output0InverseWarp.nii.gz:md5,24e6f53eaa3e4476bb627c374bc809ca" + "test__output0InverseWarp.nii.gz:md5,813a4218d33d5acfebadc4ba0e49df8b" ] ], "5": [ @@ -150,18 +150,18 @@ { "id": "test" }, - "test_T1_to_DWI_registration_ants_mqc.gif:md5,ebf58acb9c3f3b9bc8c5a08105d4ceff" + "test_T1_to_DWI_registration_ants_mqc.gif:md5,9cdd7e9bf7facc3f95a61de03e15d47d" ] ], "6": [ - "versions.yml:md5,2f2f86409f3c1a7fedd6a4c670fde0fa" + "versions.yml:md5,b79ebe5518288b629eb72580d6e6b785" ], "affine": [ [ { "id": "test" }, - "test__output0GenericAffine.mat:md5,48c8479a403e0c0ec29c69d37bb4c91a" + "test__output0GenericAffine.mat:md5,17e711c6a2f73415269b4272344890bc" ] ], "image": [ @@ -169,7 +169,7 @@ { "id": "test" }, - "test__warped.nii.gz:md5,81358dd2f3223f567f4101e61490ae0f" + "test__warped.nii.gz:md5,45822afae6c0dc33551b690f6f10dbe4" ] ], "inverse_affine": [ @@ -177,7 +177,7 @@ { "id": "test" }, - "test__output1InverseAffine.mat:md5,25d0b8a83a922f2e4e89c6a86258af15" + "test__output1InverseAffine.mat:md5,e5df1f989e0340746d9742ff2d0a7a99" ] ], "inverse_warp": [ @@ -185,7 +185,7 @@ { "id": "test" }, - "test__output0InverseWarp.nii.gz:md5,24e6f53eaa3e4476bb627c374bc809ca" + "test__output0InverseWarp.nii.gz:md5,813a4218d33d5acfebadc4ba0e49df8b" ] ], "mqc": [ @@ -193,27 +193,27 @@ { "id": "test" }, - "test_T1_to_DWI_registration_ants_mqc.gif:md5,ebf58acb9c3f3b9bc8c5a08105d4ceff" + "test_T1_to_DWI_registration_ants_mqc.gif:md5,9cdd7e9bf7facc3f95a61de03e15d47d" ] ], "versions": [ - "versions.yml:md5,2f2f86409f3c1a7fedd6a4c670fde0fa" + "versions.yml:md5,b79ebe5518288b629eb72580d6e6b785" ], "warp": [ [ { "id": "test" }, - "test__output1Warp.nii.gz:md5,24e6f53eaa3e4476bb627c374bc809ca" + "test__output1Warp.nii.gz:md5,813a4218d33d5acfebadc4ba0e49df8b" ] ] } ], "meta": { "nf-test": "0.9.0", - "nextflow": "25.04.3" + "nextflow": "25.04.7" }, - "timestamp": "2025-06-05T15:36:19.045796771" + "timestamp": "2025-09-22T22:00:25.806953541" }, "registration - ants - options": { "content": [ @@ -223,7 +223,7 @@ { "id": "test" }, - "test__warped.nii.gz:md5,7cb6839d4af18d9d37a1bd9d07c8c57b" + "test__warped.nii.gz:md5,c090343bdf2af2eac20a051b3cf9bb20" ] ], "1": [ @@ -231,7 +231,7 @@ { "id": "test" }, - "test__output0GenericAffine.mat:md5,c3a48d19c815206de2b140f505969317" + "test__output0GenericAffine.mat:md5,d3230976041b8532b14a00e2e5760395" ] ], "2": [ @@ -239,7 +239,7 @@ { "id": "test" }, - "test__output1InverseAffine.mat:md5,f473c1e548be1540cbf757202ffd5984" + "test__output1InverseAffine.mat:md5,10a6c2eededdc85709bbff395f0aab3a" ] ], "3": [ @@ -253,18 +253,18 @@ { "id": "test" }, - "test__registration_ants_mqc.gif:md5,23a92899290210c2fed8dbd9ed6b946b" + "test__registration_ants_mqc.gif:md5,1bfa145273f0ece8a2293efc7d2a8c2e" ] ], "6": [ - "versions.yml:md5,2f2f86409f3c1a7fedd6a4c670fde0fa" + "versions.yml:md5,b79ebe5518288b629eb72580d6e6b785" ], "affine": [ [ { "id": "test" }, - "test__output0GenericAffine.mat:md5,c3a48d19c815206de2b140f505969317" + "test__output0GenericAffine.mat:md5,d3230976041b8532b14a00e2e5760395" ] ], "image": [ @@ -272,7 +272,7 @@ { "id": "test" }, - "test__warped.nii.gz:md5,7cb6839d4af18d9d37a1bd9d07c8c57b" + "test__warped.nii.gz:md5,c090343bdf2af2eac20a051b3cf9bb20" ] ], "inverse_affine": [ @@ -280,7 +280,7 @@ { "id": "test" }, - "test__output1InverseAffine.mat:md5,f473c1e548be1540cbf757202ffd5984" + "test__output1InverseAffine.mat:md5,10a6c2eededdc85709bbff395f0aab3a" ] ], "inverse_warp": [ @@ -291,11 +291,11 @@ { "id": "test" }, - "test__registration_ants_mqc.gif:md5,23a92899290210c2fed8dbd9ed6b946b" + "test__registration_ants_mqc.gif:md5,1bfa145273f0ece8a2293efc7d2a8c2e" ] ], "versions": [ - "versions.yml:md5,2f2f86409f3c1a7fedd6a4c670fde0fa" + "versions.yml:md5,b79ebe5518288b629eb72580d6e6b785" ], "warp": [ @@ -304,20 +304,20 @@ ], "meta": { "nf-test": "0.9.0", - "nextflow": "25.04.3" + "nextflow": "25.04.7" }, - "timestamp": "2025-06-05T15:48:39.225501284" + "timestamp": "2025-09-22T22:00:54.46748032" }, "registration - ants - stub": { "content": [ [ - "versions.yml:md5,2f2f86409f3c1a7fedd6a4c670fde0fa" + "versions.yml:md5,b79ebe5518288b629eb72580d6e6b785" ] ], "meta": { "nf-test": "0.9.0", - "nextflow": "25.04.3" + "nextflow": "25.04.7" }, - "timestamp": "2025-06-05T15:47:24.380872364" + "timestamp": "2025-09-22T22:01:09.70219899" } } \ No newline at end of file diff --git a/modules/nf-neuro/registration/antsapplytransforms/main.nf b/modules/nf-neuro/registration/antsapplytransforms/main.nf index d48ef9ce..b4a4519d 100644 --- a/modules/nf-neuro/registration/antsapplytransforms/main.nf +++ b/modules/nf-neuro/registration/antsapplytransforms/main.nf @@ -2,9 +2,7 @@ process REGISTRATION_ANTSAPPLYTRANSFORMS { tag "$meta.id" label 'process_low' - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - "https://scil.usherbrooke.ca/containers/scilus_latest.sif": - "scilus/scilus:19c87b72bcbc683fb827097dda7f917940fda123"}" + container "scilus/scilus:2.2.0" input: tuple val(meta), path(image), path(reference), path(warp), path(affine) @@ -66,11 +64,11 @@ process REGISTRATION_ANTSAPPLYTRANSFORMS { # Iterate over images. for image in reference \${bname}${suffix}; do - scil_viz_volume_screenshot.py *\${image}.nii.gz \${image}_coronal.png \ + scil_viz_volume_screenshot *\${image}.nii.gz \${image}_coronal.png \ --slices \$coronal_dim --axis coronal \$viz_params - scil_viz_volume_screenshot.py *\${image}.nii.gz \${image}_sagittal.png \ + scil_viz_volume_screenshot *\${image}.nii.gz \${image}_sagittal.png \ --slices \$sagittal_dim --axis sagittal \$viz_params - scil_viz_volume_screenshot.py *\${image}.nii.gz \${image}_axial.png \ + scil_viz_volume_screenshot *\${image}.nii.gz \${image}_axial.png \ --slices \$axial_dim --axis axial \$viz_params if [ \$image != reference ]; then @@ -96,6 +94,7 @@ process REGISTRATION_ANTSAPPLYTRANSFORMS { cat <<-END_VERSIONS > versions.yml "${task.process}": + scilpy: \$(uv pip -q -n list | grep scilpy | tr -s ' ' | cut -d' ' -f2) ants: \$(antsRegistration --version | grep "Version" | sed -E 's/.*v([0-9.a-zA-Z-]+).*/\\1/') mrtrix: \$(mrinfo -version 2>&1 | grep "== mrinfo" | sed -E 's/== mrinfo ([0-9.]+).*/\\1/') imagemagick: \$(convert -version | grep "Version:" | sed -E 's/.*ImageMagick ([0-9.-]+).*/\\1/') @@ -107,7 +106,17 @@ process REGISTRATION_ANTSAPPLYTRANSFORMS { def suffix = task.ext.first_suffix ? "${task.ext.first_suffix}__warped" : "__warped" """ + set +e + function handle_code () { + local code=\$? + ignore=( 1 ) + [[ " \${ignore[@]} " =~ " \$code " ]] || exit \$code + } + trap 'handle_code' ERR + antsApplyTransforms -h + convert -h + scil_viz_volume_screenshot -h for image in $image; do \ @@ -119,6 +128,7 @@ process REGISTRATION_ANTSAPPLYTRANSFORMS { cat <<-END_VERSIONS > versions.yml "${task.process}": + scilpy: \$(uv pip -q -n list | grep scilpy | tr -s ' ' | cut -d' ' -f2) ants: \$(antsRegistration --version | grep "Version" | sed -E 's/.*v([0-9.a-zA-Z-]+).*/\\1/') mrtrix: \$(mrinfo -version 2>&1 | grep "== mrinfo" | sed -E 's/== mrinfo ([0-9.]+).*/\\1/') imagemagick: \$(convert -version | grep "Version:" | sed -E 's/.*ImageMagick ([0-9.-]+).*/\\1/') diff --git a/modules/nf-neuro/registration/antsapplytransforms/tests/main.nf.test.snap b/modules/nf-neuro/registration/antsapplytransforms/tests/main.nf.test.snap index 35beb8cf..895a830a 100644 --- a/modules/nf-neuro/registration/antsapplytransforms/tests/main.nf.test.snap +++ b/modules/nf-neuro/registration/antsapplytransforms/tests/main.nf.test.snap @@ -8,7 +8,7 @@ "id": "test", "single_end": false }, - "test__b0b0__warped.nii.gz:md5,3ae49aacab66fb2378da92155453b1be" + "test__b0b0__warped.nii.gz:md5,00916b78f727d65a811774f932aa9ce7" ] ], "1": [ @@ -17,11 +17,11 @@ "id": "test", "single_end": false }, - "test_b0b0_to_template_registration_antsapplytransforms_mqc.gif:md5,2e97314c320a27e4271c960c50895dfb" + "test_b0b0_to_template_registration_antsapplytransforms_mqc.gif:md5,ae5cc35a4039b08debee3c0ff21d5460" ] ], "2": [ - "versions.yml:md5,9c43291bef0aa7f7d49133a0ad7c0878" + "versions.yml:md5,02bece717a70a1c6a33bfa960afe9c33" ], "mqc": [ [ @@ -29,11 +29,11 @@ "id": "test", "single_end": false }, - "test_b0b0_to_template_registration_antsapplytransforms_mqc.gif:md5,2e97314c320a27e4271c960c50895dfb" + "test_b0b0_to_template_registration_antsapplytransforms_mqc.gif:md5,ae5cc35a4039b08debee3c0ff21d5460" ] ], "versions": [ - "versions.yml:md5,9c43291bef0aa7f7d49133a0ad7c0878" + "versions.yml:md5,02bece717a70a1c6a33bfa960afe9c33" ], "warped_image": [ [ @@ -41,27 +41,27 @@ "id": "test", "single_end": false }, - "test__b0b0__warped.nii.gz:md5,3ae49aacab66fb2378da92155453b1be" + "test__b0b0__warped.nii.gz:md5,00916b78f727d65a811774f932aa9ce7" ] ] } ], "meta": { - "nf-test": "0.9.2", - "nextflow": "24.10.5" + "nf-test": "0.9.0", + "nextflow": "25.04.7" }, - "timestamp": "2025-03-14T18:15:20.750783" + "timestamp": "2025-09-22T22:10:27.902211304" }, "registration - antsapplytransforms - stub-run": { "content": [ [ - "versions.yml:md5,9c43291bef0aa7f7d49133a0ad7c0878" + "versions.yml:md5,02bece717a70a1c6a33bfa960afe9c33" ] ], "meta": { "nf-test": "0.9.0", - "nextflow": "25.04.3" + "nextflow": "25.04.7" }, - "timestamp": "2025-06-05T15:36:32.982446247" + "timestamp": "2025-09-22T22:10:41.210018268" } -} +} \ No newline at end of file diff --git a/modules/nf-neuro/registration/tractogram/main.nf b/modules/nf-neuro/registration/tractogram/main.nf index a44b5019..fe1a9086 100644 --- a/modules/nf-neuro/registration/tractogram/main.nf +++ b/modules/nf-neuro/registration/tractogram/main.nf @@ -2,9 +2,7 @@ process REGISTRATION_TRACTOGRAM { tag "$meta.id" label 'process_single' - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://scil.usherbrooke.ca/containers/scilus_2.0.2.sif': - 'scilus/scilus:2.0.2' }" + container "scilus/scilpy:2.2.0_cpu" input: tuple val(meta), path(anat), path(transfo), path(tractogram), path(ref) /* optional, input = [] */, path(deformation) /* optional, input = [] */ @@ -36,16 +34,16 @@ process REGISTRATION_TRACTOGRAM { for tractogram in ${tractogram}; do \ ext=\${tractogram#*.} - bname=\$(basename \${tractogram} .\${ext}) + bname=\$(basename \${tractogram} .\${ext} | sed 's/${prefix}_\\+//') - scil_tractogram_apply_transform.py \$tractogram $anat $transfo tmp.trk\ + scil_tractogram_apply_transform \$tractogram $anat $transfo tmp.trk\ $in_deformation\ $inverse\ $reverse_operation\ $force\ $reference - scil_tractogram_remove_invalid.py tmp.trk ${prefix}__\${bname}${suffix}.\${ext}\ + scil_tractogram_remove_invalid tmp.trk ${prefix}__\${bname}${suffix}.\${ext}\ $cut_invalid\ $remove_single_point\ $remove_overlapping_points\ @@ -54,11 +52,9 @@ process REGISTRATION_TRACTOGRAM { -f done - - cat <<-END_VERSIONS > versions.yml "${task.process}": - scilpy: 2.0.2 + scilpy: \$(uv pip -q -n list | grep scilpy | tr -s ' ' | cut -d' ' -f2) END_VERSIONS """ @@ -66,20 +62,20 @@ process REGISTRATION_TRACTOGRAM { def prefix = task.ext.prefix ?: "${meta.id}" def suffix = task.ext.suffix ? "_${task.ext.suffix}" : "" """ - scil_tractogram_apply_transform.py -h - scil_tractogram_remove_invalid.py -h + scil_tractogram_apply_transform -h + scil_tractogram_remove_invalid -h for tractogram in ${tractogram}; do \ ext=\${tractogram#*.} - bname=\$(basename \${tractogram} .\${ext}) + bname=\$(basename \${tractogram} .\${ext} | sed 's/${prefix}_\\+//') touch ${prefix}__\${bname}${suffix}.\${ext} done cat <<-END_VERSIONS > versions.yml "${task.process}": - scilpy: 2.0.2 + scilpy: \$(uv pip -q -n list | grep scilpy | tr -s ' ' | cut -d' ' -f2) END_VERSIONS """ } diff --git a/modules/nf-neuro/registration/tractogram/tests/main.nf.test.snap b/modules/nf-neuro/registration/tractogram/tests/main.nf.test.snap index fb2a8cb9..b3172550 100644 --- a/modules/nf-neuro/registration/tractogram/tests/main.nf.test.snap +++ b/modules/nf-neuro/registration/tractogram/tests/main.nf.test.snap @@ -20,10 +20,10 @@ ] ], "1": [ - "versions.yml:md5,609469c08e60062eed7528276deddf5e" + "versions.yml:md5,504210d056544efae377411b749443e5" ], "versions": [ - "versions.yml:md5,609469c08e60062eed7528276deddf5e" + "versions.yml:md5,504210d056544efae377411b749443e5" ], "warped_tractogram": [ [ @@ -45,22 +45,22 @@ } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "25.04.7" }, - "timestamp": "2024-05-15T19:11:42.198039" + "timestamp": "2025-09-22T22:17:00.981071105" }, "registration - tractogram - stub-run": { "content": [ [ - "versions.yml:md5,609469c08e60062eed7528276deddf5e" + "versions.yml:md5,504210d056544efae377411b749443e5" ] ], "meta": { "nf-test": "0.9.0", - "nextflow": "25.04.2" + "nextflow": "25.04.7" }, - "timestamp": "2025-05-30T18:56:28.652442885" + "timestamp": "2025-09-22T22:17:25.469054766" }, "registration - tractogram": { "content": [ @@ -75,10 +75,10 @@ ] ], "1": [ - "versions.yml:md5,609469c08e60062eed7528276deddf5e" + "versions.yml:md5,504210d056544efae377411b749443e5" ], "versions": [ - "versions.yml:md5,609469c08e60062eed7528276deddf5e" + "versions.yml:md5,504210d056544efae377411b749443e5" ], "warped_tractogram": [ [ @@ -92,9 +92,9 @@ } ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.0", + "nextflow": "25.04.7" }, - "timestamp": "2024-05-15T19:11:52.03634" + "timestamp": "2025-09-22T22:17:13.547090754" } } \ No newline at end of file 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 a78d4c6a..5a991a52 100644 --- a/subworkflows/nf-neuro/bundle_seg/tests/main.nf.test.snap +++ b/subworkflows/nf-neuro/bundle_seg/tests/main.nf.test.snap @@ -11,8 +11,8 @@ ] ], "versions": [ - "versions.yml:md5,2fbc09a51203e509d1a15a631168680e", - "versions.yml:md5,afaf6c2953accc507d8777303eea8718" + "versions.yml:md5,afaf6c2953accc507d8777303eea8718", + "versions.yml:md5,e9075cd2c5d1ac7fa7946d2def1b66ad" ] } ], @@ -20,6 +20,6 @@ "nf-test": "0.9.0", "nextflow": "25.04.7" }, - "timestamp": "2025-09-21T20:16:54.243026235" + "timestamp": "2025-09-23T01:31:10.284602495" } } \ No newline at end of file diff --git a/subworkflows/nf-neuro/output_template_space/tests/main.nf.test.snap b/subworkflows/nf-neuro/output_template_space/tests/main.nf.test.snap index 7637ed71..52b9556d 100644 --- a/subworkflows/nf-neuro/output_template_space/tests/main.nf.test.snap +++ b/subworkflows/nf-neuro/output_template_space/tests/main.nf.test.snap @@ -45,11 +45,11 @@ "versions": [ "versions.yml:md5,00dee5d05eb6c7fa693b718e2264ce48", "versions.yml:md5,08c023826481c9130c3914096cda7f63", - "versions.yml:md5,4aa75761841b81efa97cd28be409ead9", + "versions.yml:md5,392b8d0b7b937f27fd6d8433d5b00618", + "versions.yml:md5,45b571aa920458a8bb0b39343c863604", "versions.yml:md5,4fe062075b77eb5fd05e956d9da383c8", - "versions.yml:md5,a6b014172fd4dfe073bb793b58943c46", - "versions.yml:md5,e667d19be259b1983b4451f18751d3b8", - "versions.yml:md5,f131337fe390b5d6c58ab1f1223bd4e8" + "versions.yml:md5,a8806981919b9cc22e2e1b374119a4e6", + "versions.yml:md5,c26daff464d53300427f71a85be86552" ] } ], @@ -57,7 +57,7 @@ "nf-test": "0.9.0", "nextflow": "25.04.7" }, - "timestamp": "2025-09-17T20:06:30.618698443" + "timestamp": "2025-09-22T22:03:12.493670596" }, "output to template MNI152NLin2009cAsym with local folder": { "content": [ @@ -105,11 +105,11 @@ "versions": [ "versions.yml:md5,00dee5d05eb6c7fa693b718e2264ce48", "versions.yml:md5,08c023826481c9130c3914096cda7f63", - "versions.yml:md5,4aa75761841b81efa97cd28be409ead9", + "versions.yml:md5,392b8d0b7b937f27fd6d8433d5b00618", + "versions.yml:md5,45b571aa920458a8bb0b39343c863604", "versions.yml:md5,4fe062075b77eb5fd05e956d9da383c8", - "versions.yml:md5,a6b014172fd4dfe073bb793b58943c46", - "versions.yml:md5,e667d19be259b1983b4451f18751d3b8", - "versions.yml:md5,f131337fe390b5d6c58ab1f1223bd4e8" + "versions.yml:md5,a8806981919b9cc22e2e1b374119a4e6", + "versions.yml:md5,c26daff464d53300427f71a85be86552" ] } ], @@ -117,6 +117,6 @@ "nf-test": "0.9.0", "nextflow": "25.04.7" }, - "timestamp": "2025-09-17T20:06:16.771618815" + "timestamp": "2025-09-22T22:02:39.128580348" } -} +} \ No newline at end of file diff --git a/subworkflows/nf-neuro/registration/tests/main.nf.test.snap b/subworkflows/nf-neuro/registration/tests/main.nf.test.snap index 09beaa34..8d2a1378 100644 --- a/subworkflows/nf-neuro/registration/tests/main.nf.test.snap +++ b/subworkflows/nf-neuro/registration/tests/main.nf.test.snap @@ -122,15 +122,15 @@ ] ], "versions": [ - "versions.yml:md5,04d2203fd83e0422e103384bee7a1696" + "versions.yml:md5,8805896edb4405a6c415e94796cc4853" ] } ], "meta": { "nf-test": "0.9.0", - "nextflow": "25.04.6" + "nextflow": "25.04.7" }, - "timestamp": "2025-07-04T20:59:34.81185618" + "timestamp": "2025-09-22T21:24:20.046469568" }, "registration - SyNQuick": { "content": [ @@ -162,14 +162,14 @@ ] ], "versions": [ - "versions.yml:md5,806ff315748e1402954ef52cadb7e396" + "versions.yml:md5,8b28f474ec25bfa9df8abedbe6bce396" ] } ], "meta": { "nf-test": "0.9.0", - "nextflow": "25.04.6" + "nextflow": "25.04.7" }, - "timestamp": "2025-07-04T20:59:41.187983313" + "timestamp": "2025-09-22T21:24:36.51483224" } -} +} \ No newline at end of file diff --git a/subworkflows/nf-neuro/tractoflow/tests/main.nf.test.snap b/subworkflows/nf-neuro/tractoflow/tests/main.nf.test.snap index e82f0966..bc3d35f0 100644 --- a/subworkflows/nf-neuro/tractoflow/tests/main.nf.test.snap +++ b/subworkflows/nf-neuro/tractoflow/tests/main.nf.test.snap @@ -383,8 +383,8 @@ "versions.yml:md5,7cabc91ec64b5e824e9b8f60d7dcf930", "versions.yml:md5,87e7cf85066fe87ee04330852a18b9a2", "versions.yml:md5,955e704dfd97848e196333d0cecf0451", - "versions.yml:md5,9ec2ceb761ab4faf9c19e46d7aa201c9", "versions.yml:md5,b365d463ddf58fc7b47cd51c70876a11", + "versions.yml:md5,cf44274c03f2da41cdfa50966ff751a2", "versions.yml:md5,da10c87dbb2ad07aa8bbf89a0c172a60" ], "volume_fraction": [ @@ -425,6 +425,6 @@ "nf-test": "0.9.0", "nextflow": "25.04.7" }, - "timestamp": "2025-09-24T03:23:27.123874216" + "timestamp": "2025-09-24T15:26:35.880061767" } } \ No newline at end of file