I am trying to sort DICOM files in correct order, and I not able to use Image Position Patient descriptor as it's giving me an error "AttributeError: 'FileDataset' object has no attribute 'sort'".
code:
for paths in a:
for root, dirs, files in os.walk(paths):
for file in files:
if file.endswith('.dcm'):
k = dcm.read_file(os.path.join(root, file))
k.sort
k = dcm.read_file(os.path.join(root, file)).pixel_array
PixelArrays.append(k)
Other than sort attribute pydicom lib works fine.