[Insight-users] How do I read a 3D .VTK Image

Matt neurosciencematt at yahoo.com
Wed Oct 17 12:16:20 EDT 2007


 The 3D deformation field (.vtk image) I am creating has gotten written to file
 with two different header files with the exact same code. The first time I ran
 my code my OS was Red Hat Linux. I can read this image. I am now using Cent
 Linux and am having a problem reading the second image (.vtk image).
 
 Header file that will read:
 
 # vtk DataFile Version 3.0
 VTK File Generated by Insight Segmentation and Registration Toolkit (ITK)
 BINARY
 DATASET STRUCTURED_POINTS
 DIMENSIONS 82 56 41
 SPACING 3.9443597793579102e+00 4.1964287757873535e+00 3.9157774448394775e+00
 ORIGIN 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
 POINT_DATA 188272
 SCALARS scalars double 3
 LOOKUP_TABLE default
 
 Header file that will not read:
 
 # vtk DataFile Version 3.0
 VTK File Generated by Insight Segmentation and Registration Toolkit (ITK)
 BINARY
 DATASET STRUCTURED_POINTS
 DIMENSIONS 82 56 41
 SPACING 3.9443597793579102e+00 4.1964287757873535e+00 3.9157774448394775e+00
 ORIGIN 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00
 POINT_DATA 188272
 VECTORS vectors double
 LOOKUP_TABLE default
 
 Code I use to read in the deformation field (.vtk image):
 
 
  typedef itk::Vector< double, 3 > VectorType;
  typedef itk::Image< VectorType, 3 > DeformationFieldType;
  typedef itk::ImageFileReader< DeformationFieldType > FieldReaderType;
  typedef itk::WarpImageFilter< ImageType, ImageType, DeformationFieldType  > FilterType;
 
  // read in deformation field
  FieldReaderType::Pointer fieldReader = FieldReaderType::New();
  DeformationFieldType::ConstPointer deformationField;
 
  fieldReader->SetFileName( deformationFieldFile ); std::endl;
 
  try
    {
      fieldReader->Update();
    }
  catch( itk::ExceptionObject & excp )
    {
      std::cerr << "Exception thrown" << std::endl;
      std::cerr << excp << std::endl;
    }
 
  deformationField = fieldReader->GetOutput();
 
 
 I am using ITK version 3.2.0. The program never finishes executing the command
 "fieldReader->Update();". I don't get an error, it just seems as if the code
 encounters an infinite For Loop. The code runs fine for the .vtk image with the
 first header listed above, but I encounter the described problem for the .vtk
 image with the second header listed above.
 
 Thanks,
 
Matt

 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20071017/3123d41f/attachment.html


More information about the Insight-users mailing list