@@ -0,0 +1,844 @@
+import nibabel as nib%0Aimport matplotlib.pyplot as plt%0Aimport numpy as np%0A%0Adef plot_nii(filename):%0A    img = nib.load(filename)%0A    data = img.get_data()%0A    if (len(data.shape)==3):%0A        plt.imshow(data%5B:,:,(data.shape%5B-1%5D//2)%5D, interpolation=%22nearest%22)%0A    else:%0A        plt.imshow(data%5B:,:,(data.shape%5B-2%5D//2),(data.shape%5B-1%5D//2)%5D, interpolation=%22nearest%22)%0A%0A%0Adef outlier_prop(filename):%0A    img = nib.load(filename)%0A    data = img.get_data()%0A    data2d = np.reshape(data, (np.prod(data.shape%5B:-1%5D),data.shape%5B-1%5D))%0A    std = np.std(data2d, axis=0)%0A    IQR = np.percentile(std, 75) - np.percentile(std, 25)%0A    low_threshold = np.percentile(std, 25) - 1.5 * IQR%0A    high_threshold = np.percentile(std, 75) + 1.5 * IQR%0A    outlier_indices=np.nonzero((std %3C low_threshold) + (std %3E high_threshold))%5B0%5D%0A    return len(outlier_indices)/len(std)

add plot_nii and outlier_prop in utils.py