[Insight-users] confused about itk::matrix in Python

Luis Ibanez luis.ibanez at kitware.com
Thu Jul 5 13:06:23 EDT 2007


Hi Sven,

Why are you using the itk::AnalyzeIO object directly
instead of using the ImageFileWriter<> class and letting
the IO factory discover the appropriate ImageIO object
for your fileformat ?


If your filename extension is set to one of the accepted
Analyze extensions, the image IO factory should pull in
the AnalyzeIO object for you.

By invoking the AnalyzeIO object from the ImageFileWriter,
ITK will take care of all the proper configuration of the
ImageIO object.


  Please let us know,


     Thanks


        Luis


----------------------
Sven Prevrhal wrote:
> Hi,
> 
> I am using wrap_itk for python bindings and want to write a vtk image 
> data set to Analyze format using the itk::AnalyzeIO class. Apparently 
> AnalyzeIO requires to have set the direction cosines of the data volume 
> first. So I create an itk::Matrix object with m=itk.Matrix.D33() and 
> m.SetIdentity() and use SetDirection() on the data. Still bombing. Also, 
> when I do mm = m.GetVnlMatrix(), mm.IsZero() returns True !!!
> 
>  
> 
> So I would like to know whether that’s the best approach to use 
> AnalyzeIO from Python, and what the deal with itk::Matrix in Python is 
> (my current assumption is that the wrapper is pretty much unusable :-).
> 
>  
> 
> Thanks much,
> 
> Sven
> 
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list