Skip to content

Commit

Permalink
Add support for lesions in anatomical segmentation workflow. still ne…
Browse files Browse the repository at this point in the history
…ed testing
  • Loading branch information
AlexVCaron committed Jul 23, 2024
1 parent f8c9431 commit 34de196
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions subworkflows/nf-scil/anatomical_segmentation/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,21 @@ workflow ANATOMICAL_SEGMENTATION {
// ** different image files. Supplying an empty channel for the one that isn't ** //
// ** relevant will make the workflow run the appropriate module. ** //
take:
ch_image // channel: [ val(meta), [ image ] ]
ch_freesurferseg // channel: [ val(meta), [ aparc_aseg, wmparc ] ]
ch_image // channel: [ val(meta), image ], optional
ch_freesurferseg // channel: [ val(meta), aparc_aseg, wmparc ], optional
ch_lesions // channel: [ val(meta), lesions ], optional

main:

ch_versions = Channel.empty()

// ** FSL fast segmentation ** //
// TODO: Add lesion mask
SEGMENTATION_FASTSEG ( ch_image.map{ it + [""] } )
SEGMENTATION_FASTSEG (
ch_image
.join(ch_lesions, remainder: true)
.map{ it[0..1] + [it[2] ?: []] }
)
ch_versions = ch_versions.mix(SEGMENTATION_FASTSEG.out.versions.first())

// ** Setting outputs ** //
Expand All @@ -29,7 +34,11 @@ workflow ANATOMICAL_SEGMENTATION {
csf_map = SEGMENTATION_FASTSEG.out.csf_map

// ** Freesurfer segmentation ** //
SEGMENTATION_FREESURFERSEG ( ch_freesurferseg )
SEGMENTATION_FREESURFERSEG (
ch_freesurferseg
.join(ch_lesions, remainder: true)
.map{ it[0..2] + [it[3] ?: []] }
)
ch_versions = ch_versions.mix(SEGMENTATION_FREESURFERSEG.out.versions.first())

// ** Setting outputs ** //
Expand Down

0 comments on commit 34de196

Please sign in to comment.