[Insight-users] Problem VectorImage reader

Dr. Uwe Köhler U.Koehler at gmx.de
Mon Mar 6 05:21:38 EST 2006


Hi there,

we are using itkVectorImages and came accross the following problem:
when storing an interger valued itkVectorImage to disk and reading it back as 
a float itkVectorImage the contained numbers are wrong. I attched a testcase 
to this email.

With DebugOn(), I get:
Debug: In /usr/local/include/InsightToolkit/IO/itkImageFileReader.txx, line 
358
ImageFileReader (0x8120908): Buffer conversion required.

Debug: In /usr/local/include/InsightToolkit/IO/itkImageFileReader.txx, line 
370
ImageFileReader (0x8120908): Buffer conversion required from: i to: f

However, all the reader does is:
   if( strcmp( this->GetOutput()->GetNameOfClass(), "VectorImage" ) == 0 ) \
     { \
     memcpy( outputData, inputData, numberOfPixels * 
m_ImageIO->GetNumberOfComponents() * sizeof( type ) ); \
     } \

Could that be the problem? We are using pretty recent cvs code.

Any help would be very wellcome.

Uwe
-------------- next part --------------
PROJECT(RGB-project)

# Find ITK.
FIND_PACKAGE(ITK)
IF(ITK_FOUND)
  INCLUDE(${ITK_USE_FILE})
ELSE(ITK_FOUND)
  MESSAGE(FATAL_ERROR
          "Cannot build without ITK.  Please set ITK_DIR.")
ENDIF(ITK_FOUND)


ADD_EXECUTABLE(VectorImageTest VectorImageTest.cxx UKTest.cxx )

TARGET_LINK_LIBRARIES(VectorImageTest ITKCommon ITKIO)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: UKTest.cxx
Type: text/x-c++src
Size: 1398 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/insight-users/attachments/20060306/60dd5b3e/UKTest-0001.cxx
-------------- next part --------------
A non-text attachment was scrubbed...
Name: UKTest.h
Type: text/x-c++hdr
Size: 816 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/insight-users/attachments/20060306/60dd5b3e/UKTest-0001.hpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: VectorImageTest.cxx
Type: text/x-c++src
Size: 9112 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/insight-users/attachments/20060306/60dd5b3e/VectorImageTest-0001.cxx


More information about the Insight-users mailing list