Giter VIP home page Giter VIP logo

dmri-microstructure's People

Contributors

edickie avatar fogunsan avatar josephmje avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

dmri-microstructure's Issues

add qc_views

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")

QC TAY qsiprep outputs

  • Review dynamic and static QC pages for potential issues
  • Come to consensus between 2 raters
  • Identify common areas of concern so we can move towards a more standardized process for rating

Lesson notes

QC Results

failing participants

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.