Skip to content

Commit

Permalink
Merge pull request #59 from scilus/revert-35-fix-sub-preproc_t1
Browse files Browse the repository at this point in the history
Revert "[ENH] Update subworkflow preproc_t1"
  • Loading branch information
AlexVCaron authored Dec 2, 2024
2 parents 44fe048 + fcd83aa commit 0699338
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions subworkflows/nf-neuro/preproc_t1/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,13 @@ workflow PREPROC_T1 {
ch_versions = ch_versions.mix(PREPROC_N4.out.versions.first())

// ** Resampling ** //
ch_resampling = PREPROC_N4.out.image
.join(ch_ref_resample, remainder: true)
.map{ it[0..1] + [it[2] ?: []] }

ch_resampling = PREPROC_N4.out.image.join(ch_ref_resample)
IMAGE_RESAMPLE ( ch_resampling )
ch_versions = ch_versions.mix(IMAGE_RESAMPLE.out.versions.first())

// ** Brain extraction ** //
if ( params.run_synthbet) {
ch_bet = IMAGE_RESAMPLE.out.image
.join(ch_weights, remainder: true)
.map{ it[0..1] + [it[2] ?: []] }

ch_bet = IMAGE_RESAMPLE.out.image.join(ch_weights)
BETCROP_SYNTHBET ( ch_bet )
ch_versions = ch_versions.mix(BETCROP_SYNTHBET.out.versions.first())

Expand All @@ -65,10 +59,7 @@ workflow PREPROC_T1 {
}

else {
ch_bet = IMAGE_RESAMPLE.out.image
.join(ch_template)
.join(ch_probability_map)

ch_bet = IMAGE_RESAMPLE.out.image.join(ch_template).join(ch_probability_map)
BETCROP_ANTSBET ( ch_bet )
ch_versions = ch_versions.mix(BETCROP_ANTSBET.out.versions.first())

Expand All @@ -77,16 +68,13 @@ workflow PREPROC_T1 {
mask_bet = BETCROP_ANTSBET.out.mask
}

// ** Crop image ** //
ch_crop = image_bet
.map{ it + [[]] }

// ** crop image ** //
ch_crop = image_bet.map{it + [[]]}
BETCROP_CROPVOLUME_T1 ( ch_crop )
ch_versions = ch_versions.mix(BETCROP_CROPVOLUME_T1.out.versions.first())

// ** Crop mask ** //
ch_crop_mask = mask_bet
.join(BETCROP_CROPVOLUME_T1.out.bounding_box)
// ** crop mask ** //
ch_crop_mask = mask_bet.join(BETCROP_CROPVOLUME_T1.out.bounding_box)

BETCROP_CROPVOLUME_MASK ( ch_crop_mask )
ch_versions = ch_versions.mix(BETCROP_CROPVOLUME_MASK.out.versions.first())
Expand Down

0 comments on commit 0699338

Please sign in to comment.