Skip to content

Commit

Permalink
Merge pull request #75 from ThoumyreStanislas/mrtrix_nlmeans
Browse files Browse the repository at this point in the history
#45 MRtrix module - denoising/mppca
  • Loading branch information
arnaudbore authored Dec 18, 2024
2 parents a7dde7f + fb5ae93 commit 9bd2a96
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 26 deletions.
12 changes: 4 additions & 8 deletions modules/nf-neuro/denoising/mppca/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ process DENOISING_MPPCA {
tag "$meta.id"
label 'process_medium'

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 "mrtrix3/mrtrix3:latest"

input:
tuple val(meta), path(dwi), path(mask)
Expand All @@ -30,13 +28,12 @@ process DENOISING_MPPCA {
export MRTRIX_RNG_SEED=112524
dwidenoise $dwi ${prefix}_dwi_denoised.nii.gz $extent ${args.join(" ")}
scil_volume_math.py lower_clip ${prefix}_dwi_denoised.nii.gz 0 \
${prefix}_dwi_denoised.nii.gz -f
mrcalc ${prefix}_dwi_denoised.nii.gz 0 -gt ${prefix}_dwi_denoised.nii.gz 0 \
-if ${prefix}_dwi_denoised.nii.gz -force
cat <<-END_VERSIONS > versions.yml
"${task.process}":
mrtrix: \$(mrcalc -version 2>&1 | sed -n 's/== mrcalc \\([0-9.]\\+\\).*/\\1/p')
scilpy: \$(pip list | grep scilpy | tr -s ' ' | cut -d' ' -f2)
END_VERSIONS
"""

Expand All @@ -46,14 +43,13 @@ process DENOISING_MPPCA {

"""
dwidenoise -h
scil_volume_math.py -h
mrcalc -h
touch ${prefix}_dwi_denoised.nii.gz
cat <<-END_VERSIONS > versions.yml
"${task.process}":
mrtrix: \$(mrcalc -version 2>&1 | sed -n 's/== mrcalc \\([0-9.]\\+\\).*/\\1/p')
scilpy: \$(pip list | grep scilpy | tr -s ' ' | cut -d' ' -f2)
END_VERSIONS
"""
}
3 changes: 0 additions & 3 deletions modules/nf-neuro/denoising/mppca/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ tools:
- "MRtrix3":
description: "Toolbox for image processing, analysis and visualisation of dMRI."
homepage: "https://mrtrix.readthedocs.io/en/latest/"
- "scilpy":
description: "The Sherbrooke Connectivity Imaging Lab (SCIL) Python dMRI processing toolbox."
homepage: "https://github.com/scilus/scilpy.git"

input:
- meta:
Expand Down
10 changes: 5 additions & 5 deletions modules/nf-neuro/denoising/mppca/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
]
],
"1": [
"versions.yml:md5,c9915fbc1956d7f54bee0748f1ddf920"
"versions.yml:md5,adbce7b09c63d541cdc2782235363275"
],
"image": [
[
Expand All @@ -22,14 +22,14 @@
]
],
"versions": [
"versions.yml:md5,c9915fbc1956d7f54bee0748f1ddf920"
"versions.yml:md5,adbce7b09c63d541cdc2782235363275"
]
}
],
"meta": {
"nf-test": "0.9.0-rc1",
"nextflow": "24.04.4"
"nf-test": "0.9.0",
"nextflow": "24.10.2"
},
"timestamp": "2024-08-05T15:17:51.718413"
"timestamp": "2024-12-12T18:27:14.057961679"
}
}
20 changes: 10 additions & 10 deletions subworkflows/nf-neuro/preproc_dwi/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
"versions.yml:md5,0494fbf74bc9c16d2b30cb45b3bba66b",
"versions.yml:md5,0b8c908e52917b0b706fc9d1b4d6cd24",
"versions.yml:md5,0e680a0c6b56892e1a7ec7f85bb95322",
"versions.yml:md5,3340c4b5e56ca52f7342be3c9044eb47",
"versions.yml:md5,571265e710ca29198e69be22c0f970d5",
"versions.yml:md5,662ea558da42564a0f6140473132bcb4",
"versions.yml:md5,7ddf2e98f59b19c9b933670550f26ad7",
"versions.yml:md5,c15ba5efd24564dba4710b6da8c4b791",
"versions.yml:md5,d68fe3399120f84f1add62181708780b",
"versions.yml:md5,ea5858879452a59bb355228ae7f38111",
"versions.yml:md5,f041502e22449973d84ac1c618e8ebf9"
],
Expand All @@ -32,9 +32,9 @@
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
"nextflow": "24.10.2"
},
"timestamp": "2024-11-01T12:50:45.411022164"
"timestamp": "2024-12-12T18:30:03.433004717"
},
"preproc_dwi_rev_b0": {
"content": [
Expand All @@ -52,7 +52,7 @@
"versions.yml:md5,0494fbf74bc9c16d2b30cb45b3bba66b",
"versions.yml:md5,0b8c908e52917b0b706fc9d1b4d6cd24",
"versions.yml:md5,0e680a0c6b56892e1a7ec7f85bb95322",
"versions.yml:md5,3340c4b5e56ca52f7342be3c9044eb47",
"versions.yml:md5,571265e710ca29198e69be22c0f970d5",
"versions.yml:md5,7ddf2e98f59b19c9b933670550f26ad7",
"versions.yml:md5,c15ba5efd24564dba4710b6da8c4b791",
"versions.yml:md5,ea5858879452a59bb355228ae7f38111",
Expand All @@ -68,9 +68,9 @@
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
"nextflow": "24.10.2"
},
"timestamp": "2024-11-01T12:49:12.328235961"
"timestamp": "2024-12-12T18:28:35.975149345"
},
"preproc_dwi_all_options": {
"content": [
Expand All @@ -88,10 +88,10 @@
"versions.yml:md5,0494fbf74bc9c16d2b30cb45b3bba66b",
"versions.yml:md5,0b8c908e52917b0b706fc9d1b4d6cd24",
"versions.yml:md5,0e680a0c6b56892e1a7ec7f85bb95322",
"versions.yml:md5,3340c4b5e56ca52f7342be3c9044eb47",
"versions.yml:md5,571265e710ca29198e69be22c0f970d5",
"versions.yml:md5,662ea558da42564a0f6140473132bcb4",
"versions.yml:md5,7ddf2e98f59b19c9b933670550f26ad7",
"versions.yml:md5,c15ba5efd24564dba4710b6da8c4b791",
"versions.yml:md5,d68fe3399120f84f1add62181708780b",
"versions.yml:md5,ea5858879452a59bb355228ae7f38111",
"versions.yml:md5,f041502e22449973d84ac1c618e8ebf9"
],
Expand All @@ -107,6 +107,6 @@
"nf-test": "0.9.0",
"nextflow": "24.10.2"
},
"timestamp": "2024-11-29T13:47:57.561745796"
"timestamp": "2024-12-12T18:31:26.492075412"
}
}

0 comments on commit 9bd2a96

Please sign in to comment.