[vtkusers] wx/vtk weirdness

"Eduardo M. Suárez Santana" esuarez at itccanarias.org
Fri Nov 27 10:47:53 EST 2009


This looks weird to me. Spacing of vtkDICOMImageReader depends on
whether I use wx or not.

Can anyone reproduce? 

It fails in vtk-5.2.1 and vtk-5.4.2 on linux, python-2.6.2 and wxpython-2.8.10.1
It works ok in XP with python-2.5.2, vtk-5.2.0 and wx-2.8.7.1

---------------------------------------------
$ cat test2.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import wx, vtk
dicom_directory = "dicomdir";

class TestCorte(wx.Frame):
    def __init__(self, *args, **kwds):
        wx.Frame.__init__(self, *args, **kwds)
        self.CargaDicom()

    def CargaDicom(self):
        tmp_reader = vtk.vtkDICOMImageReader();
        tmp_reader.SetDirectoryName(dicom_directory);
        tmp_reader.Update();
        print tmp_reader.GetOutput().GetExtent()
        print tmp_reader.GetOutput().GetSpacing()

if __name__ == "__main__":
    programa = wx.PySimpleApp(0)
    ventana = TestCorte(None, -1, "")
    programa.SetTopWindow(ventana)
    ventana.Show()
    programa.MainLoop()




$ ./test2.py
(0, 511, 0, 511, 0, 370)
(0.0, 0.0, 0.0)




$ cat test3.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import vtk

dicom_directory = "dicomdir";

tmp_reader = vtk.vtkDICOMImageReader();
tmp_reader.SetDirectoryName(dicom_directory);
tmp_reader.Update();
print tmp_reader.GetOutput().GetExtent()
print tmp_reader.GetOutput().GetSpacing()



$ ./test3.py
(0, 511, 0, 511, 0, 370)
(0.48828125, 0.48828125, 0.329986572265625)
----------------------------------------------------------------





More information about the vtkusers mailing list