start removing lots of print
This commit is contained in:
+1
-11
@@ -93,38 +93,29 @@ def get_dicom_order(path):
|
||||
files = []
|
||||
|
||||
for fname in glob.glob(path, recursive=False):
|
||||
print("loading: {}".format(fname))
|
||||
files.append((fname, pydicom.dcmread(fname)))
|
||||
|
||||
print("file count: {}".format(len(files)))
|
||||
|
||||
# skip files with no SliceLocation (eg scout views)
|
||||
slices = []
|
||||
map = {}
|
||||
skipcount = 0
|
||||
for fname, f in files:
|
||||
print(dir(f))
|
||||
print(fname)
|
||||
if hasattr(f, 'SliceLocation'):
|
||||
slices.append(f)
|
||||
map[f.SliceLocation] = fname
|
||||
else:
|
||||
skipcount = skipcount + 1
|
||||
|
||||
print("skipped, no SliceLocation: {}".format(skipcount))
|
||||
|
||||
# ensure they are in the correct order
|
||||
slices = sorted(slices, key=lambda s: s.SliceLocation)
|
||||
|
||||
#print(slices)
|
||||
for i in slices:
|
||||
print(map[i.SliceLocation])
|
||||
return slices
|
||||
|
||||
#get_dicom_order("/home/ross/Downloads/DICOM HEAD/STD4/SER1/*.dcm")
|
||||
|
||||
def pretty_print_dicom(dataset, indent=0):
|
||||
l = print_dicom(dataset, indent)
|
||||
print(l)
|
||||
return "".join(l)
|
||||
|
||||
|
||||
@@ -183,7 +174,6 @@ def get_image_dicom_hash(img, dataset=None, hash_type="md5", direct_pixel_data=T
|
||||
hasher.update(dataset.PixelData)
|
||||
except AttributeError as e:
|
||||
print("Error getting pixel data hash from dataset")
|
||||
print(dataset)
|
||||
raise InvalidDicomError("Error getting pixel data hash from dataset")
|
||||
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user