我正在尝试从以下路径加载文件:
path = 'C:/Users/Aman/Alzheimer/test-network/ADNI1_Complete_1Yr_1.5T/ADNI/002_S_0685/MPR__GradWarp__B1_Correction__N3__Scaled/2006-07-06_10_36_49.0/ADNI_002_S_0685_MR_MPR__GradWarp__B1_Correction__N3__Scaled_Br_20070216235850690_S16309_I40683.nii'
但是,该文件未加载。如果我将文件 1 向上移动并将路径更改为
path = 'C:/Users/Aman/Alzheimer/test-network/ADNI1_Complete_1Yr_1.5T/ADNI/002_S_0685/MPR__GradWarp__B1_Correction__N3__Scaled/2006-07-06_10_36_49.0/S16309/ADNI_002_S_0685_MR_MPR__GradWarp__B1_Correction__N3__Scaled_Br_20070216235850690_S16309_I40683.nii'
它加载。
唯一的区别是S13893文件夹。
我有以下代码:
import nibabel as nib
import matplotlib.pyplot as plt
from scipy.misc import imsave as imsave
path = 'C:/Users/Aman/Alzheimer/test-network/ADNI1_Complete_1Yr_1.5T/ADNI/002_S_0685/MPR__GradWarp__B1_Correction__N3__Scaled/2006-07-06_10_36_49.0/ADNI_002_S_0685_MR_MPR__GradWarp__B1_Correction__N3__Scaled_Br_20070216235850690_S16309_I40683.nii'
im = nib.load(path).get_data()
print(im.shape)
任何帮助都会很棒。