We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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")
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Here's some code I hacked together last night to start creating qc images...
The text was updated successfully, but these errors were encountered: