Skip to content

Commit

Permalink
fix tests parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
anroy1 committed Mar 7, 2024
1 parent 89c008d commit f2ab543
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 20 deletions.
32 changes: 13 additions & 19 deletions modules/nf-scil/registration/synthregistration/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,29 @@ process REGISTRATION_SYNTHREGISTRATION {
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def suffix = task.ext.suffix ?: ""
def suffix = task.ext.suffix ?: "${meta.id}"

def header = task.ext.header ? "-H " + task.ext.header : ""
def threads = task.ext.threads ? "-j " + task.ext.threads : ""
def gpu = task.ext.gpu ? "-g " + task.ext.gpu : ""
def smooth = task.ext.smooth ? "-s " + task.ext.smooth : ""
def extent = task.ext.extent ? "-e " + task.ext.extent : ""
def weight = task.ext.weight ? "-w " + task.ext.weight : ""
def init = task.ext.init ? "-m " + task.est.init : "-m affine"
def warp = task.ext.warp ? "-m " + task.est.warp : "-m deform"
def header = task.ext.header ? "-H " + task.ext.header : ""
def threads = task.ext.threads ? "-j " + task.ext.threads : ""
def gpu = task.ext.gpu ? "-g " + task.ext.gpu : ""
def smooth = task.ext.smooth ? "-s " + task.ext.smooth : ""
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 = task.ext.out ? "--out" + task.ext.out : "--outlps"
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 -m affine -t ${prefix}__init_warp.txt $moving $fixed
mri_synthmorph -m deform -i ${prefix}__init_warp.txt -t temp.mgz -o ${prefix}__${suffix}_output_warped.nii.gz $moving $fixed
mri_synthmorph $init -t ${prefix}__init_warp.txt $moving $fixed
mri_synthmorph $warp -i ${prefix}__init_warp.txt -t temp.mgz -o ${prefix}__${suffix}_output_warped.nii.gz $moving $fixed
mri_warp_convert -g $moving --inras temp.mgz $out ${prefix}__deform_warp.nii.gz
mri_warp_convert -g $moving --inras temp.mgz $out_format ${prefix}__deform_warp.nii.gz
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand All @@ -53,14 +55,6 @@ process REGISTRATION_SYNTHREGISTRATION {
def prefix = task.ext.prefix ?: "${meta.id}"
def suffix = task.ext.suffix ?: ""

def header = task.ext.header ? "-H " + task.ext.header : ""
def threads = task.ext.threads ? "-j " + task.ext.threads : ""
def gpu = task.ext.gpu ? "-g " + task.ext.gpu : ""
def smooth = task.ext.smooth ? "-s " + task.ext.smooth : ""
def extent = task.ext.extent ? "-e " + task.ext.extent : ""
def weight = task.ext.weight ? "-w " + task.ext.weight : ""

def out = task.ext.out ? "--out" + task.ext.out : "lps"
"""
mri_synthmorph -h
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ process {

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

0 comments on commit f2ab543

Please sign in to comment.