[vtk-developers] How to use GetProgress() with vtkDICOMImageReader() class?

Aday Suarez adaynsr at yahoo.es
Wed May 13 06:57:49 EDT 2009


Hi, I'm trying to use python threads and the GetProgress() method from the vtk class DICOMImageReader() but it doesn't work. The code goes ok till reach the line that reads the DICOM files "DicomReader.Update()". At this point all stops till the update method finish its work. Here you are the code:

class thread(threading.Thread): dicomReader = vtk.vtkDICOMImageReader() CURRENT_WORK_DIR = 'location'#here goes the location where your dicom files are. def __init__(self,name): threading.Thread.__init__(self) self.name = name def run(self): self.dicomReader.SetDirectoryName(self.CURRENT_WORK_DIR) self.dicomReader.Update()#this is the line that freeze the normal flow 

DICOM = thread("load dicom data")
DICOM.start()
while True:
print DICOM.dicomReader.GetProgress() if (DICOM.dicomReader.GetProgress()==1.0): break Someone knows what's happening? I appreciate any help. Thank!


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20090513/cb08eba9/attachment.html>


More information about the vtk-developers mailing list