Skip to content

Commit

Permalink
Swith transform format to freesurfer standard
Browse files Browse the repository at this point in the history
  • Loading branch information
anroy1 committed Apr 26, 2024
1 parent 7608de4 commit a4188ec
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
10 changes: 5 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.nii.gz"), emit: deform_transform
tuple val(meta), path("*__deform_warp.mgz"), emit: deform_transform
tuple val (meta), path("*__init_warp.lta"), emit: init_transform
path "versions.yml" , emit: versions

Expand All @@ -36,8 +36,8 @@ process REGISTRATION_SYNTHREGISTRATION {
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.nii.gz -o ${prefix}__output_warped.nii.gz $moving $fixed
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
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand All @@ -53,8 +53,8 @@ process REGISTRATION_SYNTHREGISTRATION {
mri_synthmorph -h
touch ${prefix}__output_warped.nii.gz
touch ${prefix}__deform_warp.nii.gz
touch ${prefix}__init_warp.txt
touch ${prefix}__deform_warp.mgz
touch ${prefix}__init_warp.lta
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
@@ -1,6 +1,6 @@
---
name: "registration_synthregistration"
description: Perform registration using SynthMorph from Freesurfer
description: Perform registration using SynthMorph from Freesurfer. Output transforms in Freesurfer format .lta for affine and .mgz for deform, which can be converted for ANTs with respectively lta_convert and mri_warp_convert.
keywords:
- registration
- Brain imaging
Expand Down Expand Up @@ -43,12 +43,12 @@ output:
- init_transform:
type: file
description: Affine transform for initialization
pattern: "*.{lta}"
pattern: "*.{txt}"

- deform_transform:
type: file
description: Deform transformation
pattern: "*.{nii,.nii.gz}"
pattern: "*.{mgz}"

- warped_image:
type: file
Expand Down
5 changes: 5 additions & 0 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ betcrop/fslbetcrop:
bundle/recognize:
- modules/nf-scil/bundle/recognize/**
- tests/modules/nf-scil/bundle/recognize/**

denoising/mppca:
- modules/nf-scil/denoising/mppca/**
- tests/modules/nf-scil/denoising/mppca/**
Expand Down Expand Up @@ -81,6 +82,10 @@ subworkflows/load_test_data:
- subworkflows/nf-scil/load_test_data/**
- tests/subworkflows/nf-scil/load_test_data/**

testdata/scilpy:
- modules/nf-scil/testdata/scilpy/**
- tests/modules/nf-scil/testdata/scilpy/**

testdata/sizeof:
- modules/nf-scil/testdata/sizeof/**
- tests/modules/nf-scil/testdata/sizeof/**
Expand Down

0 comments on commit a4188ec

Please sign in to comment.