Skip to content

Commit

Permalink
Remove license as module do not require it and update parameters with…
Browse files Browse the repository at this point in the history
… newer version
  • Loading branch information
anroy1 committed May 9, 2024
1 parent ec7d848 commit b711d52
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 18 deletions.
13 changes: 7 additions & 6 deletions modules/nf-scil/registration/synthregistration/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ process REGISTRATION_SYNTHREGISTRATION {
containerOptions "--entrypoint ''"

input:
tuple val(meta), path(moving), path(fixed), path(fs_license) /* optional, value = [] */
tuple val(meta), path(moving), path(fixed)


output:
Expand All @@ -22,12 +22,13 @@ process REGISTRATION_SYNTHREGISTRATION {
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

def init = task.ext.init ? "-m " + task.est.init : "-m affine"
def warp = task.ext.warp ? "-m " + task.est.warp : "-m deform"
def init = task.ext.init ? "-m " + task.ext.init : "-m affine"
def warp = task.ext.warp ? "-m " + task.ext.warp : "-m deform"
def header = task.ext.header ? "-H" : ""
def threads = task.ext.threads ? "-j " + task.ext.threads : ""
def gpu = task.ext.gpu ? "-g" : ""
def smooth = task.ext.smooth ? "-s " + task.ext.smooth : ""
def lambda = task.ext.lambda ? "-r " + task.ext.lambda : ""
def steps = task.ext.steps ? "-n " + task.ext.steps : ""
def extent = task.ext.extent ? "-e " + task.ext.extent : ""
def weight = task.ext.weight ? "-w " + task.ext.weight : ""

Expand All @@ -36,8 +37,8 @@ process REGISTRATION_SYNTHREGISTRATION {
export OMP_NUM_THREADS=1
export OPENBLAS_NUM_THREADS=1
mri_synthmorph $init -t ${prefix}__init_warp.lta $moving $fixed
mri_synthmorph $warp $gpu $smooth $extent $weight -i ${prefix}__init_warp.lta -t ${prefix}__deform_warp.mgz -o ${prefix}__output_warped.nii.gz $moving $fixed
mri_synthmorph ${init} -t ${prefix}__init_warp.lta $moving $fixed
mri_synthmorph ${warp} ${gpu} ${lambda} ${steps} ${extent} ${weight} -i ${prefix}__init_warp.lta -t ${prefix}__deform_warp.mgz -o ${prefix}__output_warped.nii.gz $moving $fixed
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
5 changes: 0 additions & 5 deletions modules/nf-scil/registration/synthregistration/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ input:
description: Nifti volume fixed for registration
pattern: "*.{nii,nii.gz}"

- fs_license:
type: file
description: The path to your FreeSurfer license. To get one, go to https://surfer.nmr.mgh.harvard.edu/registration.html. Optional. If you have already set your license as prescribed by Freesurfer (copied to a .license file in your $FREESURFER_HOME), this is not required.
pattern: "*.txt"

output:
- meta:
type: map
Expand Down
3 changes: 1 addition & 2 deletions tests/modules/nf-scil/registration/synthregistration/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ workflow test_registration_synthregistration {
.map{ test_data_directory -> [
[ id:'test', single_end:false ], // meta map
file("${test_data_directory}/t1.nii.gz"),
file("${test_data_directory}/fa.nii.gz"),
file("${test_data_directory}/license.txt")
file("${test_data_directory}/fa.nii.gz")

]}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,12 @@ process {

publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }

withName: "test_registration_synthregistration:REGISTRATION_SYNTHREGISTRATION" {
ext.init = "affine"
ext.warp = "deform"
ext.threads = 1
ext.lambda = 0.5
ext.steps = 5
}

}
11 changes: 6 additions & 5 deletions tests/modules/nf-scil/registration/synthregistration/test.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
- name: registration synthregistration test_registration_synthregistration
command: nextflow run ./tests/modules/nf-scil/registration/synthregistration -entry test_registration_synthregistration -c ./tests/config/nextflow.config
tags:
- registration
- registration/synthregistration
- registration
files:
- path: output/registration/test__deform_warp.nii.gz
md5sum: e0ed8084afa172668f50579f0585706c
- path: output/registration/test__deform_warp.mgz
contains:
- '# TODO nf-core: file md5sum was variable, please replace this text with a string found in the file instead '
- path: output/registration/test__init_warp.lta
md5sum: 4c5b29a64c8db1f87dd9ecf83a2d9878
md5sum: 46ad5a5d359b2ec157d1164135e746eb
- path: output/registration/test__output_warped.nii.gz
md5sum: 2b0441e95fd48bc269833d05831cfd9e
md5sum: bdc4ff1557093fd25a760e4db48d7d58
- path: output/registration/versions.yml
- path: output/testdata/test_data/freesurfer/anat_image.nii.gz
md5sum: ba57c629e9dc29204215dceac36d65ae
Expand Down

0 comments on commit b711d52

Please sign in to comment.