Skip to content

Commit

Permalink
Merge pull request #71 from Manonedde/fix_mrtrix_betantsbet
Browse files Browse the repository at this point in the history
#45 - MRtrix module - betcrop/betantsbet
  • Loading branch information
AlexVCaron authored Jan 15, 2025
2 parents d36ec09 + b8949dd commit 5c2bc5c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 19 deletions.
8 changes: 4 additions & 4 deletions modules/nf-neuro/betcrop/antsbet/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ process BETCROP_ANTSBET {
-e $template -m $tissues_probabilities ${args.join(' ')}
scil_volume_math.py convert bet/BrainExtractionMask.nii.gz \
${prefix}__t1_bet_mask.nii.gz --data_type uint8
mrcalc $t1 ${prefix}__t1_bet_mask.nii.gz -mult ${prefix}__t1_bet.nii.gz -nthreads $task.cpus
scil_volume_math.py multiplication $t1 ${prefix}__t1_bet_mask.nii.gz \
${prefix}__t1_bet.nii.gz --data_type float32
cat <<-END_VERSIONS > versions.yml
"${task.process}":
scilpy: \$(pip list | grep scilpy | tr -s ' ' | cut -d' ' -f2)
mrtrix: \$(mrcalc -version 2>&1 | sed -n 's/== mrcalc \\([0-9.]\\+\\).*/\\1/p')
ants: \$(antsRegistration --version | grep "Version" | sed -E 's/.*v([0-9]+\\+\\).*/\\1/')
END_VERSIONS
"""
Expand All @@ -48,13 +48,13 @@ process BETCROP_ANTSBET {
def prefix = task.ext.prefix ?: "${meta.id}"

"""
touch ${prefix}__t1_bet.nii.gz
touch ${prefix}__t1_bet_mask.nii.gz
cat <<-END_VERSIONS > versions.yml
"${task.process}":
scilpy: \$(pip list | grep scilpy | tr -s ' ' | cut -d' ' -f2)
mrtrix: \$(mrcalc -version 2>&1 | sed -n 's/== mrcalc \\([0-9.]\\+\\).*/\\1/p')
ants: \$(antsRegistration --version | grep "Version" | sed -E 's/.*v([0-9]+\\+\\).*/\\1/')
END_VERSIONS
Expand All @@ -67,6 +67,6 @@ process BETCROP_ANTSBET {
antsBrainExtraction.sh
scil_volume_math.py -h
mrcalc -h
"""
}
3 changes: 0 additions & 3 deletions modules/nf-neuro/betcrop/antsbet/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ tools:
- "scilpy":
description: "The Sherbrooke Connectivity Imaging Lab (SCIL) Python dMRI processing toolbox."
homepage: "https://github.com/scilus/scilpy.git"
- "MRtrix3":
description: "Toolbox for image processing, analysis and visualisation of dMRI."
homepage: "https://mrtrix.readthedocs.io/en/latest/"
- "ants":
description: "Advanced Normalization Tools."
homepage: "https://github.com/ANTsX/ANTs"
Expand Down
2 changes: 1 addition & 1 deletion modules/nf-neuro/betcrop/antsbet/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ nextflow_process {
assertAll(
{ assert process.success },
{ assert snapshot(
niftiMD5SUM(process.out.t1.get(0).get(1)),
niftiMD5SUM(process.out.t1.get(0).get(1), 1),
niftiMD5SUM(process.out.mask.get(0).get(1)),
process.out.versions
).match() }
Expand Down
14 changes: 7 additions & 7 deletions modules/nf-neuro/betcrop/antsbet/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{
"betcrop - antsbet": {
"content": [
"test__t1_bet.nii.gz:md5:header,72167012fa8893d3c3531d5d1245b84a,data,e31b24e1dadf5b067211544fca1f3f01",
"test__t1_bet.nii.gz:md5:header,e7cfbd06624321d70cbd667a77315ba3,data,381da559c1f38a2526f58b741eb0f7fc",
"test__t1_bet_mask.nii.gz:md5:header,f7389fe98c9a7e3a87c90b7ca05ea14a,data,1572808125554e50ff73fbe0e28037a9",
[
"versions.yml:md5,9fde1445bc10857db69e440781e58cb7"
"versions.yml:md5,bb378e913d4002d0b644d3277892ae20"
]
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.1"
"nextflow": "24.10.3"
},
"timestamp": "2024-12-17T20:31:09.4739"
"timestamp": "2025-01-15T16:55:54.33351491"
},
"betcrop - antsbet - stub-run": {
"content": [
[
"versions.yml:md5,9fde1445bc10857db69e440781e58cb7"
"versions.yml:md5,bb378e913d4002d0b644d3277892ae20"
]
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.1"
"nextflow": "24.10.3"
},
"timestamp": "2024-12-12T10:20:29.72452"
"timestamp": "2025-01-14T20:42:47.191136661"
}
}
8 changes: 4 additions & 4 deletions subworkflows/nf-neuro/preproc_t1/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -297,18 +297,18 @@
"test_cropped.nii.gz",
"test_t1_cropped.nii.gz",
[
"versions.yml:md5,19aaa24cf046e49a4ad4ce5d507ea8aa",
"versions.yml:md5,37229cd5cee6f6788fbc9083d6618c61",
"versions.yml:md5,657fbb224f260392e573b8511c4b798d",
"versions.yml:md5,b979132991d8f72a3585465533bd5730",
"versions.yml:md5,bdd934b4b8456060c36d6d97e4f30740",
"versions.yml:md5,da278daafbe3afa8454021e2716dd205",
"versions.yml:md5,ea32c30f5320f720b2f5dc32ac2535ea"
]
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.04.3"
"nf-test": "0.9.0",
"nextflow": "24.10.0"
},
"timestamp": "2024-12-04T10:38:12.185789"
"timestamp": "2024-12-12T15:50:29.838128539"
}
}

0 comments on commit 5c2bc5c

Please sign in to comment.