From 73ca1de0c06adc6fd5704fc0b4cf8abc89c1a0ce Mon Sep 17 00:00:00 2001 From: anroy1 Date: Mon, 8 Jan 2024 20:45:44 -0500 Subject: [PATCH 01/28] initial module commit --- .../registration/synthregistration/main.nf | 78 +++++++++++++++++++ .../registration/synthregistration/meta.yml | 61 +++++++++++++++ tests/config/pytest_modules.yml | 3 + .../registration/synthregistration/main.nf | 24 ++++++ .../synthregistration/nextflow.config | 8 ++ .../registration/synthregistration/test.yml | 13 ++++ 6 files changed, 187 insertions(+) create mode 100644 modules/nf-scil/registration/synthregistration/main.nf create mode 100644 modules/nf-scil/registration/synthregistration/meta.yml create mode 100755 tests/config/pytest_modules.yml create mode 100644 tests/modules/nf-scil/registration/synthregistration/main.nf create mode 100644 tests/modules/nf-scil/registration/synthregistration/nextflow.config create mode 100644 tests/modules/nf-scil/registration/synthregistration/test.yml diff --git a/modules/nf-scil/registration/synthregistration/main.nf b/modules/nf-scil/registration/synthregistration/main.nf new file mode 100644 index 00000000..793f672f --- /dev/null +++ b/modules/nf-scil/registration/synthregistration/main.nf @@ -0,0 +1,78 @@ +process REGISTRATION_SYNTHREGISTRATION { + tag "$meta.id" + label 'process_single' + + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://scil.usherbrooke.ca/containers/scilus_1.6.0.sif': + 'scilus/scilus:1.6.0' }" + + input: + tuple val(meta), path(moving), path(fixed) + + output: + tuple val(meta), path("*__*_output_warped.nii.gz"), emit: warped_image + tuple val(meta), path("*__output_warp.nii.gz"), emit: transform + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def suffix = task.ext.suffix ?: "${meta.}" + + 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 interp = task.ext.interp ? "-n " + task.ext.interp : "" + def dimensionality = task.ext.dimensionality ? "-d " + task.ext.dimensionality : "" + def imagetype = task.ext.imagetype ? "-e " + task.ext.imagetype : "" + + // TODO nf-core: Where possible, a command MUST be provided to obtain the version number of the software e.g. 1.10 + // If the software is unable to output a version number on the command-line then it can be manually specified + // e.g. https://github.com/nf-core/modules/blob/master/modules/nf-core/homer/annotatepeaks/main.nf + // Each software used MUST provide the software name and version number in the YAML version file (versions.yml) + // TODO nf-core: It MUST be possible to pass additional parameters to the tool as a command-line string via the "task.ext.args" directive + // TODO nf-core: If the tool supports multi-threading then you MUST provide the appropriate parameter + // using the Nextflow "task" variable e.g. "--threads $task.cpus" + // TODO nf-core: Please replace the example samtools command below with your module's command + // TODO nf-core: Please indent the command appropriately (4 spaces!!) to help with readability ;) + """ + export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1 + export OMP_NUM_THREADS=1 + export OPENBLAS_NUM_THREADS=1 + + mri_synthmorph -m affine -t init.txt $moving $fixed + mri_synthmorph -m deform -i init.txt -t ${prefix}__output_warp.mgz -o ${prefix}__${suffix}_output_warped.nii.gz $moving $fixed + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + : \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' )) + END_VERSIONS + """ + + stub: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def suffix = task.ext.suffix ?: "${meta.}" + // TODO nf-core: A stub section should mimic the execution of the original module as best as possible + // Have a look at the following examples: + // Simple example: https://github.com/nf-core/modules/blob/818474a292b4860ae8ff88e149fbcda68814114d/modules/nf-core/bcftools/annotate/main.nf#L47-L63 + // Complex example: https://github.com/nf-core/modules/blob/818474a292b4860ae8ff88e149fbcda68814114d/modules/nf-core/bedtools/split/main.nf#L38-L54 + """ + mri_synthmorph -h + + touch ${prefix}__${suffix}_output_warped.nii.gz + touch ${prefix}__output_warp.mgz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + : \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' )) + END_VERSIONS + """ +} diff --git a/modules/nf-scil/registration/synthregistration/meta.yml b/modules/nf-scil/registration/synthregistration/meta.yml new file mode 100644 index 00000000..53053229 --- /dev/null +++ b/modules/nf-scil/registration/synthregistration/meta.yml @@ -0,0 +1,61 @@ +--- +## DONT FORGET TO DECOMMENT yaml +## yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json + +name: "registration_synthregistration" +description: Perform registration using SynthMorph from Freesurfer +keywords: + - registration + - Brain imaging + - MRI +tools: + - "Freesurfer": + description: "Freesurfer Toolbox" + homepage: "https://surfer.nmr.mgh.harvard.edu/" + + +## TODO nf-core: Add a description of all of the variables used as input +input: + # Only when we have meta + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + + - moving: + type: file + description: Nifti volume moving for registration + pattern: "*.{nii,nii.gz}" + + - fixed: + type: file + description: Nifti volume fixed for registration + pattern: "*.{nii,nii.gz}" + +## TODO nf-core: Add a description of all of the variables used as output +output: + #Only when we have meta + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. `[ id:'test', single_end:false ]` + + - warped: + type: file + description: Nifti volume moved after registration + pattern: "*.{nii,nii.gz}" + + - warp: + type: file + description: Displacement field + pattern: "*.{mgz}" + + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + +authors: + - "@scilus" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml new file mode 100755 index 00000000..8fb708a6 --- /dev/null +++ b/tests/config/pytest_modules.yml @@ -0,0 +1,3 @@ +registration/synthregistration: + - modules/nf-scil/registration/synthregistration/** + - tests/modules/nf-scil/registration/synthregistration/** diff --git a/tests/modules/nf-scil/registration/synthregistration/main.nf b/tests/modules/nf-scil/registration/synthregistration/main.nf new file mode 100644 index 00000000..c7c8c15f --- /dev/null +++ b/tests/modules/nf-scil/registration/synthregistration/main.nf @@ -0,0 +1,24 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { LOAD_TEST_DATA } from '../../../../../modules/nf-scil/load_test_data/main.nf' +include { + REGISTRATION_SYNTHREGISTRATION as T1_FA; } from '../../../../../modules/nf-scil/registration/synthregistration/main.nf' + +workflow test_registration_synthregistration { + + input_fetch = Channel.from( [ "others.zip" ] ) + + LOAD_TEST_DATA ( input_fetch, "test.load-test-data" ) + + input_t1fa = LOAD_TEST_DATA.out.test_data_directory + .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") + ]} + + REGISTRATION_SYNTHREGISTRATION ( input_t1fa ) + +} diff --git a/tests/modules/nf-scil/registration/synthregistration/nextflow.config b/tests/modules/nf-scil/registration/synthregistration/nextflow.config new file mode 100644 index 00000000..5c687e42 --- /dev/null +++ b/tests/modules/nf-scil/registration/synthregistration/nextflow.config @@ -0,0 +1,8 @@ +process { + + withName: "REGISTRATION_SYNTHREGISTRATION" { + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + + } + +} \ No newline at end of file diff --git a/tests/modules/nf-scil/registration/synthregistration/test.yml b/tests/modules/nf-scil/registration/synthregistration/test.yml new file mode 100644 index 00000000..693eb329 --- /dev/null +++ b/tests/modules/nf-scil/registration/synthregistration/test.yml @@ -0,0 +1,13 @@ +## TODO nf-core: Please run the following command to build this file: +# nf-core modules create-test-yml /synthregistration +- name: "registration synthregistration" + command: nextflow run ./tests/modules/nf-scil/registration/synthregistration -entry test_registration_synthregistration -c ./tests/config/nextflow.config + tags: + - "registration" + - "registration/synthregistration" + files: + - path: "output/registration/test.bam" + md5sum: e667c7caad0bc4b7ac383fd023c654fc + - path: "output/registration/versions.yml" + md5sum: a01fe51bc4c6a3a6226fbf77b2c7cf3b + From f9b9b3bf407a7f37e184c33a82a30f52e84bfeb4 Mon Sep 17 00:00:00 2001 From: anroy1 Date: Sun, 14 Jan 2024 14:42:25 -0500 Subject: [PATCH 02/28] manage output format for ants and include init transform as output --- .../registration/synthregistration/main.nf | 42 +++++++++---------- .../registration/synthregistration/meta.yml | 19 +++------ 2 files changed, 27 insertions(+), 34 deletions(-) diff --git a/modules/nf-scil/registration/synthregistration/main.nf b/modules/nf-scil/registration/synthregistration/main.nf index 793f672f..e14588c6 100644 --- a/modules/nf-scil/registration/synthregistration/main.nf +++ b/modules/nf-scil/registration/synthregistration/main.nf @@ -11,7 +11,8 @@ process REGISTRATION_SYNTHREGISTRATION { output: tuple val(meta), path("*__*_output_warped.nii.gz"), emit: warped_image - tuple val(meta), path("*__output_warp.nii.gz"), emit: transform + tuple val(meta), path("*__deform_warp.nii.gz"), emit: deform_transform + tuple val (meta), path("*__init_warp.txt"), emit: affine_transform path "versions.yml" , emit: versions when: @@ -29,26 +30,17 @@ process REGISTRATION_SYNTHREGISTRATION { def extent = task.ext.extent ? "-e " + task.ext.extent : "" def weight = task.ext.weight ? "-w " + task.ext.weight : "" - def interp = task.ext.interp ? "-n " + task.ext.interp : "" - def dimensionality = task.ext.dimensionality ? "-d " + task.ext.dimensionality : "" - def imagetype = task.ext.imagetype ? "-e " + task.ext.imagetype : "" - - // TODO nf-core: Where possible, a command MUST be provided to obtain the version number of the software e.g. 1.10 - // If the software is unable to output a version number on the command-line then it can be manually specified - // e.g. https://github.com/nf-core/modules/blob/master/modules/nf-core/homer/annotatepeaks/main.nf - // Each software used MUST provide the software name and version number in the YAML version file (versions.yml) - // TODO nf-core: It MUST be possible to pass additional parameters to the tool as a command-line string via the "task.ext.args" directive - // TODO nf-core: If the tool supports multi-threading then you MUST provide the appropriate parameter - // using the Nextflow "task" variable e.g. "--threads $task.cpus" - // TODO nf-core: Please replace the example samtools command below with your module's command - // TODO nf-core: Please indent the command appropriately (4 spaces!!) to help with readability ;) + def out = task.ext.out ? "--out" + task.ext.out : "lps" + """ export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1 export OMP_NUM_THREADS=1 export OPENBLAS_NUM_THREADS=1 - mri_synthmorph -m affine -t init.txt $moving $fixed - mri_synthmorph -m deform -i init.txt -t ${prefix}__output_warp.mgz -o ${prefix}__${suffix}_output_warped.nii.gz $moving $fixed + 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_warp_convert -g $moving --inras temp.mgz $out ${prefix}__deform_warp.nii.gz cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -60,15 +52,23 @@ process REGISTRATION_SYNTHREGISTRATION { def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def suffix = task.ext.suffix ?: "${meta.}" - // TODO nf-core: A stub section should mimic the execution of the original module as best as possible - // Have a look at the following examples: - // Simple example: https://github.com/nf-core/modules/blob/818474a292b4860ae8ff88e149fbcda68814114d/modules/nf-core/bcftools/annotate/main.nf#L47-L63 - // Complex example: https://github.com/nf-core/modules/blob/818474a292b4860ae8ff88e149fbcda68814114d/modules/nf-core/bedtools/split/main.nf#L38-L54 + + 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 + mri_warp_convert -h + touch ${prefix}__${suffix}_output_warped.nii.gz - touch ${prefix}__output_warp.mgz + touch ${prefix}__deform_warp.nii.gz + touch ${prefix}__init_warp.txt cat <<-END_VERSIONS > versions.yml "${task.process}": diff --git a/modules/nf-scil/registration/synthregistration/meta.yml b/modules/nf-scil/registration/synthregistration/meta.yml index 53053229..dcfa056f 100644 --- a/modules/nf-scil/registration/synthregistration/meta.yml +++ b/modules/nf-scil/registration/synthregistration/meta.yml @@ -1,7 +1,4 @@ --- -## DONT FORGET TO DECOMMENT yaml -## yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/yaml-schema.json - name: "registration_synthregistration" description: Perform registration using SynthMorph from Freesurfer keywords: @@ -14,9 +11,7 @@ tools: homepage: "https://surfer.nmr.mgh.harvard.edu/" -## TODO nf-core: Add a description of all of the variables used as input input: - # Only when we have meta - meta: type: map description: | @@ -33,24 +28,22 @@ input: description: Nifti volume fixed for registration pattern: "*.{nii,nii.gz}" -## TODO nf-core: Add a description of all of the variables used as output output: - #Only when we have meta - meta: type: map description: | Groovy Map containing sample information e.g. `[ id:'test', single_end:false ]` - - warped: + - init: type: file - description: Nifti volume moved after registration - pattern: "*.{nii,nii.gz}" + description: Affine transform for initialization + pattern: "*.{txt}" - - warp: + - deform: type: file - description: Displacement field - pattern: "*.{mgz}" + description: Deform transformation + pattern: "*.{nii,.nii.gz}" - versions: type: file From 819a8210deeed8faf7105f032078c544115176ce Mon Sep 17 00:00:00 2001 From: anroy1 Date: Fri, 19 Jan 2024 14:19:11 -0500 Subject: [PATCH 03/28] quick fix --- modules/nf-scil/registration/synthregistration/main.nf | 8 +++++--- .../registration/synthregistration/nextflow.config | 8 ++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/modules/nf-scil/registration/synthregistration/main.nf b/modules/nf-scil/registration/synthregistration/main.nf index e14588c6..e200f652 100644 --- a/modules/nf-scil/registration/synthregistration/main.nf +++ b/modules/nf-scil/registration/synthregistration/main.nf @@ -9,6 +9,7 @@ process REGISTRATION_SYNTHREGISTRATION { input: tuple val(meta), path(moving), path(fixed) + output: tuple val(meta), path("*__*_output_warped.nii.gz"), emit: warped_image tuple val(meta), path("*__deform_warp.nii.gz"), emit: deform_transform @@ -16,12 +17,12 @@ process REGISTRATION_SYNTHREGISTRATION { path "versions.yml" , emit: versions when: - task.ext.when == null || task.ext.when + task.ext.when == null || task.ext.when_output_warped script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def suffix = task.ext.suffix ?: "${meta.}" + def suffix = task.ext.suffix ?: "" def header = task.ext.header ? "-H " + task.ext.header : "" def threads = task.ext.threads ? "-j " + task.ext.threads : "" @@ -30,7 +31,8 @@ process REGISTRATION_SYNTHREGISTRATION { 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" + //For argument definition, mri_warp_convert -h + def out = task.ext.out ? "--out" + task.ext.out : "--outlps" """ export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1 diff --git a/tests/modules/nf-scil/registration/synthregistration/nextflow.config b/tests/modules/nf-scil/registration/synthregistration/nextflow.config index 5c687e42..f04adea8 100644 --- a/tests/modules/nf-scil/registration/synthregistration/nextflow.config +++ b/tests/modules/nf-scil/registration/synthregistration/nextflow.config @@ -1,8 +1,8 @@ process { + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - withName: "REGISTRATION_SYNTHREGISTRATION" { - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - + withName: "T1_FA" { + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + ext.out = "lps" } - } \ No newline at end of file From 943c25de65bc2f84ef0e04ff57d396b091937244 Mon Sep 17 00:00:00 2001 From: anroy1 Date: Fri, 26 Jan 2024 12:48:18 -0500 Subject: [PATCH 04/28] test fix 1 --- .../nf-scil/registration/synthregistration/main.nf | 8 ++++---- .../nf-scil/registration/synthregistration/meta.yml | 11 ++++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/modules/nf-scil/registration/synthregistration/main.nf b/modules/nf-scil/registration/synthregistration/main.nf index e200f652..81568c2b 100644 --- a/modules/nf-scil/registration/synthregistration/main.nf +++ b/modules/nf-scil/registration/synthregistration/main.nf @@ -3,8 +3,8 @@ process REGISTRATION_SYNTHREGISTRATION { label 'process_single' container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://scil.usherbrooke.ca/containers/scilus_1.6.0.sif': - 'scilus/scilus:1.6.0' }" + 'freesurfer/synthmorph:latest': + 'freesurfer/synthmorph:latest' }" input: tuple val(meta), path(moving), path(fixed) @@ -13,11 +13,11 @@ 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("*__init_warp.txt"), emit: affine_transform + tuple val (meta), path("*__init_warp.txt"), emit: init_transform path "versions.yml" , emit: versions when: - task.ext.when == null || task.ext.when_output_warped + task.ext.when == null || task.ext.when script: def args = task.ext.args ?: '' diff --git a/modules/nf-scil/registration/synthregistration/meta.yml b/modules/nf-scil/registration/synthregistration/meta.yml index dcfa056f..20b73831 100644 --- a/modules/nf-scil/registration/synthregistration/meta.yml +++ b/modules/nf-scil/registration/synthregistration/meta.yml @@ -35,16 +35,21 @@ output: Groovy Map containing sample information e.g. `[ id:'test', single_end:false ]` - - init: + - init_transform: type: file description: Affine transform for initialization pattern: "*.{txt}" - - deform: + - deform_transform: type: file description: Deform transformation pattern: "*.{nii,.nii.gz}" - + + - warped_image: + type: file + description: Warped image + pattern: "*.{nii,.nii.gz}" + - versions: type: file description: File containing software versions From 944b2d22c7b1ec0a2f2b332e6e96f79127d629d9 Mon Sep 17 00:00:00 2001 From: anroy1 Date: Fri, 26 Jan 2024 14:11:22 -0500 Subject: [PATCH 05/28] 2nd fix for tests --- modules/nf-scil/registration/synthregistration/main.nf | 6 ++---- .../modules/nf-scil/registration/synthregistration/test.yml | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/nf-scil/registration/synthregistration/main.nf b/modules/nf-scil/registration/synthregistration/main.nf index 81568c2b..8b7af873 100644 --- a/modules/nf-scil/registration/synthregistration/main.nf +++ b/modules/nf-scil/registration/synthregistration/main.nf @@ -2,9 +2,7 @@ process REGISTRATION_SYNTHREGISTRATION { tag "$meta.id" label 'process_single' - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'freesurfer/synthmorph:latest': - 'freesurfer/synthmorph:latest' }" + container "freesurfer/synthmorph:latest" input: tuple val(meta), path(moving), path(fixed) @@ -31,7 +29,7 @@ process REGISTRATION_SYNTHREGISTRATION { def extent = task.ext.extent ? "-e " + task.ext.extent : "" def weight = task.ext.weight ? "-w " + task.ext.weight : "" - //For argument definition, mri_warp_convert -h + //For arguments definition, mri_warp_convert -h def out = task.ext.out ? "--out" + task.ext.out : "--outlps" """ diff --git a/tests/modules/nf-scil/registration/synthregistration/test.yml b/tests/modules/nf-scil/registration/synthregistration/test.yml index 693eb329..4e1c389d 100644 --- a/tests/modules/nf-scil/registration/synthregistration/test.yml +++ b/tests/modules/nf-scil/registration/synthregistration/test.yml @@ -1,6 +1,6 @@ ## TODO nf-core: Please run the following command to build this file: # nf-core modules create-test-yml /synthregistration -- name: "registration synthregistration" +- 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" @@ -10,4 +10,4 @@ md5sum: e667c7caad0bc4b7ac383fd023c654fc - path: "output/registration/versions.yml" md5sum: a01fe51bc4c6a3a6226fbf77b2c7cf3b - + From a4ab7bc6af76b1332266a3e0908c4ec688f8fea2 Mon Sep 17 00:00:00 2001 From: anroy1 Date: Tue, 13 Feb 2024 10:11:18 -0500 Subject: [PATCH 06/28] quick fix --- modules/nf-scil/registration/synthregistration/main.nf | 2 +- tests/modules/nf-scil/registration/synthregistration/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/nf-scil/registration/synthregistration/main.nf b/modules/nf-scil/registration/synthregistration/main.nf index 8b7af873..7b6d2d50 100644 --- a/modules/nf-scil/registration/synthregistration/main.nf +++ b/modules/nf-scil/registration/synthregistration/main.nf @@ -72,7 +72,7 @@ process REGISTRATION_SYNTHREGISTRATION { cat <<-END_VERSIONS > versions.yml "${task.process}": - : \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' )) + Freesurfer: 7.4 END_VERSIONS """ } diff --git a/tests/modules/nf-scil/registration/synthregistration/test.yml b/tests/modules/nf-scil/registration/synthregistration/test.yml index 4e1c389d..49a88bab 100644 --- a/tests/modules/nf-scil/registration/synthregistration/test.yml +++ b/tests/modules/nf-scil/registration/synthregistration/test.yml @@ -1,5 +1,5 @@ ## TODO nf-core: Please run the following command to build this file: -# nf-core modules create-test-yml /synthregistration +# nf-core modules create-test-yml registration/synthregistration - 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: From 8527df2d48c612fd7957138afcd676182cc2f6c4 Mon Sep 17 00:00:00 2001 From: anroy1 Date: Wed, 21 Feb 2024 19:44:39 +0000 Subject: [PATCH 07/28] test naming fix --- modules/nf-scil/registration/synthregistration/main.nf | 4 ++-- .../nf-scil/registration/synthregistration/main.nf | 6 +++--- .../registration/synthregistration/nextflow.config | 9 ++++++--- .../nf-scil/registration/synthregistration/test.yml | 2 -- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/modules/nf-scil/registration/synthregistration/main.nf b/modules/nf-scil/registration/synthregistration/main.nf index 7b6d2d50..0fc76c1b 100644 --- a/modules/nf-scil/registration/synthregistration/main.nf +++ b/modules/nf-scil/registration/synthregistration/main.nf @@ -44,14 +44,14 @@ process REGISTRATION_SYNTHREGISTRATION { cat <<-END_VERSIONS > versions.yml "${task.process}": - : \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//' )) + Freesurfer: 7.4 END_VERSIONS """ stub: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def suffix = task.ext.suffix ?: "${meta.}" + def suffix = task.ext.suffix ?: "" def header = task.ext.header ? "-H " + task.ext.header : "" def threads = task.ext.threads ? "-j " + task.ext.threads : "" diff --git a/tests/modules/nf-scil/registration/synthregistration/main.nf b/tests/modules/nf-scil/registration/synthregistration/main.nf index c7c8c15f..134628ba 100644 --- a/tests/modules/nf-scil/registration/synthregistration/main.nf +++ b/tests/modules/nf-scil/registration/synthregistration/main.nf @@ -4,10 +4,10 @@ nextflow.enable.dsl = 2 include { LOAD_TEST_DATA } from '../../../../../modules/nf-scil/load_test_data/main.nf' include { - REGISTRATION_SYNTHREGISTRATION as T1_FA; } from '../../../../../modules/nf-scil/registration/synthregistration/main.nf' + REGISTRATION_SYNTHREGISTRATION as REGISTRATION_SYNTHREGISTRATION_T1FA; } from '../../../../../modules/nf-scil/registration/synthregistration/main.nf' workflow test_registration_synthregistration { - + input_fetch = Channel.from( [ "others.zip" ] ) LOAD_TEST_DATA ( input_fetch, "test.load-test-data" ) @@ -19,6 +19,6 @@ workflow test_registration_synthregistration { file("${test_data_directory}/fa.nii.gz") ]} - REGISTRATION_SYNTHREGISTRATION ( input_t1fa ) + REGISTRATION_SYNTHREGISTRATION_T1FA ( input_t1fa ) } diff --git a/tests/modules/nf-scil/registration/synthregistration/nextflow.config b/tests/modules/nf-scil/registration/synthregistration/nextflow.config index f04adea8..2a40b80a 100644 --- a/tests/modules/nf-scil/registration/synthregistration/nextflow.config +++ b/tests/modules/nf-scil/registration/synthregistration/nextflow.config @@ -1,8 +1,11 @@ process { - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - withName: "T1_FA" { + withName: "REGISTRATION_SYNTHREGISTRATION" { + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + } + + withName: "REGISTRATION_SYNTHREGISTRATION_T1FA" { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } ext.out = "lps" } -} \ No newline at end of file +} diff --git a/tests/modules/nf-scil/registration/synthregistration/test.yml b/tests/modules/nf-scil/registration/synthregistration/test.yml index 49a88bab..49c0e31b 100644 --- a/tests/modules/nf-scil/registration/synthregistration/test.yml +++ b/tests/modules/nf-scil/registration/synthregistration/test.yml @@ -1,5 +1,3 @@ -## TODO nf-core: Please run the following command to build this file: -# nf-core modules create-test-yml registration/synthregistration - 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: From ec3abcf3590523a66f1be2639e2d281380ae52cf Mon Sep 17 00:00:00 2001 From: anroy1 Date: Thu, 22 Feb 2024 15:06:05 +0000 Subject: [PATCH 08/28] fix scilpy fetcher path --- tests/modules/nf-scil/registration/synthregistration/main.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/modules/nf-scil/registration/synthregistration/main.nf b/tests/modules/nf-scil/registration/synthregistration/main.nf index 134628ba..2b181af0 100644 --- a/tests/modules/nf-scil/registration/synthregistration/main.nf +++ b/tests/modules/nf-scil/registration/synthregistration/main.nf @@ -2,7 +2,7 @@ nextflow.enable.dsl = 2 -include { LOAD_TEST_DATA } from '../../../../../modules/nf-scil/load_test_data/main.nf' +include { LOAD_TEST_DATA } from '../../../../../subworkflows/nf-scil/load_test_data/main.nf' include { REGISTRATION_SYNTHREGISTRATION as REGISTRATION_SYNTHREGISTRATION_T1FA; } from '../../../../../modules/nf-scil/registration/synthregistration/main.nf' From 8563d0f498157b6e76ce5ef97ea9fb2bb6e3a3ce Mon Sep 17 00:00:00 2001 From: anroy1 Date: Thu, 22 Feb 2024 20:58:30 +0000 Subject: [PATCH 09/28] fix tests parameters --- .../registration/synthregistration/main.nf | 32 ++++++++----------- .../synthregistration/nextflow.config | 1 - 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/modules/nf-scil/registration/synthregistration/main.nf b/modules/nf-scil/registration/synthregistration/main.nf index 0fc76c1b..a8d9cc34 100644 --- a/modules/nf-scil/registration/synthregistration/main.nf +++ b/modules/nf-scil/registration/synthregistration/main.nf @@ -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}": @@ -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 diff --git a/tests/modules/nf-scil/registration/synthregistration/nextflow.config b/tests/modules/nf-scil/registration/synthregistration/nextflow.config index 2a40b80a..d347f93c 100644 --- a/tests/modules/nf-scil/registration/synthregistration/nextflow.config +++ b/tests/modules/nf-scil/registration/synthregistration/nextflow.config @@ -6,6 +6,5 @@ process { withName: "REGISTRATION_SYNTHREGISTRATION_T1FA" { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - ext.out = "lps" } } From d865f3e4996a19fc78e182bd3788173df48abc12 Mon Sep 17 00:00:00 2001 From: anroy1 Date: Fri, 1 Mar 2024 20:31:32 +0000 Subject: [PATCH 10/28] [WIP] modify module and test to manage freesurfer license --- .test_data/heavy/freesurfer/license.txt | 3 +++ .../registration/synthregistration/main.nf | 16 ++++++++++++- .../registration/synthregistration/meta.yml | 5 ++++ tests/config/test_data.config | 6 +++++ .../registration/synthregistration/main.nf | 23 +++++++------------ .../synthregistration/nextflow.config | 7 +----- 6 files changed, 38 insertions(+), 22 deletions(-) create mode 100644 .test_data/heavy/freesurfer/license.txt diff --git a/.test_data/heavy/freesurfer/license.txt b/.test_data/heavy/freesurfer/license.txt new file mode 100644 index 00000000..9c31cab4 --- /dev/null +++ b/.test_data/heavy/freesurfer/license.txt @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:05d2a544719626968d938cca74effbd673474fdc0db1d134f77f38e2fc497f49 +size 102 diff --git a/modules/nf-scil/registration/synthregistration/main.nf b/modules/nf-scil/registration/synthregistration/main.nf index a8d9cc34..3589e7a2 100644 --- a/modules/nf-scil/registration/synthregistration/main.nf +++ b/modules/nf-scil/registration/synthregistration/main.nf @@ -5,7 +5,7 @@ process REGISTRATION_SYNTHREGISTRATION { container "freesurfer/synthmorph:latest" input: - tuple val(meta), path(moving), path(fixed) + tuple val(meta), path(moving), path(fixed), path(fs_license) /* optional, value = [] */ output: @@ -35,6 +35,15 @@ process REGISTRATION_SYNTHREGISTRATION { def out_format = task.ext.out_format ? "--out" + task.ext.out_format : "--outlps" """ + # Manage the license. (Save old one if existed.) + if [ $fs_license = [] ]; then + echo "License not given in input. Using default environment. " + else + cp $fs_license .license + here=`pwd` + export FS_LICENSE=\$here/.license + fi + export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1 export OMP_NUM_THREADS=1 export OPENBLAS_NUM_THREADS=1 @@ -44,6 +53,11 @@ process REGISTRATION_SYNTHREGISTRATION { mri_warp_convert -g $moving --inras temp.mgz $out_format ${prefix}__deform_warp.nii.gz + # Remove the license + if [ ! $fs_license = [] ]; then + rm .license + fi + cat <<-END_VERSIONS > versions.yml "${task.process}": Freesurfer: 7.4 diff --git a/modules/nf-scil/registration/synthregistration/meta.yml b/modules/nf-scil/registration/synthregistration/meta.yml index 20b73831..1cca21c4 100644 --- a/modules/nf-scil/registration/synthregistration/meta.yml +++ b/modules/nf-scil/registration/synthregistration/meta.yml @@ -28,6 +28,11 @@ 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 diff --git a/tests/config/test_data.config b/tests/config/test_data.config index f34a7443..8df513ef 100755 --- a/tests/config/test_data.config +++ b/tests/config/test_data.config @@ -80,6 +80,12 @@ params { frf = "${params.test_data_base}/reconst/frf.txt" } } + "registration" { + "synthregistration"{ + t1 = "${params.test_data_base}/heavy/anat/anat_image.nii.gz" + fa = "${params.test_data_base}/heavy/dwi/dwi.nii.gz" + fs_license = "${params.test_data_base}/heavy/freesurfer/license.txt" + } "segmentation" { "freesurferseg" { aparc_aseg = "${params.test_data_base}/heavy/freesurfer/aparc_aseg.nii.gz" diff --git a/tests/modules/nf-scil/registration/synthregistration/main.nf b/tests/modules/nf-scil/registration/synthregistration/main.nf index 2b181af0..dfa3dfe9 100644 --- a/tests/modules/nf-scil/registration/synthregistration/main.nf +++ b/tests/modules/nf-scil/registration/synthregistration/main.nf @@ -2,23 +2,16 @@ nextflow.enable.dsl = 2 -include { LOAD_TEST_DATA } from '../../../../../subworkflows/nf-scil/load_test_data/main.nf' -include { - REGISTRATION_SYNTHREGISTRATION as REGISTRATION_SYNTHREGISTRATION_T1FA; } from '../../../../../modules/nf-scil/registration/synthregistration/main.nf' +include { REGISTRATION_SYNTHREGISTRATION } from '../../../../../modules/nf-scil/registration/synthregistration/main.nf' workflow test_registration_synthregistration { - input_fetch = Channel.from( [ "others.zip" ] ) - - LOAD_TEST_DATA ( input_fetch, "test.load-test-data" ) - - input_t1fa = LOAD_TEST_DATA.out.test_data_directory - .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") - ]} - - REGISTRATION_SYNTHREGISTRATION_T1FA ( input_t1fa ) + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['registration']['synthregistration']['t1'], checkIfExists: true), + file(params.test_data['registration']['synthregistration']['fa'], checkIfExists: true), + file(params.test_data['registration']['synthregistration']['fs_license'], checkIfExists: true) + ] + REGISTRATION_SYNTHREGISTRATION ( input ) } diff --git a/tests/modules/nf-scil/registration/synthregistration/nextflow.config b/tests/modules/nf-scil/registration/synthregistration/nextflow.config index d347f93c..8730f1c4 100644 --- a/tests/modules/nf-scil/registration/synthregistration/nextflow.config +++ b/tests/modules/nf-scil/registration/synthregistration/nextflow.config @@ -1,10 +1,5 @@ process { - withName: "REGISTRATION_SYNTHREGISTRATION" { - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - } + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - withName: "REGISTRATION_SYNTHREGISTRATION_T1FA" { - publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - } } From d3bbf094482dcf96d85dead7daf57600a6501e76 Mon Sep 17 00:00:00 2001 From: anroy1 Date: Tue, 9 Apr 2024 19:16:44 +0000 Subject: [PATCH 11/28] fix test data, freesurfer license --- .../registration/synthregistration/main.nf | 29 +++++-------------- tests/config/test_data.config | 6 ---- .../registration/synthregistration/main.nf | 17 +++++++---- 3 files changed, 19 insertions(+), 33 deletions(-) diff --git a/modules/nf-scil/registration/synthregistration/main.nf b/modules/nf-scil/registration/synthregistration/main.nf index 3589e7a2..ab3024c7 100644 --- a/modules/nf-scil/registration/synthregistration/main.nf +++ b/modules/nf-scil/registration/synthregistration/main.nf @@ -2,14 +2,15 @@ process REGISTRATION_SYNTHREGISTRATION { tag "$meta.id" label 'process_single' - container "freesurfer/synthmorph:latest" + container "freesurfer/freesurfer:7.4.1" + containerOptions "--entrypoint ''" input: tuple val(meta), path(moving), path(fixed), path(fs_license) /* optional, value = [] */ output: - tuple val(meta), path("*__*_output_warped.nii.gz"), emit: warped_image + 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("*__init_warp.txt"), emit: init_transform path "versions.yml" , emit: versions @@ -20,13 +21,12 @@ process REGISTRATION_SYNTHREGISTRATION { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def suffix = task.ext.suffix ?: "${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 header = task.ext.header ? "-H " + task.ext.header : "" + def header = task.ext.header ? "-H" : "" def threads = task.ext.threads ? "-j " + task.ext.threads : "" - def gpu = task.ext.gpu ? "-g " + task.ext.gpu : "" + def gpu = task.ext.gpu ? "-g" : "" 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 : "" @@ -35,29 +35,15 @@ process REGISTRATION_SYNTHREGISTRATION { def out_format = task.ext.out_format ? "--out" + task.ext.out_format : "--outlps" """ - # Manage the license. (Save old one if existed.) - if [ $fs_license = [] ]; then - echo "License not given in input. Using default environment. " - else - cp $fs_license .license - here=`pwd` - export FS_LICENSE=\$here/.license - fi - export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1 export OMP_NUM_THREADS=1 export OPENBLAS_NUM_THREADS=1 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_synthmorph $warp -i ${prefix}__init_warp.txt -t temp.mgz -o ${prefix}__output_warped.nii.gz $moving $fixed mri_warp_convert -g $moving --inras temp.mgz $out_format ${prefix}__deform_warp.nii.gz - # Remove the license - if [ ! $fs_license = [] ]; then - rm .license - fi - cat <<-END_VERSIONS > versions.yml "${task.process}": Freesurfer: 7.4 @@ -67,14 +53,13 @@ process REGISTRATION_SYNTHREGISTRATION { stub: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def suffix = task.ext.suffix ?: "" """ mri_synthmorph -h mri_warp_convert -h - touch ${prefix}__${suffix}_output_warped.nii.gz + touch ${prefix}__output_warped.nii.gz touch ${prefix}__deform_warp.nii.gz touch ${prefix}__init_warp.txt diff --git a/tests/config/test_data.config b/tests/config/test_data.config index 8df513ef..f34a7443 100755 --- a/tests/config/test_data.config +++ b/tests/config/test_data.config @@ -80,12 +80,6 @@ params { frf = "${params.test_data_base}/reconst/frf.txt" } } - "registration" { - "synthregistration"{ - t1 = "${params.test_data_base}/heavy/anat/anat_image.nii.gz" - fa = "${params.test_data_base}/heavy/dwi/dwi.nii.gz" - fs_license = "${params.test_data_base}/heavy/freesurfer/license.txt" - } "segmentation" { "freesurferseg" { aparc_aseg = "${params.test_data_base}/heavy/freesurfer/aparc_aseg.nii.gz" diff --git a/tests/modules/nf-scil/registration/synthregistration/main.nf b/tests/modules/nf-scil/registration/synthregistration/main.nf index dfa3dfe9..3d106ebc 100644 --- a/tests/modules/nf-scil/registration/synthregistration/main.nf +++ b/tests/modules/nf-scil/registration/synthregistration/main.nf @@ -2,16 +2,23 @@ nextflow.enable.dsl = 2 +include { LOAD_TEST_DATA } from '../../../../../subworkflows/nf-scil/load_test_data/main' include { REGISTRATION_SYNTHREGISTRATION } from '../../../../../modules/nf-scil/registration/synthregistration/main.nf' workflow test_registration_synthregistration { - input = [ + input_fetch = Channel.from( [ "freesurfer.zip" ] ) + + LOAD_TEST_DATA ( input_fetch, "test.load-test-data" ) + + input = LOAD_TEST_DATA.out.test_data_directory + .map{ test_data_directory -> [ [ id:'test', single_end:false ], // meta map - file(params.test_data['registration']['synthregistration']['t1'], checkIfExists: true), - file(params.test_data['registration']['synthregistration']['fa'], checkIfExists: true), - file(params.test_data['registration']['synthregistration']['fs_license'], checkIfExists: true) - ] + file("${test_data_directory}/t1.nii.gz"), + file("${test_data_directory}/fa.nii.gz"), + [] + + ]} REGISTRATION_SYNTHREGISTRATION ( input ) } From f1cbf984c7b07fcfec55f04333f7a9497bdcde2d Mon Sep 17 00:00:00 2001 From: anroy1 Date: Tue, 9 Apr 2024 19:24:48 +0000 Subject: [PATCH 12/28] remove fs license --- .test_data/heavy/freesurfer/license.txt | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 .test_data/heavy/freesurfer/license.txt diff --git a/.test_data/heavy/freesurfer/license.txt b/.test_data/heavy/freesurfer/license.txt deleted file mode 100644 index 9c31cab4..00000000 --- a/.test_data/heavy/freesurfer/license.txt +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:05d2a544719626968d938cca74effbd673474fdc0db1d134f77f38e2fc497f49 -size 102 From e0d3143cf40ff23aada5a87ee44034f621a7c649 Mon Sep 17 00:00:00 2001 From: anroy1 Date: Wed, 10 Apr 2024 14:39:22 +0000 Subject: [PATCH 13/28] [WIP] improve test --- .../nf-scil/registration/synthregistration/main.nf | 14 +++++--------- .../registration/synthregistration/meta.yml | 4 ++-- .../nf-scil/registration/synthregistration/main.nf | 2 +- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/modules/nf-scil/registration/synthregistration/main.nf b/modules/nf-scil/registration/synthregistration/main.nf index ab3024c7..da027e7a 100644 --- a/modules/nf-scil/registration/synthregistration/main.nf +++ b/modules/nf-scil/registration/synthregistration/main.nf @@ -2,7 +2,7 @@ process REGISTRATION_SYNTHREGISTRATION { tag "$meta.id" label 'process_single' - container "freesurfer/freesurfer:7.4.1" + container "freesurfer/synthmorph:latest" containerOptions "--entrypoint ''" input: @@ -11,8 +11,8 @@ 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("*__init_warp.txt"), emit: init_transform + tuple val(meta), path("*__deform_warp.m3z"), emit: deform_transform + tuple val (meta), path("*__init_warp.lta"), emit: init_transform path "versions.yml" , emit: versions when: @@ -39,10 +39,8 @@ process REGISTRATION_SYNTHREGISTRATION { export OMP_NUM_THREADS=1 export OPENBLAS_NUM_THREADS=1 - mri_synthmorph $init -t ${prefix}__init_warp.txt $moving $fixed - mri_synthmorph $warp -i ${prefix}__init_warp.txt -t temp.mgz -o ${prefix}__output_warped.nii.gz $moving $fixed - - mri_warp_convert -g $moving --inras temp.mgz $out_format ${prefix}__deform_warp.nii.gz + 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 cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -57,8 +55,6 @@ process REGISTRATION_SYNTHREGISTRATION { """ mri_synthmorph -h - mri_warp_convert -h - touch ${prefix}__output_warped.nii.gz touch ${prefix}__deform_warp.nii.gz touch ${prefix}__init_warp.txt diff --git a/modules/nf-scil/registration/synthregistration/meta.yml b/modules/nf-scil/registration/synthregistration/meta.yml index 1cca21c4..2ec3d83f 100644 --- a/modules/nf-scil/registration/synthregistration/meta.yml +++ b/modules/nf-scil/registration/synthregistration/meta.yml @@ -43,12 +43,12 @@ output: - init_transform: type: file description: Affine transform for initialization - pattern: "*.{txt}" + pattern: "*.{lta}" - deform_transform: type: file description: Deform transformation - pattern: "*.{nii,.nii.gz}" + pattern: "*.{m3z}" - warped_image: type: file diff --git a/tests/modules/nf-scil/registration/synthregistration/main.nf b/tests/modules/nf-scil/registration/synthregistration/main.nf index 3d106ebc..c45a7bd2 100644 --- a/tests/modules/nf-scil/registration/synthregistration/main.nf +++ b/tests/modules/nf-scil/registration/synthregistration/main.nf @@ -16,7 +16,7 @@ workflow test_registration_synthregistration { [ 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") ]} From de0a5c5909dbd2ae711a9ac76dfdd7dcc6e489a8 Mon Sep 17 00:00:00 2001 From: anroy1 Date: Tue, 16 Apr 2024 13:58:35 +0000 Subject: [PATCH 14/28] Adjust nextflow config and output format --- .../registration/synthregistration/main.nf | 7 ++---- .../registration/synthregistration/meta.yml | 6 ++--- tests/config/nextflow.config | 4 +-- .../registration/synthregistration/test.yml | 25 +++++++++++++------ 4 files changed, 25 insertions(+), 17 deletions(-) diff --git a/modules/nf-scil/registration/synthregistration/main.nf b/modules/nf-scil/registration/synthregistration/main.nf index da027e7a..5ceb177e 100644 --- a/modules/nf-scil/registration/synthregistration/main.nf +++ b/modules/nf-scil/registration/synthregistration/main.nf @@ -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 @@ -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}": diff --git a/modules/nf-scil/registration/synthregistration/meta.yml b/modules/nf-scil/registration/synthregistration/meta.yml index 2ec3d83f..e4ba7545 100644 --- a/modules/nf-scil/registration/synthregistration/meta.yml +++ b/modules/nf-scil/registration/synthregistration/meta.yml @@ -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: @@ -48,7 +48,7 @@ output: - deform_transform: type: file description: Deform transformation - pattern: "*.{m3z}" + pattern: "*.{nii,.nii.gz}" - warped_image: type: file diff --git a/tests/config/nextflow.config b/tests/config/nextflow.config index 9da26413..95f3737f 100755 --- a/tests/config/nextflow.config +++ b/tests/config/nextflow.config @@ -5,8 +5,8 @@ params { } process { - cpus = 4 - memory = 5.GB + cpus = 16 + memory = 20.GB time = 2.h } diff --git a/tests/modules/nf-scil/registration/synthregistration/test.yml b/tests/modules/nf-scil/registration/synthregistration/test.yml index 49c0e31b..c9917296 100644 --- a/tests/modules/nf-scil/registration/synthregistration/test.yml +++ b/tests/modules/nf-scil/registration/synthregistration/test.yml @@ -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 From 5abd3ac070694e3afb1e15fbd3cad628cb49958d Mon Sep 17 00:00:00 2001 From: anroy1 Date: Sat, 20 Apr 2024 17:51:18 +0000 Subject: [PATCH 15/28] Swith transform format to freesurfer standard --- modules/nf-scil/registration/synthregistration/main.nf | 10 +++++----- .../nf-scil/registration/synthregistration/meta.yml | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/nf-scil/registration/synthregistration/main.nf b/modules/nf-scil/registration/synthregistration/main.nf index 5ceb177e..1131c301 100644 --- a/modules/nf-scil/registration/synthregistration/main.nf +++ b/modules/nf-scil/registration/synthregistration/main.nf @@ -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 @@ -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}": @@ -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}": diff --git a/modules/nf-scil/registration/synthregistration/meta.yml b/modules/nf-scil/registration/synthregistration/meta.yml index e4ba7545..d51d6208 100644 --- a/modules/nf-scil/registration/synthregistration/meta.yml +++ b/modules/nf-scil/registration/synthregistration/meta.yml @@ -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 @@ -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 From 385b0fe60d2bebc83dc687a863d7a8eee0a85ee1 Mon Sep 17 00:00:00 2001 From: anroy1 Date: Thu, 25 Apr 2024 19:25:39 +0000 Subject: [PATCH 16/28] run prettier --- modules/nf-scil/registration/synthregistration/meta.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/nf-scil/registration/synthregistration/meta.yml b/modules/nf-scil/registration/synthregistration/meta.yml index d51d6208..5d363197 100644 --- a/modules/nf-scil/registration/synthregistration/meta.yml +++ b/modules/nf-scil/registration/synthregistration/meta.yml @@ -10,7 +10,6 @@ tools: description: "Freesurfer Synthmorph" homepage: "https://martinos.org/malte/synthmorph/" - input: - meta: type: map From e4a816f57e443ff1c74e8f7b2b0daa48f48f8d1b Mon Sep 17 00:00:00 2001 From: anroy1 Date: Thu, 9 May 2024 18:16:20 +0000 Subject: [PATCH 17/28] Remove license as module do not require it and update parameters with newer version --- .../nf-scil/registration/synthregistration/main.nf | 13 +++++++------ .../nf-scil/registration/synthregistration/meta.yml | 5 ----- .../nf-scil/registration/synthregistration/main.nf | 3 +-- .../registration/synthregistration/nextflow.config | 8 ++++++++ .../nf-scil/registration/synthregistration/test.yml | 11 ++++++----- 5 files changed, 22 insertions(+), 18 deletions(-) diff --git a/modules/nf-scil/registration/synthregistration/main.nf b/modules/nf-scil/registration/synthregistration/main.nf index 1131c301..aec53edc 100644 --- a/modules/nf-scil/registration/synthregistration/main.nf +++ b/modules/nf-scil/registration/synthregistration/main.nf @@ -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: @@ -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 : "" @@ -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}": diff --git a/modules/nf-scil/registration/synthregistration/meta.yml b/modules/nf-scil/registration/synthregistration/meta.yml index 5d363197..9a3c2de1 100644 --- a/modules/nf-scil/registration/synthregistration/meta.yml +++ b/modules/nf-scil/registration/synthregistration/meta.yml @@ -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 diff --git a/tests/modules/nf-scil/registration/synthregistration/main.nf b/tests/modules/nf-scil/registration/synthregistration/main.nf index c45a7bd2..89f5d379 100644 --- a/tests/modules/nf-scil/registration/synthregistration/main.nf +++ b/tests/modules/nf-scil/registration/synthregistration/main.nf @@ -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") ]} diff --git a/tests/modules/nf-scil/registration/synthregistration/nextflow.config b/tests/modules/nf-scil/registration/synthregistration/nextflow.config index 8730f1c4..2a1c9275 100644 --- a/tests/modules/nf-scil/registration/synthregistration/nextflow.config +++ b/tests/modules/nf-scil/registration/synthregistration/nextflow.config @@ -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 + } + } diff --git a/tests/modules/nf-scil/registration/synthregistration/test.yml b/tests/modules/nf-scil/registration/synthregistration/test.yml index c9917296..e19c287b 100644 --- a/tests/modules/nf-scil/registration/synthregistration/test.yml +++ b/tests/modules/nf-scil/registration/synthregistration/test.yml @@ -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 From 985d5a9c3d287b34256b03f6ba24c71cae89c71d Mon Sep 17 00:00:00 2001 From: anroy1 Date: Tue, 14 May 2024 13:44:19 +0000 Subject: [PATCH 18/28] Switch transform output to fs .nii.gz format --- modules/nf-scil/registration/synthregistration/main.nf | 7 +++---- modules/nf-scil/registration/synthregistration/meta.yml | 2 +- .../nf-scil/registration/synthregistration/test.yml | 5 ++--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/modules/nf-scil/registration/synthregistration/main.nf b/modules/nf-scil/registration/synthregistration/main.nf index aec53edc..8d130b82 100644 --- a/modules/nf-scil/registration/synthregistration/main.nf +++ b/modules/nf-scil/registration/synthregistration/main.nf @@ -8,10 +8,9 @@ process REGISTRATION_SYNTHREGISTRATION { input: tuple val(meta), path(moving), path(fixed) - output: tuple val(meta), path("*__output_warped.nii.gz"), emit: warped_image - tuple val(meta), path("*__deform_warp.mgz"), 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 @@ -38,7 +37,7 @@ process REGISTRATION_SYNTHREGISTRATION { export OPENBLAS_NUM_THREADS=1 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 + mri_synthmorph ${warp} ${gpu} ${lambda} ${steps} ${extent} ${weight} -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}": @@ -54,7 +53,7 @@ process REGISTRATION_SYNTHREGISTRATION { mri_synthmorph -h touch ${prefix}__output_warped.nii.gz - touch ${prefix}__deform_warp.mgz + touch ${prefix}__deform_warp.nii.gz touch ${prefix}__init_warp.lta cat <<-END_VERSIONS > versions.yml diff --git a/modules/nf-scil/registration/synthregistration/meta.yml b/modules/nf-scil/registration/synthregistration/meta.yml index 9a3c2de1..5fe45c45 100644 --- a/modules/nf-scil/registration/synthregistration/meta.yml +++ b/modules/nf-scil/registration/synthregistration/meta.yml @@ -42,7 +42,7 @@ output: - deform_transform: type: file description: Deform transformation - pattern: "*.{mgz}" + pattern: "*.{nii.gz}" - warped_image: type: file diff --git a/tests/modules/nf-scil/registration/synthregistration/test.yml b/tests/modules/nf-scil/registration/synthregistration/test.yml index e19c287b..925c6bdb 100644 --- a/tests/modules/nf-scil/registration/synthregistration/test.yml +++ b/tests/modules/nf-scil/registration/synthregistration/test.yml @@ -4,9 +4,8 @@ - registration/synthregistration - registration files: - - 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__deform_warp.nii.gz + md5sum: d01c753043af2257908d049ade978981 - path: output/registration/test__init_warp.lta md5sum: 46ad5a5d359b2ec157d1164135e746eb - path: output/registration/test__output_warped.nii.gz From f642c8ee21e4950310d46dbf2e3f553715abcdf8 Mon Sep 17 00:00:00 2001 From: anroy1 Date: Sat, 1 Jun 2024 19:27:01 +0000 Subject: [PATCH 19/28] Migrate tests to nf-tests --- .../synthregistration/environment.yml | 7 +++ .../registration/synthregistration/meta.yml | 2 +- .../synthregistration/tests/main.nf.test | 50 +++++++++++++++++++ .../synthregistration/tests/main.nf.test.snap | 37 ++++++++++++++ .../synthregistration/tests/nextflow.config | 10 ++++ .../synthregistration/tests/tags.yml | 2 + 6 files changed, 107 insertions(+), 1 deletion(-) create mode 100644 modules/nf-scil/registration/synthregistration/environment.yml create mode 100644 modules/nf-scil/registration/synthregistration/tests/main.nf.test create mode 100644 modules/nf-scil/registration/synthregistration/tests/main.nf.test.snap create mode 100644 modules/nf-scil/registration/synthregistration/tests/nextflow.config create mode 100644 modules/nf-scil/registration/synthregistration/tests/tags.yml diff --git a/modules/nf-scil/registration/synthregistration/environment.yml b/modules/nf-scil/registration/synthregistration/environment.yml new file mode 100644 index 00000000..52b962fd --- /dev/null +++ b/modules/nf-scil/registration/synthregistration/environment.yml @@ -0,0 +1,7 @@ +--- +name: "registration_synthregistration" +channels: + - Docker + - Apptainer +dependencies: + - "Freesurfer:synthmorph" diff --git a/modules/nf-scil/registration/synthregistration/meta.yml b/modules/nf-scil/registration/synthregistration/meta.yml index 5fe45c45..580f04bb 100644 --- a/modules/nf-scil/registration/synthregistration/meta.yml +++ b/modules/nf-scil/registration/synthregistration/meta.yml @@ -55,4 +55,4 @@ output: pattern: "versions.yml" authors: - - "@scilus" + - "@anroy1" diff --git a/modules/nf-scil/registration/synthregistration/tests/main.nf.test b/modules/nf-scil/registration/synthregistration/tests/main.nf.test new file mode 100644 index 00000000..83148c72 --- /dev/null +++ b/modules/nf-scil/registration/synthregistration/tests/main.nf.test @@ -0,0 +1,50 @@ +// TODO nf-core: Once you have added the required tests, please run the following command to build this file: +// nf-core modules test registration/synthregistration +nextflow_process { + + name "Test Process REGISTRATION_SYNTHREGISTRATION" + script "../main.nf" + process "REGISTRATION_SYNTHREGISTRATION" + + tag "modules" + tag "modules_nfcore" + tag "registration" + tag "registration/synthregistration" + + 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( [ "freesurfer.zip" ] ) + input[1] = "test.load-test-data" + """ + } + } + } + + test("registration - synthregistration") { + config "./nextflow.config" + when { + process { + """ + input[0] = LOAD_DATA.out.test_data_directory + .map{ test_data_directory -> [ + [ id:'test', single_end:false ], + file("\${test_data_directory}/t1.nii.gz"), + file("\${test_data_directory}/fa.nii.gz") + ]} + """ + } + } + then { + assertAll( + { assert process.success }, + { assert snapshot(process.out).match() } + ) + } + } +} diff --git a/modules/nf-scil/registration/synthregistration/tests/main.nf.test.snap b/modules/nf-scil/registration/synthregistration/tests/main.nf.test.snap new file mode 100644 index 00000000..d31a7f52 --- /dev/null +++ b/modules/nf-scil/registration/synthregistration/tests/main.nf.test.snap @@ -0,0 +1,37 @@ +{ + "registration - synthregistration": { + "content": [ + { + "0": [ + + ], + "1": [ + + ], + "2": [ + + ], + "3": [ + + ], + "deform_transform": [ + + ], + "init_transform": [ + + ], + "versions": [ + + ], + "warped_image": [ + + ] + } + ], + "meta": { + "nf-test": "0.8.4", + "nextflow": "23.10.1" + }, + "timestamp": "2024-06-01T19:08:42.159111" + } +} \ No newline at end of file diff --git a/modules/nf-scil/registration/synthregistration/tests/nextflow.config b/modules/nf-scil/registration/synthregistration/tests/nextflow.config new file mode 100644 index 00000000..1b3a8fe6 --- /dev/null +++ b/modules/nf-scil/registration/synthregistration/tests/nextflow.config @@ -0,0 +1,10 @@ +process { + withName: "REGISTRATION_SYNTHREGISTRATION" { + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + ext.init = "affine" + ext.warp = "deform" + ext.threads = 1 + ext.lambda = 0.5 + ext.steps = 5 + } +} diff --git a/modules/nf-scil/registration/synthregistration/tests/tags.yml b/modules/nf-scil/registration/synthregistration/tests/tags.yml new file mode 100644 index 00000000..e29e4f02 --- /dev/null +++ b/modules/nf-scil/registration/synthregistration/tests/tags.yml @@ -0,0 +1,2 @@ +registration/synthregistration: + - "modules/nf-scil/registration/synthregistration/**" From e8407878fb90d5bb1872d819c47786753174c006 Mon Sep 17 00:00:00 2001 From: anroy1 Date: Wed, 5 Jun 2024 16:33:50 +0000 Subject: [PATCH 20/28] fix nf-tests --- .../synthregistration/tests/main.nf.test.snap | 54 +++++++++++++++---- tests/config/nf-test.config | 4 +- 2 files changed, 47 insertions(+), 11 deletions(-) diff --git a/modules/nf-scil/registration/synthregistration/tests/main.nf.test.snap b/modules/nf-scil/registration/synthregistration/tests/main.nf.test.snap index d31a7f52..1c0e4bbd 100644 --- a/modules/nf-scil/registration/synthregistration/tests/main.nf.test.snap +++ b/modules/nf-scil/registration/synthregistration/tests/main.nf.test.snap @@ -3,28 +3,64 @@ "content": [ { "0": [ - + [ + { + "id": "test", + "single_end": false + }, + "test__output_warped.nii.gz:md5,972f5f538b606379b77b2e1cb92a37ca" + ] ], "1": [ - + [ + { + "id": "test", + "single_end": false + }, + "test__deform_warp.nii.gz:md5,eea6ef9b84915d3475f21b5d2c5ef49d" + ] ], "2": [ - + [ + { + "id": "test", + "single_end": false + }, + "test__init_warp.lta:md5,46ad5a5d359b2ec157d1164135e746eb" + ] ], "3": [ - + "versions.yml:md5,49fb9c85da9f696926d1ab46ef0968fb" ], "deform_transform": [ - + [ + { + "id": "test", + "single_end": false + }, + "test__deform_warp.nii.gz:md5,eea6ef9b84915d3475f21b5d2c5ef49d" + ] ], "init_transform": [ - + [ + { + "id": "test", + "single_end": false + }, + "test__init_warp.lta:md5,46ad5a5d359b2ec157d1164135e746eb" + ] ], "versions": [ - + "versions.yml:md5,49fb9c85da9f696926d1ab46ef0968fb" ], "warped_image": [ - + [ + { + "id": "test", + "single_end": false + }, + "test__output_warped.nii.gz:md5,972f5f538b606379b77b2e1cb92a37ca" + ] ] } ], @@ -32,6 +68,6 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-06-01T19:08:42.159111" + "timestamp": "2024-06-05T16:31:01.589627" } } \ No newline at end of file diff --git a/tests/config/nf-test.config b/tests/config/nf-test.config index 3d7ee2c5..b45a5858 100644 --- a/tests/config/nf-test.config +++ b/tests/config/nf-test.config @@ -5,8 +5,8 @@ params { } process { - cpus = 4 - memory = 5.GB + cpus = 16 + memory = 20.GB time = 2.h } From 0154dccab3748bdf90723a0ffcbca81e27a0f254 Mon Sep 17 00:00:00 2001 From: anroy1 Date: Wed, 5 Jun 2024 16:37:50 +0000 Subject: [PATCH 21/28] Remove pytests --- tests/config/pytest_modules.yml | 3 --- .../registration/synthregistration/main.nf | 23 ------------------- .../synthregistration/nextflow.config | 13 ----------- .../registration/synthregistration/test.yml | 22 ------------------ 4 files changed, 61 deletions(-) delete mode 100644 tests/modules/nf-scil/registration/synthregistration/main.nf delete mode 100644 tests/modules/nf-scil/registration/synthregistration/nextflow.config delete mode 100644 tests/modules/nf-scil/registration/synthregistration/test.yml diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 8fb708a6..e69de29b 100755 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -1,3 +0,0 @@ -registration/synthregistration: - - modules/nf-scil/registration/synthregistration/** - - tests/modules/nf-scil/registration/synthregistration/** diff --git a/tests/modules/nf-scil/registration/synthregistration/main.nf b/tests/modules/nf-scil/registration/synthregistration/main.nf deleted file mode 100644 index 89f5d379..00000000 --- a/tests/modules/nf-scil/registration/synthregistration/main.nf +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env nextflow - -nextflow.enable.dsl = 2 - -include { LOAD_TEST_DATA } from '../../../../../subworkflows/nf-scil/load_test_data/main' -include { REGISTRATION_SYNTHREGISTRATION } from '../../../../../modules/nf-scil/registration/synthregistration/main.nf' - -workflow test_registration_synthregistration { - - input_fetch = Channel.from( [ "freesurfer.zip" ] ) - - LOAD_TEST_DATA ( input_fetch, "test.load-test-data" ) - - input = LOAD_TEST_DATA.out.test_data_directory - .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") - - ]} - - REGISTRATION_SYNTHREGISTRATION ( input ) -} diff --git a/tests/modules/nf-scil/registration/synthregistration/nextflow.config b/tests/modules/nf-scil/registration/synthregistration/nextflow.config deleted file mode 100644 index 2a1c9275..00000000 --- a/tests/modules/nf-scil/registration/synthregistration/nextflow.config +++ /dev/null @@ -1,13 +0,0 @@ -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 - } - -} diff --git a/tests/modules/nf-scil/registration/synthregistration/test.yml b/tests/modules/nf-scil/registration/synthregistration/test.yml deleted file mode 100644 index 925c6bdb..00000000 --- a/tests/modules/nf-scil/registration/synthregistration/test.yml +++ /dev/null @@ -1,22 +0,0 @@ -- 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/synthregistration - - registration - files: - - path: output/registration/test__deform_warp.nii.gz - md5sum: d01c753043af2257908d049ade978981 - - path: output/registration/test__init_warp.lta - md5sum: 46ad5a5d359b2ec157d1164135e746eb - - path: output/registration/test__output_warped.nii.gz - md5sum: bdc4ff1557093fd25a760e4db48d7d58 - - 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 From 3969605476fd1fe126e812ab06be873d6a2c3219 Mon Sep 17 00:00:00 2001 From: anroy1 Date: Wed, 5 Jun 2024 18:01:27 +0000 Subject: [PATCH 22/28] Run prettier --- .../nf-scil/registration/synthregistration/tests/main.nf.test | 2 -- tests/config/pytest_modules.yml | 0 2 files changed, 2 deletions(-) delete mode 100755 tests/config/pytest_modules.yml diff --git a/modules/nf-scil/registration/synthregistration/tests/main.nf.test b/modules/nf-scil/registration/synthregistration/tests/main.nf.test index 83148c72..8cbc4853 100644 --- a/modules/nf-scil/registration/synthregistration/tests/main.nf.test +++ b/modules/nf-scil/registration/synthregistration/tests/main.nf.test @@ -1,5 +1,3 @@ -// TODO nf-core: Once you have added the required tests, please run the following command to build this file: -// nf-core modules test registration/synthregistration nextflow_process { name "Test Process REGISTRATION_SYNTHREGISTRATION" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml deleted file mode 100755 index e69de29b..00000000 From 6b075e89029f122e3b07681df235047d0205294e Mon Sep 17 00:00:00 2001 From: anroy1 Date: Wed, 5 Jun 2024 18:46:48 +0000 Subject: [PATCH 23/28] Modify tests config for remote tests --- .../synthregistration/tests/main.nf.test.snap | 10 +++++----- .../synthregistration/tests/nextflow.config | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/nf-scil/registration/synthregistration/tests/main.nf.test.snap b/modules/nf-scil/registration/synthregistration/tests/main.nf.test.snap index 1c0e4bbd..d44892c0 100644 --- a/modules/nf-scil/registration/synthregistration/tests/main.nf.test.snap +++ b/modules/nf-scil/registration/synthregistration/tests/main.nf.test.snap @@ -8,7 +8,7 @@ "id": "test", "single_end": false }, - "test__output_warped.nii.gz:md5,972f5f538b606379b77b2e1cb92a37ca" + "test__output_warped.nii.gz:md5,28f54b497cda513feb86b07b0b28ac1d" ] ], "1": [ @@ -17,7 +17,7 @@ "id": "test", "single_end": false }, - "test__deform_warp.nii.gz:md5,eea6ef9b84915d3475f21b5d2c5ef49d" + "test__deform_warp.nii.gz:md5,3cf3d49bc202410b8e6ef64ee394ad84" ] ], "2": [ @@ -38,7 +38,7 @@ "id": "test", "single_end": false }, - "test__deform_warp.nii.gz:md5,eea6ef9b84915d3475f21b5d2c5ef49d" + "test__deform_warp.nii.gz:md5,3cf3d49bc202410b8e6ef64ee394ad84" ] ], "init_transform": [ @@ -59,7 +59,7 @@ "id": "test", "single_end": false }, - "test__output_warped.nii.gz:md5,972f5f538b606379b77b2e1cb92a37ca" + "test__output_warped.nii.gz:md5,28f54b497cda513feb86b07b0b28ac1d" ] ] } @@ -68,6 +68,6 @@ "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-06-05T16:31:01.589627" + "timestamp": "2024-06-05T18:41:40.417146" } } \ No newline at end of file diff --git a/modules/nf-scil/registration/synthregistration/tests/nextflow.config b/modules/nf-scil/registration/synthregistration/tests/nextflow.config index 1b3a8fe6..285352a7 100644 --- a/modules/nf-scil/registration/synthregistration/tests/nextflow.config +++ b/modules/nf-scil/registration/synthregistration/tests/nextflow.config @@ -4,7 +4,7 @@ process { ext.init = "affine" ext.warp = "deform" ext.threads = 1 - ext.lambda = 0.5 - ext.steps = 5 + ext.lambda = 0.9 + ext.steps = 9 } } From 7ad4e6af1b9f93cfbefdc96d6c95e800a1c9bff3 Mon Sep 17 00:00:00 2001 From: anroy1 Date: Wed, 5 Jun 2024 21:03:35 +0000 Subject: [PATCH 24/28] Fix test assertion for name only --- .../synthregistration/tests/main.nf.test | 6 +- .../synthregistration/tests/main.nf.test.snap | 67 ++----------------- 2 files changed, 9 insertions(+), 64 deletions(-) diff --git a/modules/nf-scil/registration/synthregistration/tests/main.nf.test b/modules/nf-scil/registration/synthregistration/tests/main.nf.test index 8cbc4853..f4753a05 100644 --- a/modules/nf-scil/registration/synthregistration/tests/main.nf.test +++ b/modules/nf-scil/registration/synthregistration/tests/main.nf.test @@ -41,7 +41,11 @@ nextflow_process { then { assertAll( { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + file(process.out.warped_image.get(0).get(1)).name, + file(process.out.deform_transform.get(0).get(1)).name, + file(process.out.init_transform.get(0).get(1)).name + ).match() } ) } } diff --git a/modules/nf-scil/registration/synthregistration/tests/main.nf.test.snap b/modules/nf-scil/registration/synthregistration/tests/main.nf.test.snap index d44892c0..71f19060 100644 --- a/modules/nf-scil/registration/synthregistration/tests/main.nf.test.snap +++ b/modules/nf-scil/registration/synthregistration/tests/main.nf.test.snap @@ -1,73 +1,14 @@ { "registration - synthregistration": { "content": [ - { - "0": [ - [ - { - "id": "test", - "single_end": false - }, - "test__output_warped.nii.gz:md5,28f54b497cda513feb86b07b0b28ac1d" - ] - ], - "1": [ - [ - { - "id": "test", - "single_end": false - }, - "test__deform_warp.nii.gz:md5,3cf3d49bc202410b8e6ef64ee394ad84" - ] - ], - "2": [ - [ - { - "id": "test", - "single_end": false - }, - "test__init_warp.lta:md5,46ad5a5d359b2ec157d1164135e746eb" - ] - ], - "3": [ - "versions.yml:md5,49fb9c85da9f696926d1ab46ef0968fb" - ], - "deform_transform": [ - [ - { - "id": "test", - "single_end": false - }, - "test__deform_warp.nii.gz:md5,3cf3d49bc202410b8e6ef64ee394ad84" - ] - ], - "init_transform": [ - [ - { - "id": "test", - "single_end": false - }, - "test__init_warp.lta:md5,46ad5a5d359b2ec157d1164135e746eb" - ] - ], - "versions": [ - "versions.yml:md5,49fb9c85da9f696926d1ab46ef0968fb" - ], - "warped_image": [ - [ - { - "id": "test", - "single_end": false - }, - "test__output_warped.nii.gz:md5,28f54b497cda513feb86b07b0b28ac1d" - ] - ] - } + "test__output_warped.nii.gz", + "test__deform_warp.nii.gz", + "test__init_warp.lta" ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-06-05T18:41:40.417146" + "timestamp": "2024-06-05T19:55:15.170324" } } \ No newline at end of file From a4f0778db2e6a704e323b26561fe69850c5aca28 Mon Sep 17 00:00:00 2001 From: anroy1 Date: Thu, 6 Jun 2024 13:04:40 +0000 Subject: [PATCH 25/28] Rerun tests and fix linting --- .../registration/synthregistration/tests/main.nf.test | 3 ++- .../registration/synthregistration/tests/main.nf.test.snap | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/nf-scil/registration/synthregistration/tests/main.nf.test b/modules/nf-scil/registration/synthregistration/tests/main.nf.test index f4753a05..67f9cdfc 100644 --- a/modules/nf-scil/registration/synthregistration/tests/main.nf.test +++ b/modules/nf-scil/registration/synthregistration/tests/main.nf.test @@ -44,7 +44,8 @@ nextflow_process { { assert snapshot( file(process.out.warped_image.get(0).get(1)).name, file(process.out.deform_transform.get(0).get(1)).name, - file(process.out.init_transform.get(0).get(1)).name + file(process.out.init_transform.get(0).get(1)).name, + process.out.versions ).match() } ) } diff --git a/modules/nf-scil/registration/synthregistration/tests/main.nf.test.snap b/modules/nf-scil/registration/synthregistration/tests/main.nf.test.snap index 71f19060..0cd56115 100644 --- a/modules/nf-scil/registration/synthregistration/tests/main.nf.test.snap +++ b/modules/nf-scil/registration/synthregistration/tests/main.nf.test.snap @@ -3,12 +3,15 @@ "content": [ "test__output_warped.nii.gz", "test__deform_warp.nii.gz", - "test__init_warp.lta" + "test__init_warp.lta", + [ + "versions.yml:md5,49fb9c85da9f696926d1ab46ef0968fb" + ] ], "meta": { "nf-test": "0.8.4", "nextflow": "23.10.1" }, - "timestamp": "2024-06-05T19:55:15.170324" + "timestamp": "2024-06-06T13:03:51.883573" } } \ No newline at end of file From a7c45def010bb90560b82395dccb4b65e915a5c0 Mon Sep 17 00:00:00 2001 From: anroy1 Date: Tue, 11 Jun 2024 19:13:44 +0000 Subject: [PATCH 26/28] adjust process parameters for tests locally --- .../registration/synthregistration/tests/nextflow.config | 1 + tests/config/nextflow.config | 4 ++-- tests/config/nf-test.config | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/nf-scil/registration/synthregistration/tests/nextflow.config b/modules/nf-scil/registration/synthregistration/tests/nextflow.config index 285352a7..41fae205 100644 --- a/modules/nf-scil/registration/synthregistration/tests/nextflow.config +++ b/modules/nf-scil/registration/synthregistration/tests/nextflow.config @@ -1,6 +1,7 @@ process { withName: "REGISTRATION_SYNTHREGISTRATION" { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + memory = 20 ext.init = "affine" ext.warp = "deform" ext.threads = 1 diff --git a/tests/config/nextflow.config b/tests/config/nextflow.config index 95f3737f..9da26413 100755 --- a/tests/config/nextflow.config +++ b/tests/config/nextflow.config @@ -5,8 +5,8 @@ params { } process { - cpus = 16 - memory = 20.GB + cpus = 4 + memory = 5.GB time = 2.h } diff --git a/tests/config/nf-test.config b/tests/config/nf-test.config index b45a5858..3d7ee2c5 100644 --- a/tests/config/nf-test.config +++ b/tests/config/nf-test.config @@ -5,8 +5,8 @@ params { } process { - cpus = 16 - memory = 20.GB + cpus = 4 + memory = 5.GB time = 2.h } From 6570e2e84845aad95b683f4ea5c10fc7a570b895 Mon Sep 17 00:00:00 2001 From: anroy1 Date: Thu, 13 Jun 2024 21:08:47 +0000 Subject: [PATCH 27/28] [wip] fix alex comments 1/2 --- modules/nf-scil/registration/synthregistration/meta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-scil/registration/synthregistration/meta.yml b/modules/nf-scil/registration/synthregistration/meta.yml index 580f04bb..c603a503 100644 --- a/modules/nf-scil/registration/synthregistration/meta.yml +++ b/modules/nf-scil/registration/synthregistration/meta.yml @@ -37,7 +37,7 @@ output: - init_transform: type: file description: Affine transform for initialization - pattern: "*.{txt}" + pattern: "*.{lta}" - deform_transform: type: file From b802440080c75f152b1384d7dcb6604303ec304a Mon Sep 17 00:00:00 2001 From: anroy1 Date: Fri, 14 Jun 2024 16:18:45 +0000 Subject: [PATCH 28/28] Add precisions regarding convertion on meta.yml --- modules/nf-scil/registration/synthregistration/meta.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/nf-scil/registration/synthregistration/meta.yml b/modules/nf-scil/registration/synthregistration/meta.yml index c603a503..6cbb5563 100644 --- a/modules/nf-scil/registration/synthregistration/meta.yml +++ b/modules/nf-scil/registration/synthregistration/meta.yml @@ -1,6 +1,6 @@ --- name: "registration_synthregistration" -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. +description: Perform registration using SynthMorph from Freesurfer. Outputs transforms in Freesurfer format .lta for affine and .nii.gz (synthmorph also supports .mgz) for deform, both in RAS orientation, which can be converted for ANTs with respectively lta_convert and mri_warp_convert, which support a wide range of conversion formats and orientations. Conversion can be processed using the registration/convert module which can be used successively to this one. keywords: - registration - Brain imaging