[Insight-users] .vtk Output in ITK-3-2 not ParaView readable

Luis Ibanez luis.ibanez at kitware.com
Thu May 17 10:24:36 EDT 2007


Hi Rakesh,

It seems that we just found the source of the problem that you reported.

Since the vector field is stored as a DATASET STRUCTURED_POINTS the
vtkDataReader delegates the read tot he vtkStructuredPointsReader.


This reader expects the header to contain only one of the two following
combinations:


            SCALARS
            COLOR_SCALARS


The option of VECTORS is not available in the vtkStructuredPointReader.

It is available, however, in the generic vtkDataReader.


Therefore, there is no point in having ITK write the "VECTOR" string
in the output VTK file, even thought the actual ITK image may have
a pixel type "VECTOR".  We have therefore reverted the change of

itkVTKImageIO.cxx version 1.39 to 1.38:
http://www.itk.org/cgi-bin/viewcvs.cgi/Code/IO/itkVTKImageIO.cxx?root=Insight&r1=1.38&r2=1.39


The change that we just applied is:
http://www.itk.org/cgi-bin/viewcvs.cgi/Code/IO/itkVTKImageIO.cxx?root=Insight&r1=1.40&r2=1.41


We also verified that after applying this change, the VTK datasets
created from ITK can be loaded into ParaView.

You may have to update your CVS checkout of ITK in order
to obtain this modification.


 Please let us know if you find any other problems.


        Thanks


                Luis


---------------------------------------------------------------------------------
On 5/16/07, Luis Ibanez <luis.ibanez at kitware.com> wrote:
>
>
> Hi Rakesh,
>
>
>              Thanks for pointing this out.
>
>
> We managed to replicate the problem that you reported,
> and we are tracking down the origin.
>
>
> In principle, the tag
>
>          VECTORS vectors float
>
> in the legacy VTK file is a valid description of the data.
>
>
>
> We are suspecting that something downstream of the file
> is the actual reason for the problem.
>
>
>
>     We will keep you posted.
>
>
>
>        Luis
>
>
> ---------------------------------------
> Mullick, Rakesh (GE, Research) wrote:
> > Hi Luis,
> >
> > We have been using .vtk extension to write the deformation field and
> > when we switched from ITK-2-8-1 to ITK-3-2 we notice that
> > itkVTKImageIO.cxx (Line 480) has changed. The following now appears (in
> > ITK-3-2) to define the nature of the stored data:
> >
> >   file << "POINT_DATA " << this->GetImageSizeInPixels() << "\n";
> >
> >   if( this->GetPixelType() == ImageIOBase::VECTOR )
> >
> >     {
> >
> >     file << "VECTORS vectors "
> >
> >          << this->GetComponentTypeAsString(m_ComponentType) << "\n";
> >
> >     file << "LOOKUP_TABLE default\n";
> >
> >     }
> >
> >   else
> >
> >     {
> >
> >     file << "SCALARS scalars "
> >
> >          << this->GetComponentTypeAsString(m_ComponentType) << " "
> >
> >          << this->GetNumberOfComponents() << "\n";
> >
> >     file << "LOOKUP_TABLE default\n";
> >
> >     }
> >
> > Whereas, in ITK-2-8-1 we only had the option available in the else
> clause:
> >
> >     file << "SCALARS scalars "
> >
> >          << this->GetComponentTypeAsString(m_ComponentType) << " "
> >
> >          << this->GetNumberOfComponents() << "\n";
> >
> >     file << "LOOKUP_TABLE default\n";
> >
> > The outcome is that ParaView is unable to***___ correctly_* read the
> > field now. Can you please check on it and see how the itkVTK writer is
> > VTK Legacy compatible. The new code adds the line:
> >
> > *VECTORS vectors******** float*
> >
> > Instead of
> >
> > *SCALARS scalar float 3*
> >
> > For a typical deformation field which stores the deformation vector as 3
> > float scalar components.
> >
> > Let me know if you need further clarification.
> >
> > regards,
> > rakesh
> >
> __________________________________________________________________________
> > *****Rakesh Mullick*, Ph.D., Senior Scientist***********
> >              ****** EMail*: ___Rakesh.Mullick at ge.com_
> > <mailto:Rakesh.Mullick at ge.com>
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Insight-users mailing list
> > Insight-users at itk.org
> > http://www.itk.org/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070517/cbc1d0e5/attachment.htm


More information about the Insight-users mailing list