Skip to content

Commit

Permalink
Merge branch 'main' into fix/atlasbundleseg
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVCaron authored Dec 18, 2024
2 parents 8d206a8 + 3429ec3 commit 760c0cd
Show file tree
Hide file tree
Showing 26 changed files with 493 additions and 93 deletions.
4 changes: 3 additions & 1 deletion .devcontainer/devops/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"dockerfile": "Dockerfile",
"args": {
"NFTEST_VERSION": "0.9.0",
"POETRY_VERSION": "1.8.*"
"POETRY_VERSION": "1.8.*",
"NFT_DIFF": "pdiff",
"NFT_DIFF_ARGS": "--line-numbers --width 120 --expand-tabs=2"
}
},
"forwardPorts": [3000],
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/manual_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Trigger checks manually
on:
issue_comment:
types:
- created
- edited

jobs:
checks:
if: github.event.issue.pull_request && contains(github.event.comment.body, '@rerun-checks')
# Cancel if a newer run is started
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
uses: ./.github/workflows/run_checks_suite.yml
secrets: inherit
3 changes: 2 additions & 1 deletion .github/workflows/update_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ on:
merge_group:
types:
- checks_requested
branches: -main
branches:
- main

# Cancel if a newer run is started
concurrency:
Expand Down
21 changes: 20 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,24 @@
"testDataExplorer.dataserver": "scil.usherbrooke.ca",
"testDataExplorer.serverdatalocation": "scil_test_data/dvc-store/files/md5",
"testDataExplorer.localListingLocation": "tests/test_data.json",
"testDataExplorer.remoteListingLocation": "tests/test_data.json"
"testDataExplorer.remoteListingLocation": "tests/test_data.json",
"nextflow.files.exclude": [
".git",
".nf-test",
"work",
".venv",
".nextflow",
"node_modules",
".tests/runs"
],
"cSpell.ignorePaths": [
"package-lock.json",
"node_modules",
"vscode-extension",
".git/",
".vscode",
".vscode-insiders",
".venv",
"tests/.runs"
]
}
24 changes: 24 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"version": "0.2",
"dictionaryDefinitions": [
{
"name": "neuroscience",
"path": "docs/cspell/neuroscience.txt",
"addWords": true
}
],
"dictionaries": [
"typescript",
"node",
"python",
"latex",
"bash",
"companies",
"softwareTerms",
"misc",
"en_US",
"en-gb",
"filetypes",
"neuroscience"
]
}
104 changes: 104 additions & 0 deletions docs/cspell/neuroscience.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
*anat*
*anthony
*apply*
*b0*
*bet*
*bore
*bundle*
*bval*
*bvec*
*coeff
*coeffs
*container
*containers
*core
*crop*
*denoise*
*dwi*
*easy*
*extract*
*fast*
*field*
*fodf*
*frf*
*image
*local*
*mask
*mean*
*means*
*metrics
*morph*
*mov*
*neuro*
*normalise
*pack
*par
*pft*
*reg*
*registration*
*rev*
*seg*
*synth*
*test*
*to*
*tracking*
*transforms
*volume*
ants*
aparc
arnaud*
aseg
connectomics
denoised
denoising
descoteaux
dev*
dipy
dti*
dtype
etienne
evals
evecs
extension*
freesurfer*
fsl*
gagnon*
interp
medde
mkdirs
mppca
mrdegibbs
mrtrix
msmt
nextflow
nf*
nifti
nl*
nufo
onge
parcellation
parcellations
preproc
reconst
rheault
robsyme
sbref
scilpy
scilus
seed*
ssst
stanislas
subworkflow
subworkflows
thoumyre
topup
track*
tractoflow
tractogram
tractograms
tractography
transfo
uchar
unbias
wmparc
zenodo
20 changes: 13 additions & 7 deletions modules/nf-neuro/betcrop/fslbetcrop/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,9 @@ process BETCROP_FSLBETCROP {
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

"""
scil_dwi_extract_b0.py -h
bet -h
scil_volume_math.py -h
mrcalc -h
scil_volume_crop.py -h
touch ${prefix}__image_bet.nii.gz
touch ${prefix}__image_bet_mask.nii.gz
touch ${prefix}__image_boundingBox.pkl
Expand All @@ -89,5 +82,18 @@ process BETCROP_FSLBETCROP {
mrtrix: \$(mrcalc -version 2>&1 | sed -n 's/== mrcalc \\([0-9.]\\+\\).*/\\1/p')
fsl: \$(flirt -version 2>&1 | sed -n 's/FLIRT version \\([0-9.]\\+\\)/\\1/p')
END_VERSIONS
function handle_code () {
local code=\$?
ignore=( 1 )
exit \$([[ " \${ignore[@]} " =~ " \$code " ]] && echo 0 || echo \$code)
}
trap 'handle_code' ERR
bet
scil_dwi_extract_b0.py -h
scil_volume_math.py -h
mrcalc -h
scil_volume_crop.py -h
"""
}
28 changes: 28 additions & 0 deletions modules/nf-neuro/betcrop/fslbetcrop/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,32 @@ nextflow_process {

}

test("betcrop - fslbetcrop - stub-run") {

options "-stub-run"

when {
process {
"""
input[0] = LOAD_DATA.out.test_data_directory.map{
test_data_directory -> [
[ id:'test', single_end:false ], // meta map
file("\${test_data_directory}/dwi/dwi.nii.gz"),
file("\${test_data_directory}/dwi/dwi.bval"),
file("\${test_data_directory}/dwi/dwi.bvec")
]
}
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.versions).match() }
)
}

}

}
12 changes: 12 additions & 0 deletions modules/nf-neuro/betcrop/fslbetcrop/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
{
"betcrop - fslbetcrop - stub-run": {
"content": [
[
"versions.yml:md5,cc45ab23921525536874337c1c88e5cf"
]
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.10.1"
},
"timestamp": "2024-12-12T10:33:04.50811"
},
"betcrop - fslbetcrop - dwi": {
"content": [
{
Expand Down
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"
}
}
4 changes: 1 addition & 3 deletions modules/nf-neuro/image/applymask/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ process IMAGE_APPLYMASK {
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 "mrtrix3/mrtrix3:latest"

input:
tuple val(meta), path(image), path(mask)
Expand Down
Loading

0 comments on commit 760c0cd

Please sign in to comment.