Skip to content

Commit

Permalink
Merge pull request #3 from smoia/Remove-initial-resampling
Browse files Browse the repository at this point in the history
Removing 3drefit and 3dresample calls after a chat with @oesteban
  • Loading branch information
Stefano Moia authored Oct 21, 2021
2 parents 2c4c872 + 29746b7 commit c020c52
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
7 changes: 1 addition & 6 deletions 01.anat_preproc/01.anat_correct.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,10 @@ cd ${adir} || exit 1
anat=$( basename ${anat_in%.nii.gz} )
if_missing_do mkdir ${tmp}

# 01. Deoblique & resample
echo "Resample ${anat}"
3drefit -deoblique ${anat_in}.nii.gz
3dresample -orient RPI -inset ${anat_in}.nii.gz -prefix ${tmp}/${anat}_RPI.nii.gz -overwrite

## 02. Bias Field Correction with ANTs
# 02.1. Truncate (0.01) for Bias Correction
echo "Performing BFC on ${anat}"
ImageMath 3 ${tmp}/${anat}_trunc.nii.gz TruncateImageIntensity ${tmp}/${anat}_RPI.nii.gz 0.02 0.98 256
ImageMath 3 ${tmp}/${anat}_trunc.nii.gz TruncateImageIntensity ${anat_in}.nii.gz 0.02 0.98 256
# 02.2. Bias Correction
N4BiasFieldCorrection -d 3 -i ${tmp}/${anat}_trunc.nii.gz -o ${tmp}/${anat}_bfc.nii.gz

Expand Down
7 changes: 1 addition & 6 deletions 02.func_preproc/01.func_correct.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,7 @@ then
fslroi ${funcsource} ${tmp}/${func}_dsd.nii.gz ${voldiscard} -1
funcsource=${tmp}/${func}_dsd
fi
# 01.2. Deoblique & resample
echo "Deoblique and RPI orient ${func}"
3drefit -deoblique ${funcsource}.nii.gz
3dresample -orient RPI -inset ${funcsource}.nii.gz -prefix ${tmp}/${func}_RPI.nii.gz -overwrite
# set name of source for 3dNwarpApply
funcsource=${tmp}/${func}_RPI

# 01.3. Compute outlier fraction if there's more than one TR
if [[ "${nTR}" -gt "1" ]]
then
Expand Down

0 comments on commit c020c52

Please sign in to comment.