Skip to content

Commit

Permalink
BUG: added extensions to filenames for wb_command
Browse files Browse the repository at this point in the history
  • Loading branch information
Michiel Cottaar authored and Michiel Cottaar committed Sep 25, 2019
1 parent b634cf3 commit ab9cad8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DiffusionPreprocessing/scripts/DiffusionToStructural.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ DILATE_DISTANCE=echo "$DiffRes * 12" # Extrapolates the diffusion data up to 12
if [ ${GdcorrectionFlag} -eq 1 ]; then
echo "Correcting Diffusion data for gradient nonlinearities and registering to structural space"
${FSLDIR}/bin/convertwarp --rel --relout --warp1="$DataDirectory"/warped/fullWarp --postmat="$WorkingDirectory"/diff2str.mat --ref="$T1wRestoreImage"_${DiffRes} --out="$WorkingDirectory"/grad_unwarp_diff2str
${CARET7DIR}/wb_command -volume-dilate $DataDirectory/warped/data_warped $DILATE_DISTANCE NEAREST $DataDirectory/warped/data_warped_dilated
${CARET7DIR}/wb_command -volume-dilate $DataDirectory/warped/data_warped.nii.gz $DILATE_DISTANCE NEAREST $DataDirectory/warped/data_warped_dilated.nii.gz
${FSLDIR}/bin/applywarp --rel -i "$DataDirectory"/warped/data_warped_dilated -r "$T1wRestoreImage"_${DiffRes} -w "$WorkingDirectory"/grad_unwarp_diff2str --interp=spline -o "$T1wOutputDirectory"/data

#Create a mask covering voxels within the field of view for all volumes
Expand All @@ -116,7 +116,7 @@ if [ ${GdcorrectionFlag} -eq 1 ]; then
${FSLDIR}/bin/fslmaths "$T1wOutputDirectory"/grad_dev -mas "$T1wOutputDirectory"/nodif_brain_mask_temp "$T1wOutputDirectory"/grad_dev #Mask-out values outside the brain
else
#Register diffusion data to T1w space without considering gradient nonlinearities
${CARET7DIR}/wb_command -volume-dilate $DataDirectory/data $DILATE_DISTANCE NEAREST $DataDirectory/data_dilated
${CARET7DIR}/wb_command -volume-dilate $DataDirectory/data.nii.gz $DILATE_DISTANCE NEAREST $DataDirectory/data_dilated.nii.gz
${FSLDIR}/bin/flirt -in "$DataDirectory"/data_dilated -ref "$T1wRestoreImage"_${DiffRes} -applyxfm -init "$WorkingDirectory"/diff2str.mat -interp spline -out "$T1wOutputDirectory"/data

#Create a mask covering voxels within the field of view for all volumes
Expand Down

0 comments on commit ab9cad8

Please sign in to comment.