def loadZipDicom(name): print "Reading Dicom zip file:", name myzip = zipfile.ZipFile(name, 'r') try: myzip.extractall(tempdir) except: print "Zip extract failed" return dicomutils.loadLargestSeries(tempdir)
def loadZipDicom(name): print "Reading Dicom zip file:", name myzip = zipfile.ZipFile(name, 'r') try: myzip.extractall(tempDir) except: print "Zip extract failed" return dicomutils.loadLargestSeries(tempDir)
# Load our Dicom data # if zipFlag: # Case for a zip file of images if verbose: print "zip" img, modality = loadZipDicom( fname[0] ) else: if dirFlag: if verbose: print "directory" img, modality = dicomutils.loadLargestSeries( fname[0] ) else: # Case for a single volume image if len(fname) == 1: if verbose: print "Reading volume: ", fname[0] img = sitk.ReadImage( fname[0] ) modality = dicomutils.getModality(img) else: # Case for a series of image files if verbose: if verbose>1: print "Reading images: ", fname else: