Skip to content

Commit

Permalink
restore main.nf
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudbore committed Apr 19, 2021
1 parent 433e922 commit d53c3ad
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ process Bet_Prelim_DWI {
scil_image_math.py convert ${sid}__b0_bet_mask.nii.gz ${sid}__b0_bet_mask.nii.gz --data_type uint8 -f
maskfilter ${sid}__b0_bet_mask.nii.gz dilate ${sid}__b0_bet_mask_dilated.nii.gz\
--npass $params.dilate_b0_mask_prelim_brain_extraction -nthreads 1
scil_image_math.py multiplication ${sid}__b0.nii.gz ${sid}__b0_bet_mask_dilated.nii.gz\
${sid}__b0_bet.nii.gz -f
mrcalc ${sid}__b0.nii.gz ${sid}__b0_bet_mask_dilated.nii.gz\
-mult ${sid}__b0_bet.nii.gz -quiet -force -nthreads 1
"""
}

Expand All @@ -385,7 +385,7 @@ process Denoise_DWI {
export OMP_NUM_THREADS=1
export OPENBLAS_NUM_THREADS=1
dwidenoise $dwi dwi_denoised.nii.gz -extent $params.extent -nthreads $task.cpus
scil_image_math.py upper_threshold dwi_denoised.nii.gz 0 ${sid}__dwi_denoised.nii.gz -f
fslmaths dwi_denoised.nii.gz -thr 0 ${sid}__dwi_denoised.nii.gz
"""
else
"""
Expand Down Expand Up @@ -478,7 +478,7 @@ process Eddy {
--readout $readout --out_script --fix_seed\
$slice_drop_flag
sh eddy.sh
scil_image_math.py upper_threshold dwi_eddy_corrected.nii.gz 0 ${sid}__dwi_corrected.nii.gz -f
fslmaths dwi_eddy_corrected.nii.gz -thr 0 ${sid}__dwi_corrected.nii.gz
mv dwi_eddy_corrected.eddy_rotated_bvecs ${sid}__dwi_eddy_corrected.bvec
mv $bval ${sid}__bval_eddy
"""
Expand Down Expand Up @@ -541,7 +541,7 @@ process Eddy_Topup {
--readout $readout --out_script --fix_seed\
$slice_drop_flag
sh eddy.sh
scil_image_math.py upper_threshold dwi_eddy_corrected.nii.gz 0 ${sid}__dwi_corrected.nii.gz -f
fslmaths dwi_eddy_corrected.nii.gz -thr 0 ${sid}__dwi_corrected.nii.gz
mv dwi_eddy_corrected.eddy_rotated_bvecs ${sid}__dwi_eddy_corrected.bvec
mv $bval ${sid}__bval_eddy
"""
Expand Down Expand Up @@ -612,8 +612,7 @@ process Bet_DWI {
export OPENBLAS_NUM_THREADS=1
bet $b0 ${sid}__b0_bet.nii.gz -m -R -f $params.bet_dwi_final_f
scil_image_math.py convert ${sid}__b0_bet_mask.nii.gz ${sid}__b0_bet_mask.nii.gz --data_type uint8 -f
scil_image_math.py multiplication $dwi ${sid}__b0_bet_mask.nii.gz\
${sid}__dwi_bet.nii.gz -f
mrcalc $dwi ${sid}__b0_bet_mask.nii.gz -mult ${sid}__dwi_bet.nii.gz -quiet -nthreads 1
"""
}

Expand Down Expand Up @@ -759,8 +758,7 @@ process Bet_T1 {
antsBrainExtraction.sh -d 3 -a $t1 -e $params.template_t1/t1_template.nii.gz\
-o bet/ -m $params.template_t1/t1_brain_probability_map.nii.gz -u 0
scil_image_math.py convert bet/BrainExtractionMask.nii.gz ${sid}__t1_bet_mask.nii.gz --data_type uint8
scil_image_math.py multiplication $t1 ${sid}__t1_bet_mask.nii.gz\
${sid}__t1_bet.nii.gz -f
mrcalc $t1 ${sid}__t1_bet_mask.nii.gz -mult ${sid}__t1_bet.nii.gz -nthreads 1
"""
}

Expand Down Expand Up @@ -835,18 +833,21 @@ process Resample_DWI {
script:
if (params.run_resample_dwi)
"""
export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1
export OMP_NUM_THREADS=1
export OPENBLAS_NUM_THREADS=1
scil_resample_volume.py $dwi \
dwi_resample.nii.gz \
--resolution $params.dwi_resolution \
--interp $params.dwi_interpolation
scil_image_math.py upper_threshold dwi_resample.nii.gz 0 dwi_resample_clipped.nii.gz
fslmaths dwi_resample.nii.gz -thr 0 dwi_resample_clipped.nii.gz
scil_resample_volume.py $mask \
mask_resample.nii.gz \
--ref dwi_resample.nii.gz \
--enforce_dimensions \
--interp nn
scil_image_math.py multiplication dwi_resample_clipped.nii.gz mask_resample.nii.gz\
${sid}__dwi_resampled.nii.gz -f
mrcalc dwi_resample_clipped.nii.gz mask_resample.nii.gz\
-mult ${sid}__dwi_resampled.nii.gz -quiet -nthreads 1
"""
else
"""
Expand Down Expand Up @@ -1261,7 +1262,7 @@ process PFT_Seeding_Mask {
export OMP_NUM_THREADS=1
export OPENBLAS_NUM_THREADS=1
mrcalc $fa $params.pft_fa_seeding_mask_threshold -ge ${sid}__pft_seeding_mask.nii.gz\
-data_type uint8
-datatype uint8
"""
}

Expand Down Expand Up @@ -1325,8 +1326,11 @@ process Local_Tracking_Mask {
"""
else if (params.local_tracking_mask_type == "fa")
"""
scil_image_math.py lower_threshold_eq $fa $params.local_fa_tracking_mask_threshold ${sid}__local_tracking_mask.nii.gz\
--data_type uint8
export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1
export OMP_NUM_THREADS=1
export OPENBLAS_NUM_THREADS=1
mrcalc $fa $params.local_fa_tracking_mask_threshold -ge ${sid}__local_tracking_mask.nii.gz\
-datatype uint8
"""
}

Expand Down Expand Up @@ -1356,8 +1360,7 @@ process Local_Seeding_Mask {
export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1
export OMP_NUM_THREADS=1
export OPENBLAS_NUM_THREADS=1
scil_image_math.py lower_threshold_eq $fa $params.local_fa_seeding_mask_threshold ${sid}__local_seeding_mask.nii.gz\
--data_type uint8
mrcalc $fa $params.local_fa_seeding_mask_threshold -ge ${sid}__local_seeding_mask.nii.gz -datatype uint8
"""
}

Expand Down

0 comments on commit d53c3ad

Please sign in to comment.