-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #149 from ThoumyreStanislas/correction_registratio…
…n_tractogram [MODULE] Migrate tests registraction tractogram
- Loading branch information
Showing
10 changed files
with
231 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
name: "registration_tractogram" | ||
channels: | ||
- Docker | ||
- Apptainer | ||
dependencies: | ||
- "Scilpy" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 88 additions & 0 deletions
88
modules/nf-scil/registration/tractogram/tests/main.nf.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
|
||
nextflow_process { | ||
|
||
name "Test Process REGISTRATION_TRACTOGRAM" | ||
script "../main.nf" | ||
process "REGISTRATION_TRACTOGRAM" | ||
config "./nextflow.config" | ||
|
||
tag "modules" | ||
tag "modules_nfcore" | ||
tag "registration" | ||
tag "registration/tractogram" | ||
|
||
tag "subworkflows" | ||
tag "subworkflows/load_test_data" | ||
|
||
setup { | ||
run("LOAD_TEST_DATA", alias: "LOAD_DATA") { | ||
script "../../../../../subworkflows/nf-scil/load_test_data/main.nf" | ||
process { | ||
""" | ||
input[0] = Channel.from( [ "bundles.zip" ] ) | ||
input[1] = "test.load-test-data" | ||
""" | ||
} | ||
} | ||
} | ||
|
||
|
||
test("registration - tractogram_bundles") { | ||
|
||
|
||
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}/bundle_all_1mm.nii.gz", checkIfExists: true), | ||
file("\${test_data_directory}/affine.txt", checkIfExists: true), | ||
file("\${test_data_directory}/fibercup_atlas/subj_1/*.trk", checkIfExists: true), | ||
[], | ||
[] | ||
] | ||
} | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
test("registration - tractogram") { | ||
|
||
config "./nextflow_suffix.config" | ||
|
||
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}/bundle_all_1mm.nii.gz", checkIfExists: true), | ||
file("\${test_data_directory}/affine.txt", checkIfExists: true), | ||
file("\${test_data_directory}/fibercup_atlas/subj_1/bundle_2.trk", checkIfExists: true), | ||
[], | ||
[] | ||
] | ||
} | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot(process.out).match() } | ||
) | ||
} | ||
|
||
} | ||
} |
88 changes: 88 additions & 0 deletions
88
modules/nf-scil/registration/tractogram/tests/main.nf.test.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{ | ||
"registration - tractogram_bundles": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "test", | ||
"single_end": false | ||
}, | ||
[ | ||
"test__bundle_0.trk:md5,6e14cc02b66d12d5dde0a0701918385a", | ||
"test__bundle_1.trk:md5,ef5a759144ab7e8d2f5abf30a463a152", | ||
"test__bundle_2.trk:md5,824bcbf796cbce3e1c93e39d1c98dcf9", | ||
"test__bundle_3.trk:md5,8877161b9aebaa6b12a4d7a8f8410407", | ||
"test__bundle_4.trk:md5,6c8658b946154896952ca89e88fcf29f", | ||
"test__bundle_5.trk:md5,fa058f93d9bfe4bed2ff027e9acd5682", | ||
"test__bundle_6.trk:md5,125e50561b4b0c5fd8ee23867c28bc51" | ||
] | ||
] | ||
], | ||
"1": [ | ||
"versions.yml:md5,609469c08e60062eed7528276deddf5e" | ||
], | ||
"versions": [ | ||
"versions.yml:md5,609469c08e60062eed7528276deddf5e" | ||
], | ||
"warped_tractogram": [ | ||
[ | ||
{ | ||
"id": "test", | ||
"single_end": false | ||
}, | ||
[ | ||
"test__bundle_0.trk:md5,6e14cc02b66d12d5dde0a0701918385a", | ||
"test__bundle_1.trk:md5,ef5a759144ab7e8d2f5abf30a463a152", | ||
"test__bundle_2.trk:md5,824bcbf796cbce3e1c93e39d1c98dcf9", | ||
"test__bundle_3.trk:md5,8877161b9aebaa6b12a4d7a8f8410407", | ||
"test__bundle_4.trk:md5,6c8658b946154896952ca89e88fcf29f", | ||
"test__bundle_5.trk:md5,fa058f93d9bfe4bed2ff027e9acd5682", | ||
"test__bundle_6.trk:md5,125e50561b4b0c5fd8ee23867c28bc51" | ||
] | ||
] | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "23.10.1" | ||
}, | ||
"timestamp": "2024-05-15T19:11:42.198039" | ||
}, | ||
"registration - tractogram": { | ||
"content": [ | ||
{ | ||
"0": [ | ||
[ | ||
{ | ||
"id": "test", | ||
"single_end": false | ||
}, | ||
"test__bundle_2_mni.trk:md5,824bcbf796cbce3e1c93e39d1c98dcf9" | ||
] | ||
], | ||
"1": [ | ||
"versions.yml:md5,609469c08e60062eed7528276deddf5e" | ||
], | ||
"versions": [ | ||
"versions.yml:md5,609469c08e60062eed7528276deddf5e" | ||
], | ||
"warped_tractogram": [ | ||
[ | ||
{ | ||
"id": "test", | ||
"single_end": false | ||
}, | ||
"test__bundle_2_mni.trk:md5,824bcbf796cbce3e1c93e39d1c98dcf9" | ||
] | ||
] | ||
} | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "23.10.1" | ||
}, | ||
"timestamp": "2024-05-15T19:11:52.03634" | ||
} | ||
} |
File renamed without changes.
14 changes: 14 additions & 0 deletions
14
modules/nf-scil/registration/tractogram/tests/nextflow_suffix.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
process { | ||
withName: "REGISTRATION_TRACTOGRAM" { | ||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } | ||
ext.inverse = true | ||
ext.force = true | ||
ext.reverse_operation = true | ||
ext.cut_invalid = true | ||
ext.remove_single_point = true | ||
ext.remove_overlapping_points = true | ||
ext.threshold = 0.001 | ||
ext.no_empty = true | ||
ext.suffix = 'mni' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
registration/tractogram: | ||
- "modules/nf-scil/registration/tractogram/**" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.