<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial, helvetica, sans-serif;font-size:10pt"><div style="font-family:arial, helvetica, sans-serif;font-size:10pt;"><div style="font-family:'times new roman', 'new york', times, serif;font-size:12pt;"><div><span class="Apple-style-span" style="white-space:pre-wrap;"><span class="Apple-style-span" style="font-size:small;"><font class="Apple-style-span" face="arial, helvetica, sans-serif">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:</font></span></span></div><div><span class="Apple-style-span" style="white-space:pre-wrap;"><span class="Apple-style-span" style="font-size:small;"><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></span></span></div><div><span class="Apple-style-span" style="white-space:pre-wrap;"><span class="Apple-style-span" style="font-size:small;"><font class="Apple-style-span" face="arial, helvetica, sans-serif">class thread(threading.Thread):
    dicomReader = vtk.vtkDICOMImageReader()
    CURRENT_WORK_DIR = 'location'<span class="Apple-tab-span" style="white-space:pre;">                       </span>#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()<span class="Apple-tab-span" style="white-space:pre;">                               </span>#this is the line that freeze the normal flow </font></span></span></div><div><span class="Apple-style-span" style="white-space:pre-wrap;"><span class="Apple-style-span" style="font-size:small;"><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></span></span></div><div><span class="Apple-style-span" style="white-space:pre-wrap;"><span class="Apple-style-span" style="font-size:small;"><font class="Apple-style-span" face="arial, helvetica, sans-serif">DICOM = thread("load dicom data")
DICOM.start()
while True:</font></span></span></div><div><span class="Apple-style-span" style="white-space:pre-wrap;"><span class="Apple-tab-span" style="white-space:pre;"><span class="Apple-style-span" style="font-size:small;"><font class="Apple-style-span" face="arial, helvetica, sans-serif"> </font></span></span><span class="Apple-style-span" style="font-size:small;"><font class="Apple-style-span" face="arial, helvetica, sans-serif">print DICOM.dicomReader.GetProgress()
</font></span><span class="Apple-tab-span" style="white-space:pre;"><span class="Apple-style-span" style="font-size:small;"><font class="Apple-style-span" face="arial, helvetica, sans-serif">       </font></span></span><span class="Apple-style-span" style="font-size:small;"><font class="Apple-style-span" face="arial, helvetica, sans-serif">if (DICOM.dicomReader.GetProgress()==1.0):
</font></span><span class="Apple-tab-span" style="white-space:pre;"><span class="Apple-style-span" style="font-size:small;"><font class="Apple-style-span" face="arial, helvetica, sans-serif">               </font></span></span><span class="Apple-style-span" style="font-size:small;"><font class="Apple-style-span" face="arial, helvetica, sans-serif">break

Someone knows what's happening? I appreciate any help.

Thank!</font></span></span></div><div style=""></div></div><br>



      <div style=""></div></div><br>



      <div style="position:fixed"></div></div><br>



      </body></html>