diff --git a/modules/nf-neuro/betcrop/cropvolume/tests/tags.yml b/modules/nf-neuro/betcrop/cropvolume/tests/tags.yml deleted file mode 100644 index d6802302..00000000 --- a/modules/nf-neuro/betcrop/cropvolume/tests/tags.yml +++ /dev/null @@ -1,2 +0,0 @@ -betcrop/cropvolume: - - "modules/nf-neuro/betcrop/cropvolume/**" diff --git a/modules/nf-neuro/betcrop/cropvolume/environment.yml b/modules/nf-neuro/image/cropvolume/environment.yml similarity index 54% rename from modules/nf-neuro/betcrop/cropvolume/environment.yml rename to modules/nf-neuro/image/cropvolume/environment.yml index 3adeaf1e..670802a8 100644 --- a/modules/nf-neuro/betcrop/cropvolume/environment.yml +++ b/modules/nf-neuro/image/cropvolume/environment.yml @@ -1,3 +1,3 @@ channels: [] dependencies: [] -name: betcrop_cropvolume +name: image_cropvolume diff --git a/modules/nf-neuro/betcrop/cropvolume/main.nf b/modules/nf-neuro/image/cropvolume/main.nf similarity index 98% rename from modules/nf-neuro/betcrop/cropvolume/main.nf rename to modules/nf-neuro/image/cropvolume/main.nf index e8f47015..08c5d388 100755 --- a/modules/nf-neuro/betcrop/cropvolume/main.nf +++ b/modules/nf-neuro/image/cropvolume/main.nf @@ -1,5 +1,5 @@ -process BETCROP_CROPVOLUME { +process IMAGE_CROPVOLUME { tag "$meta.id" label 'process_single' diff --git a/modules/nf-neuro/betcrop/cropvolume/meta.yml b/modules/nf-neuro/image/cropvolume/meta.yml similarity index 97% rename from modules/nf-neuro/betcrop/cropvolume/meta.yml rename to modules/nf-neuro/image/cropvolume/meta.yml index e981e340..df13e950 100755 --- a/modules/nf-neuro/betcrop/cropvolume/meta.yml +++ b/modules/nf-neuro/image/cropvolume/meta.yml @@ -1,6 +1,6 @@ --- # yaml-language-server: $schema=https://raw.githubusercontent.com/scilus/nf-neuro/main/modules/meta-schema.json -name: "betcrop_cropvolume" +name: "image_cropvolume" description: Crop empty planes around the data in a volume keywords: - nifti diff --git a/modules/nf-neuro/betcrop/cropvolume/tests/main.nf.test b/modules/nf-neuro/image/cropvolume/tests/main.nf.test similarity index 89% rename from modules/nf-neuro/betcrop/cropvolume/tests/main.nf.test rename to modules/nf-neuro/image/cropvolume/tests/main.nf.test index 06333238..af2c9486 100644 --- a/modules/nf-neuro/betcrop/cropvolume/tests/main.nf.test +++ b/modules/nf-neuro/image/cropvolume/tests/main.nf.test @@ -1,14 +1,14 @@ nextflow_process { - name "Test Process BETCROP_CROPVOLUME" + name "Test Process IMAGE_CROPVOLUME" script "../main.nf" - process "BETCROP_CROPVOLUME" + process "IMAGE_CROPVOLUME" config "./nextflow.config" tag "modules" tag "modules_nfcore" - tag "betcrop" - tag "betcrop/cropvolume" + tag "image" + tag "image/cropvolume" tag "subworkflows" tag "subworkflows/load_test_data" @@ -25,7 +25,7 @@ nextflow_process { } } - test("betcrop - cropvolume") { + test("image - cropvolume") { when { process { @@ -50,7 +50,7 @@ nextflow_process { } - test("betcrop - cropvolume - outputbbox") { + test("image - cropvolume - outputbbox") { config "./nextflow_bbox.config" diff --git a/modules/nf-neuro/betcrop/cropvolume/tests/main.nf.test.snap b/modules/nf-neuro/image/cropvolume/tests/main.nf.test.snap similarity index 82% rename from modules/nf-neuro/betcrop/cropvolume/tests/main.nf.test.snap rename to modules/nf-neuro/image/cropvolume/tests/main.nf.test.snap index ec0dfa70..b7c47661 100644 --- a/modules/nf-neuro/betcrop/cropvolume/tests/main.nf.test.snap +++ b/modules/nf-neuro/image/cropvolume/tests/main.nf.test.snap @@ -1,5 +1,5 @@ { - "betcrop - cropvolume - outputbbox": { + "image - cropvolume": { "content": [ { "0": [ @@ -12,25 +12,13 @@ ] ], "1": [ - [ - { - "id": "test", - "single_end": false - }, - "test_cropped_bbox.pkl:md5,d6a03b61669b07683e8c4b21a613f16c" - ] + ], "2": [ - "versions.yml:md5,3b089d55a1116feffa69d739ced1d99f" + "versions.yml:md5,c9f9039fc9103e716e831016a61807f9" ], "bounding_box": [ - [ - { - "id": "test", - "single_end": false - }, - "test_cropped_bbox.pkl:md5,d6a03b61669b07683e8c4b21a613f16c" - ] + ], "image": [ [ @@ -42,17 +30,17 @@ ] ], "versions": [ - "versions.yml:md5,3b089d55a1116feffa69d739ced1d99f" + "versions.yml:md5,c9f9039fc9103e716e831016a61807f9" ] } ], "meta": { "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nextflow": "24.10.0" }, - "timestamp": "2024-10-28T19:30:09.320626173" + "timestamp": "2024-12-12T18:59:41.317523464" }, - "betcrop - cropvolume": { + "image - cropvolume - outputbbox": { "content": [ { "0": [ @@ -65,13 +53,25 @@ ] ], "1": [ - + [ + { + "id": "test", + "single_end": false + }, + "test_cropped_bbox.pkl:md5,d6a03b61669b07683e8c4b21a613f16c" + ] ], "2": [ - "versions.yml:md5,3b089d55a1116feffa69d739ced1d99f" + "versions.yml:md5,c9f9039fc9103e716e831016a61807f9" ], "bounding_box": [ - + [ + { + "id": "test", + "single_end": false + }, + "test_cropped_bbox.pkl:md5,d6a03b61669b07683e8c4b21a613f16c" + ] ], "image": [ [ @@ -83,14 +83,14 @@ ] ], "versions": [ - "versions.yml:md5,3b089d55a1116feffa69d739ced1d99f" + "versions.yml:md5,c9f9039fc9103e716e831016a61807f9" ] } ], "meta": { "nf-test": "0.9.0", - "nextflow": "24.04.4" + "nextflow": "24.10.0" }, - "timestamp": "2024-10-28T19:30:00.033087617" + "timestamp": "2024-12-12T18:59:50.080977383" } } \ No newline at end of file diff --git a/modules/nf-neuro/betcrop/cropvolume/tests/nextflow.config b/modules/nf-neuro/image/cropvolume/tests/nextflow.config similarity index 77% rename from modules/nf-neuro/betcrop/cropvolume/tests/nextflow.config rename to modules/nf-neuro/image/cropvolume/tests/nextflow.config index 7a7632ff..3a9e735d 100644 --- a/modules/nf-neuro/betcrop/cropvolume/tests/nextflow.config +++ b/modules/nf-neuro/image/cropvolume/tests/nextflow.config @@ -1,5 +1,5 @@ process { - withName: "BETCROP_CROPVOLUME" { + withName: "IMAGE_CROPVOLUME" { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } } } diff --git a/modules/nf-neuro/betcrop/cropvolume/tests/nextflow_bbox.config b/modules/nf-neuro/image/cropvolume/tests/nextflow_bbox.config similarity index 81% rename from modules/nf-neuro/betcrop/cropvolume/tests/nextflow_bbox.config rename to modules/nf-neuro/image/cropvolume/tests/nextflow_bbox.config index c998553c..6055585a 100644 --- a/modules/nf-neuro/betcrop/cropvolume/tests/nextflow_bbox.config +++ b/modules/nf-neuro/image/cropvolume/tests/nextflow_bbox.config @@ -1,5 +1,5 @@ process { - withName: "BETCROP_CROPVOLUME" { + withName: "IMAGE_CROPVOLUME" { ext.output_bbox = true publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } } diff --git a/modules/nf-neuro/image/cropvolume/tests/tags.yml b/modules/nf-neuro/image/cropvolume/tests/tags.yml new file mode 100644 index 00000000..eeae1b2c --- /dev/null +++ b/modules/nf-neuro/image/cropvolume/tests/tags.yml @@ -0,0 +1,2 @@ +image/cropvolume: + - "modules/nf-neuro/image/cropvolume/**" diff --git a/subworkflows/nf-neuro/preproc_dwi/main.nf b/subworkflows/nf-neuro/preproc_dwi/main.nf index f16e2a36..c2ee7348 100644 --- a/subworkflows/nf-neuro/preproc_dwi/main.nf +++ b/subworkflows/nf-neuro/preproc_dwi/main.nf @@ -1,7 +1,7 @@ include { DENOISING_MPPCA as DENOISE_DWI } from '../../../modules/nf-neuro/denoising/mppca/main' include { DENOISING_MPPCA as DENOISE_REVDWI } from '../../../modules/nf-neuro/denoising/mppca/main' include { BETCROP_FSLBETCROP } from '../../../modules/nf-neuro/betcrop/fslbetcrop/main' -include { BETCROP_CROPVOLUME } from '../../../modules/nf-neuro/betcrop/cropvolume/main' +include { IMAGE_CROPVOLUME } from '../../../modules/nf-neuro/image/cropvolume/main' include { PREPROC_N4 as N4_DWI } from '../../../modules/nf-neuro/preproc/n4/main' include { PREPROC_NORMALIZE as NORMALIZE_DWI } from '../../../modules/nf-neuro/preproc/normalize/main' include { IMAGE_RESAMPLE as RESAMPLE_DWI } from '../../../modules/nf-neuro/image/resample/main' @@ -78,12 +78,12 @@ workflow PREPROC_DWI { ch_crop_b0 = TOPUP_EDDY.out.b0 .join(BETCROP_FSLBETCROP.out.bbox) - BETCROP_CROPVOLUME ( ch_crop_b0 ) - ch_versions = ch_versions.mix(BETCROP_CROPVOLUME.out.versions.first()) + IMAGE_CROPVOLUME ( ch_crop_b0 ) + ch_versions = ch_versions.mix(IMAGE_CROPVOLUME.out.versions.first()) // ** N4 DWI ** // ch_N4 = BETCROP_FSLBETCROP.out.image - .join(BETCROP_CROPVOLUME.out.image) + .join(IMAGE_CROPVOLUME.out.image) .join(BETCROP_FSLBETCROP.out.mask) N4_DWI ( ch_N4 ) diff --git a/subworkflows/nf-neuro/preproc_dwi/meta.yml b/subworkflows/nf-neuro/preproc_dwi/meta.yml index 705b64e9..6cd12eae 100644 --- a/subworkflows/nf-neuro/preproc_dwi/meta.yml +++ b/subworkflows/nf-neuro/preproc_dwi/meta.yml @@ -45,7 +45,7 @@ keywords: - Normalization - Resampling components: - - betcrop/cropvolume + - image/cropvolume - betcrop/fslbetcrop - denoising/mppca - image/resample diff --git a/subworkflows/nf-neuro/preproc_dwi/tests/main.nf.test b/subworkflows/nf-neuro/preproc_dwi/tests/main.nf.test index 9f8693b3..b3dbc324 100644 --- a/subworkflows/nf-neuro/preproc_dwi/tests/main.nf.test +++ b/subworkflows/nf-neuro/preproc_dwi/tests/main.nf.test @@ -9,7 +9,7 @@ nextflow_workflow { tag "subworkflows_nfcore" tag "subworkflows/preproc_dwi" tag "subworkflows/topup_eddy" - tag "betcrop/cropvolume" + tag "image/cropvolume" tag "betcrop/fslbetcrop" tag "denoising/mppca" tag "image/resample" diff --git a/subworkflows/nf-neuro/preproc_dwi/tests/nextflow.config b/subworkflows/nf-neuro/preproc_dwi/tests/nextflow.config index 4bf578f2..95e0160a 100644 --- a/subworkflows/nf-neuro/preproc_dwi/tests/nextflow.config +++ b/subworkflows/nf-neuro/preproc_dwi/tests/nextflow.config @@ -41,7 +41,7 @@ process { ext.voxel_size = 1 ext.interp = "lin" } - withName: "BETCROP_CROPVOLUME" { + withName: "IMAGE_CROPVOLUME" { ext.output_bbox = false } diff --git a/subworkflows/nf-neuro/preproc_t1/main.nf b/subworkflows/nf-neuro/preproc_t1/main.nf index b923495e..27b51347 100644 --- a/subworkflows/nf-neuro/preproc_t1/main.nf +++ b/subworkflows/nf-neuro/preproc_t1/main.nf @@ -4,8 +4,8 @@ include { PREPROC_N4 } from '../../../modules/nf-neuro/preproc/n4/main' include { IMAGE_RESAMPLE } from '../../../modules/nf-neuro/image/resample/main' include { BETCROP_ANTSBET } from '../../../modules/nf-neuro/betcrop/antsbet/main' include { BETCROP_SYNTHBET} from '../../../modules/nf-neuro/betcrop/synthbet/main' -include { BETCROP_CROPVOLUME as BETCROP_CROPVOLUME_T1 } from '../../../modules/nf-neuro/betcrop/cropvolume/main' -include { BETCROP_CROPVOLUME as BETCROP_CROPVOLUME_MASK } from '../../../modules/nf-neuro/betcrop/cropvolume/main' +include { IMAGE_CROPVOLUME as IMAGE_CROPVOLUME_T1 } from '../../../modules/nf-neuro/image/cropvolume/main' +include { IMAGE_CROPVOLUME as IMAGE_CROPVOLUME_MASK } from '../../../modules/nf-neuro/image/cropvolume/main' params.run_synthbet = false @@ -104,24 +104,24 @@ workflow PREPROC_T1 { ch_crop = image_bet .map{ it + [[]] } - BETCROP_CROPVOLUME_T1 ( ch_crop ) - ch_versions = ch_versions.mix(BETCROP_CROPVOLUME_T1.out.versions.first()) + IMAGE_CROPVOLUME_T1 ( ch_crop ) + ch_versions = ch_versions.mix(IMAGE_CROPVOLUME_T1.out.versions.first()) // ** Crop mask ** // ch_crop_mask = mask_bet - .join(BETCROP_CROPVOLUME_T1.out.bounding_box) + .join(IMAGE_CROPVOLUME_T1.out.bounding_box) - BETCROP_CROPVOLUME_MASK ( ch_crop_mask ) - ch_versions = ch_versions.mix(BETCROP_CROPVOLUME_MASK.out.versions.first()) + IMAGE_CROPVOLUME_MASK ( ch_crop_mask ) + ch_versions = ch_versions.mix(IMAGE_CROPVOLUME_MASK.out.versions.first()) emit: - t1_final = BETCROP_CROPVOLUME_T1.out.image // channel: [ val(meta), t1-preprocessed ] - mask_final = BETCROP_CROPVOLUME_MASK.out.image // channel: [ val(meta), t1-mask ] + t1_final = IMAGE_CROPVOLUME_T1.out.image // channel: [ val(meta), t1-preprocessed ] + mask_final = IMAGE_CROPVOLUME_MASK.out.image // channel: [ val(meta), t1-mask ] image_nlmeans = DENOISING_NLMEANS.out.image // channel: [ val(meta), t1-after-denoise ] image_N4 = PREPROC_N4.out.image // channel: [ val(meta), t1-after-unbias ] image_resample = IMAGE_RESAMPLE.out.image // channel: [ val(meta), t1-after-resample ] image_bet = image_bet // channel: [ val(meta), t1-after-bet ] mask_bet = mask_bet // channel: [ val(meta), intermediary-mask ] - crop_box = BETCROP_CROPVOLUME_T1.out.bounding_box // channel: [ val(meta), bounding-box ] + crop_box = IMAGE_CROPVOLUME_T1.out.bounding_box // channel: [ val(meta), bounding-box ] versions = ch_versions // channel: [ versions.yml ] } diff --git a/subworkflows/nf-neuro/preproc_t1/meta.yml b/subworkflows/nf-neuro/preproc_t1/meta.yml index c06f6f1f..e736187d 100644 --- a/subworkflows/nf-neuro/preproc_t1/meta.yml +++ b/subworkflows/nf-neuro/preproc_t1/meta.yml @@ -45,7 +45,7 @@ components: - image/resample - betcrop/antsbet - betcrop/synthbet - - betcrop/cropvolume + - image/cropvolume input: - ch_image: diff --git a/subworkflows/nf-neuro/preproc_t1/tests/main.nf.test b/subworkflows/nf-neuro/preproc_t1/tests/main.nf.test index 44744117..d5701712 100644 --- a/subworkflows/nf-neuro/preproc_t1/tests/main.nf.test +++ b/subworkflows/nf-neuro/preproc_t1/tests/main.nf.test @@ -13,7 +13,7 @@ nextflow_workflow { tag "image/resample" tag "betcrop/antsbet" tag "betcrop/synthbet" - tag "betcrop/cropvolume" + tag "image/cropvolume" tag "load_test_data" diff --git a/subworkflows/nf-neuro/preproc_t1/tests/nextflow.config b/subworkflows/nf-neuro/preproc_t1/tests/nextflow.config index 0cf9bdfd..cd10f79e 100644 --- a/subworkflows/nf-neuro/preproc_t1/tests/nextflow.config +++ b/subworkflows/nf-neuro/preproc_t1/tests/nextflow.config @@ -4,7 +4,7 @@ process { ext.voxel_size = 1 ext.interp = "lin" } - withName: "BETCROP_CROPVOLUME_T1" { + withName: "IMAGE_CROPVOLUME_T1" { ext.output_bbox = true ext.first_suffix = "t1" } diff --git a/subworkflows/nf-neuro/preproc_t1/tests/nextflow_synthbet.config b/subworkflows/nf-neuro/preproc_t1/tests/nextflow_synthbet.config index ce65c778..081d4805 100644 --- a/subworkflows/nf-neuro/preproc_t1/tests/nextflow_synthbet.config +++ b/subworkflows/nf-neuro/preproc_t1/tests/nextflow_synthbet.config @@ -4,7 +4,7 @@ process { ext.voxel_size = 1 ext.interp = "lin" } - withName: "BETCROP_CROPVOLUME_T1" { + withName: "IMAGE_CROPVOLUME_T1" { ext.output_bbox = true ext.first_suffix = "t1" }