Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix atlas handling and transform file issues in bundle_seg #80

Merged
merged 10 commits into from
Jan 15, 2025
5 changes: 3 additions & 2 deletions modules/nf-neuro/registration/anattodwi/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
42 changes: 28 additions & 14 deletions modules/nf-neuro/registration/anattodwi/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand All @@ -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": [
Expand All @@ -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",
Expand All @@ -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"
}
}
14 changes: 8 additions & 6 deletions modules/nf-neuro/registration/ants/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ process REGISTRATION_ANTS {
tuple val(meta), path(fixedimage), path(movingimage), path(mask) //** optional, input = [] **//

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
path "versions.yml" , emit: versions
tuple val(meta), path("*_warped.nii.gz") , emit: image
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:
task.ext.when == null || task.ext.when
Expand Down Expand Up @@ -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
"""

Expand All @@ -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
"""
}
Loading
Loading