tigrlab / dmri-microstructure Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
Here's some code I hacked together last night to start creating qc images...
import pandas as pd
from nilearn import plotting
# In[3]:
subjects = pd.read_csv('/KIMEL/tigrlab/scratch/mjoseph/bids/TAY/code/subject_list.txt', header = None)
# In[29]:
PLOT_DIR=f"/KIMEL/tigrlab/scratch/edickie/TAY_DWI_QA/"
# In[31]:
get_ipython().system(' mkdir -p {PLOT_DIR}')
get_ipython().system(' mkdir {PLOT_DIR}/ICVF')
get_ipython().system(' mkdir {PLOT_DIR}/ICVF_GM')
get_ipython().system(' mkdir {PLOT_DIR}/ICVF_WM')
get_ipython().system(' mkdir {PLOT_DIR}/ISOVF')
get_ipython().system(' mkdir {PLOT_DIR}/ISOVF_GM')
get_ipython().system(' mkdir {PLOT_DIR}/ISOVF_WM')
get_ipython().system(' mkdir {PLOT_DIR}/OD')
get_ipython().system(' mkdir {PLOT_DIR}/OD_GM')
get_ipython().system(' mkdir {PLOT_DIR}/OD_WM')
# In[42]:
from pathlib import Path
# subject = subjects.loc[0,0]
for subject in subjects.loc[:,0].to_list():
AMICO_RESAMPLED_DIR=f"/KIMEL/tigrlab/scratch/fogunsanya/dmri-microstructure/amico_resampled_MNI152NLin6/{subject}/ses-01/dwi"
FMRIPREP_DIR=f"/KIMEL/tigrlab/archive/data/TAY/pipelines/in_progress/baseline/fmriprep/{subject}/ses-01/anat"
OUTPUT_DIR=f"/KIMEL/tigrlab/scratch/fogunsanya/dmri-microstructure/NODDI_volume_space_masked/{subject}/ses-01/dwi"
print(subject)
for noddi_type in ["ICVF", "ISOVF", "OD"]:
noddi_img = f"{AMICO_RESAMPLED_DIR}/{subject}_ses-01_space-MNI152NLin6Asym_desc-{noddi_type}_NODDI.nii.gz"
if Path(noddi_img).is_file():
p1 = plotting.plot_img(noddi_img, cut_coords=[-26, -27, 0], title = f"{subject} {noddi_type}", colorbar = True)
p1.savefig(f"{PLOT_DIR}/{noddi_type}/{subject}_{noddi_type}.png")
for mask_type in ["GM","WM"]:
mask = f"{FMRIPREP_DIR}/{subject}_ses-01_space-MNI152NLin6Asym_label-{mask_type}_probseg.nii.gz"
fig = plotting.plot_anat(noddi_img, cut_coords=[-26, -27, 0], title = f"{subject} {noddi_type} {mask_type}")
fig.add_contours(mask, filled = True, levels=[.6], alpha = 0.4, colors='y')
fig.savefig(f"{PLOT_DIR}/{noddi_type}_{mask_type}/{subject}_{noddi_type}_{mask_type}.png")
else:
print(f"{noddi_img} is missing")
Will learn more about the TAY dataset at June 13th research day.
Potential topics include aging and schizophrenia.
Use Microstructure Diffusion Toolbox (MDT) to fit NODDI mode.
Test out Christin's original scripts to understand what's going on and clean up into a subject-level script.
def should be blacklisted (major frontal aftifact - probably from dental work) - very visible on some NODDI maps..
sub-CMH00000264,
sub-CMH00000188
Problem with the GM/WM mask - (i.e. problem with segmentation inside fmriprep?)
sub-CMH00000020
sub-CMH00000262
Problem with GM/WM to NODDI registration:
sub-CMH00000186
sub-CMH00000197
sub-CMH00000198
Also might need to be mindful of participants with lower part of cerebellum missing from image (i.e. sub-CMH00000166, )
Or temporal pole issue (i.e. sub-CMH00000100, sub-CMH00000270)
Objectives
.bvec
and .bval
?Videos
Exercises
Papers
QSIPrep
Exercises
dMRI Data Carpentry lesson - Episode 2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.