[Insight-users] Matrix-valued Image

Luis Ibanez luis.ibanez at kitware.com
Thu Jul 5 16:08:51 EDT 2007


Hi InnerSmile,

ITK currently does not support reading Matrices as pixel values.

This, however is relatively easy to fix.

You just need to add the types that you want to read to the
ImageIOBase.h and .txx files in Insight/Code/IO.

1) In ImageIOBase.h line 83, you could add a type "MATRIX"
    to the IOPixelType enum.

2) In ImageIOBase.txx lines 300-305 you could add the
    instantiation of the matrix type that you need to read
    as one of the elseif cases.

    Note that the difficulty for adding matrix types as
    a pixel type is to anticipate how many variations of
    them we should support. {e.g. 2x2,2x3, 3x3, 3x4, 4x4 ..??}

3) An interesting alternative may be to read your image
    as a Vector image and then reinterpret the pixel values
    using an Image Adaptor.  You may find more information
    about ImageAdaptors in the ITK Software Guide


       http://www.itk.org/ItkSoftwareGuide.pdf

    in the "Image Adaptors" Chapter.

    Your image of vectors will have as pixels, vectors of
    K elements, where K = NxM , N and M being the number
    of rows and columns of your matrix pixel type.



   Regards,



       Luis


-------------------
innersmile wrote:
> Hi,
>      Does the current version of ITK support
> reading/writing matrix-valued images? I noticed
> that in the itkImageIOBase there are symmetric
> second rank tensors and diffusion tensors.
> But they are all symmetric matrices.  What
> I want are 2x2, 3x3 full matrices, for example,
> the current DeformationFieldJacobian program
> in the Example/Registration only saves the
> determinants of the Jacobian field, but what I
> want is the field of the full Jacobian matrices.
> I think it would be much more convenient
> if the next update of ITK could allow the reading/writing
> of such images, at least for 2x2 and 3x3 matrices.
> 
> Thanks!
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> 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