Skip to content

Commit

Permalink
Adjust nextflow config and output format
Browse files Browse the repository at this point in the history
  • Loading branch information
anroy1 committed Apr 26, 2024
1 parent 2fa8c08 commit 7608de4
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17 deletions.
7 changes: 2 additions & 5 deletions modules/nf-scil/registration/synthregistration/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ process REGISTRATION_SYNTHREGISTRATION {

output:
tuple val(meta), path("*__output_warped.nii.gz"), emit: warped_image
tuple val(meta), path("*__deform_warp.m3z"), emit: deform_transform
tuple val(meta), path("*__deform_warp.nii.gz"), emit: deform_transform
tuple val (meta), path("*__init_warp.lta"), emit: init_transform
path "versions.yml" , emit: versions

Expand All @@ -31,16 +31,13 @@ process REGISTRATION_SYNTHREGISTRATION {
def extent = task.ext.extent ? "-e " + task.ext.extent : ""
def weight = task.ext.weight ? "-w " + task.ext.weight : ""

//For arguments definition, mri_warp_convert -h
def out_format = task.ext.out_format ? "--out" + task.ext.out_format : "--outlps"

"""
export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1
export OMP_NUM_THREADS=1
export OPENBLAS_NUM_THREADS=1
mri_synthmorph $init -g -t ${prefix}__init_warp.lta $moving $fixed
mri_synthmorph $warp -g -i ${prefix}__init_warp.lta -t ${prefix}__deform_warp.m3d -o ${prefix}__output_warped.nii.gz $moving $fixed
mri_synthmorph $warp -g -i ${prefix}__init_warp.lta -t ${prefix}__deform_warp.nii.gz -o ${prefix}__output_warped.nii.gz $moving $fixed
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
6 changes: 3 additions & 3 deletions modules/nf-scil/registration/synthregistration/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ keywords:
- MRI
tools:
- "Freesurfer":
description: "Freesurfer Toolbox"
homepage: "https://surfer.nmr.mgh.harvard.edu/"
description: "Freesurfer Synthmorph"
homepage: "https://martinos.org/malte/synthmorph/"


input:
Expand Down Expand Up @@ -48,7 +48,7 @@ output:
- deform_transform:
type: file
description: Deform transformation
pattern: "*.{m3z}"
pattern: "*.{nii,.nii.gz}"

- warped_image:
type: file
Expand Down
4 changes: 2 additions & 2 deletions tests/config/nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ params {
}

process {
cpus = 4
memory = 5.GB
cpus = 16
memory = 20.GB
time = 2.h
}

Expand Down
25 changes: 18 additions & 7 deletions tests/modules/nf-scil/registration/synthregistration/test.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
- 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
- registration/synthregistration
files:
- path: "output/registration/test.bam"
md5sum: e667c7caad0bc4b7ac383fd023c654fc
- path: "output/registration/versions.yml"
md5sum: a01fe51bc4c6a3a6226fbf77b2c7cf3b

- path: output/registration/test__deform_warp.nii.gz
md5sum: e0ed8084afa172668f50579f0585706c
- path: output/registration/test__init_warp.lta
md5sum: 4c5b29a64c8db1f87dd9ecf83a2d9878
- path: output/registration/test__output_warped.nii.gz
md5sum: 2b0441e95fd48bc269833d05831cfd9e
- path: output/registration/versions.yml
- path: output/testdata/test_data/freesurfer/anat_image.nii.gz
md5sum: ba57c629e9dc29204215dceac36d65ae
- path: output/testdata/test_data/freesurfer/fa.nii.gz
md5sum: 0e76e9378500de64d66ba3d787a147ca
- path: output/testdata/test_data/freesurfer/license.txt
md5sum: 3db0fa4e1860b4774c7855980e406275
- path: output/testdata/test_data/freesurfer/t1.nii.gz
md5sum: a6ade205420f594737ad67f9fb246f0f
- path: output/testdata/versions.yml

0 comments on commit 7608de4

Please sign in to comment.