This notebook presents analyses of the QA data for the diffusion imaging data in the MyConnectome project.


In [78]:
import os,glob
import pickle
import pandas as pd
import numpy
import seaborn as sns
import matplotlib.pyplot as plt

%matplotlib inline

sns.set(style="whitegrid")
figwidth=16
figheight=4

snr=numpy.loadtxt('dtiqa_snr.txt')
interleavecorr=numpy.loadtxt('dtiqa_interleavecorr.txt')
fd=numpy.loadtxt('dtiqa_fd.txt')
fahist=numpy.loadtxt('dtiqa_fahist.txt')
meanfa=numpy.loadtxt('dtiqa_meanfa.txt')
index=[]
for code in ['RL1K','RL2K','LR1K','LR2K']:
  for i in range(snr.shape[1]/4):
    index.append('%s-%d'%(code,i+1))

snr_df=pd.DataFrame(snr,columns=index)
fd_df=pd.DataFrame(fd)
index=['%.02f'%i for i in numpy.arange(0.01,1.01,0.01)]
fahist_df=pd.DataFrame(fahist,columns=index)
interleavecorr_df=pd.DataFrame(interleavecorr)

In [79]:
fig=plt.figure(figsize=(16,12))
fig.add_subplot(211)
sns.violinplot(snr_df)
g=fig.gca()
g.set_xticklabels('')
plt.title('SNR',fontsize=20)
plt.xlabel('gradients',fontsize=16)
plt.text(12,14.25,'R->L, b=1000',fontsize=16)
plt.text(40,14.25,'R->L, b=2000',fontsize=16)
plt.text(68,14.25,'L->R, b=1000',fontsize=16)
plt.text(100,14.25,'L->R, b=2000',fontsize=16)
fig.add_subplot(212)
sns.violinplot(interleavecorr_df)
g=fig.gca()
g.set_xticklabels('')
plt.title('Interleave correlation',fontsize=20)
plt.xlabel('gradients',fontsize=16)


Out[79]:
<matplotlib.text.Text at 0x1734ca450>

In [91]:
fig=plt.figure(figsize=(16,12))
fig.add_subplot(121)
sns.violinplot(fahist_df)
plt.title('FA histogram',fontsize=20)
plt.xlabel('gradients',fontsize=16)

fig.add_subplot(122)
sns.tsplot(meanfa[:,0])
sns.tsplot(meanfa[:,0]+meanfa[:,1],color='red')
sns.tsplot(meanfa[:,0]-meanfa[:,1],color='red')
plt.xlabel('Sessions',fontsize=16)
plt.ylabel('FA',fontsize=16)
plt.title('Mean FA +/- 1 SD',fontsize=20)


Out[91]:
<matplotlib.text.Text at 0x186c8d890>