Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jiewon Kang
FitODF
Commits
f2f95182
Commit
f2f95182
authored
Oct 22, 2021
by
Jiewon
Browse files
protocol
parent
8a07fd7a
Changes
1
Show whitespace changes
Inline
Side-by-side
DO.txt
0 → 100644
View file @
f2f95182
# One slice #
mkdir -p oneslice
fslroi $data oneslice/data 0 -1 144 1 0 -1 0 -1
fslroi Concat_all_sessions/nodif_brain_mask oneslice/nodif_brain_mask 0 -1 144 1 0 -1
cp $bval oneslice/bvals
cp $bvec oneslice/bvecs
# Get brain mask - work on lowres then upsample in the end #
mkdir -p lowres
d=Concat_all_sessions
# Lower the resolution of powder
flirt -in $d/powder -out lowres/powder -applyisoxfm 2 -ref $d/powder
# Extract lowres powder brain mask
fslroi lowres powder lowres nodif 0 1
# Additional BET on brain mask
bet lowres/nodif lowres/nodif_brain -m -c 56 58 29 -f .2
flirt -in lowres/nodif_brain_mask -ref $d/powder -out $d/nodif_brain_mask -applyxfm -init $FSLDIR/etc/flirtsch/ident.mat -interp nearestneighbour # Upsample mask
# Bias field correction - on single slice #
fslroi oneslice/powder.nii.gz oneslice/nodif 0 1 # Single slice of powder
fast -n 1 -t 2 -b -B -o oneslice/fast oneslice/nodif # Fast get bias field
fslmaths oneslice/data -div oneslice/fast_bias oneslice/data_restore # Restore data by correcting for bias field
# FOD fitting #
/home/fs0/saad/fit_odf.py --data oneslice/data_restore \
--mask oneslice/nodif_brain_mask \
--bvals oneslice/bvals --bvecs oneslice/bvecs \
--out oneslice/FOD_b2.5_restore --verbose --shell=2500
# Method A. run LAYNII on GM segmentation on T1, DWI (Powder/b0)
# Method B. Segment diffusion data directly
# Method A.1 WM/GM Segmentation to feed to LAYNII #
# calculate normalised dwis
fslmaths oneslice/powder -div oneslice/nodif oneslice/dwis
# extract b2500
fslroi oneslice/dwis oneslice/b2.5k 2 1 # extract b2500 from dwi single slice
fslmaths oneslice/b2.5k -mas oneslice/nodif_brain_mask oneslice/b2.5k_brain
# run fast
fast -n 4 -t 1 -b -p -v oneslice/b2.5k_brain # generate segmentations
# Method A.2 Try with the T1 #
fslmaths lowres/powder.nii.gz -div lowres/nodif -mas lowres/nodif_brain_mask lowres/dwis_brain
fslroi lowres/dwis_brain.nii.gz lowres/b2.5k_brain 2 1
t1=T1/MPRAGE0p7mm_ave_brain # High res T1
diff=lowres/b2.5k_brain
flirt -in $t1 -ref $diff -out lowres/t1_to_diff -dof 12 -omat lowres/t1_to_diff.mat
# Segment T1 with FAST #
fast -n 3 -t 1 -b -p -v lowres/t1_to_diff
# Apply xfm to segmentation to get it to diffusion space #
flirt -in lowres/t1_to_diff_seg -ref $diff -out lowres/seg_diffspace -init t1_to_diff.mat -applyxfm
# Install LAYNII tools
git clone --depth 1 https://github.com/layerfMRI/LAYNII
# Run LAYNII on that
./LN2_LAYERS -rim lowres/seg_diffspace -nr_layers 3 -equivol -iter_smooth 100
./LN2_RIMIFY -input lowres/seg_diffspace -innergm 2 -outergm 1 -gm 3
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment