[Insight-users] Problem using vtkImagePlaneWidget

Kevin Keraudren kevin.keraudren10 at imperial.ac.uk
Tue Mar 20 10:07:03 EDT 2012


When working with ITK or VTK from Python, use "print" on the objects to 
know what they contain.

For instance:
print( vtk_image )
shows that already you have a problem.

You are trying to get information from object whose creation is not 
completed yet: "Update()" has not been called yet, either directly, or 
indirectly like by Render()

If you are working with the raw file 
http://www.siafoo.net/snippet/313/download/vtkImageImportFromArray.py
add:
self.__import.Update()
at the line 107 (the end of "def SetArray(..):")

If your problem is VTK specific, you will surely get more help from:
http://www.vtk.org/mailman/listinfo/vtkusers

Kind regards,

Kevin



Le 19/03/2012 12:05, Mathieu Stumpf a écrit :
> Hello,
>
> I'm trying to write a simple software to visualize medical image with
> SITK, VTK, and WxWidget.
>
> As far as I can perceive, my problem is due to GetWholeExtent which
> doesn't provide slice number for each axis in my picture, as I would
> expect. Instead I get (0,-1) tuples.
>
> Maybe I do others things in a wrong way, I don't know. May be
> GetWholeExtent is not the method I should use.
>
> My code is in a substantial part an object oriented rewriting of [1]
> using Wx instead of Tkinter as widgets provider. As I'm a python
> beginner, I may have made errors in this transcriptions too.
>
> Other sources greatly inspired me on this work :
> - http://www.siafoo.net/snippet/314?code=on&nolinenos
> - Other codes which were privately sent to me by Antoine Grigis and
> Kevin Keraudren (lot of thank to them).
>
> I hope someone will be able to point me where I'm wrong in my
> vtkImagePlaneWidget usage. I would also appreciate any feedback on the
> code in a whole.
>
> Thank for your attention,
> Mathieu
>
> [1]
> http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Examples/GUI/Python/ImagePlaneWidget.py?root=VTK&content-type=text/plain
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users



More information about the Insight-users mailing list