[Insight-users] ITK to VTK: MHD Vector Fields
Karthik Krishnan
Karthik.Krishnan at kitware.com
Wed Oct 19 23:11:21 EDT 2005
There was a bug in Code/IO/itkVTKImageIO.cxx, fixed a couple of weeks
prior to ITK-2-2 release. Please check the cvs dates of your file:
Here is the CVS log:
http://www.itk.org/cgi-bin/viewcvs.cgi/Code/IO/itkVTKImageIO.cxx?rev=1.34&root=Insight&view=log
-karthik
Hari Sundar wrote:
>Hi,
>
>I know this problem has been discussed earlier ... but the answers were
>not helpful, and I am still having trouble.
>
>I have a vector field, 3D float image with 3 components at each voxel.
>I need to get it into VTK so that I can visualize this using glyphs.
>
>This is what I do ...
>
>const unsigned int ImageDimension = 3;
> typedef float PixelType;
>
> typedef itk::Image <PixelType, ImageDimension> ImageType;
> typedef itk::Vector < float, ImageDimension > VectorType;
> typedef itk::Image <VectorType, ImageDimension >
>DeformationFieldType;
> typedef itk::ImageFileReader < DeformationFieldType >
>FieldReaderType;
> typedef itk::ImageToVTKImageFilter <DeformationFieldType >
>ITK2VTKAdaptorFilterType;
>
>
> FieldReaderType::Pointer fieldReader = FieldReaderType::New ();
>
> if (argc >= 1) {
> fieldReader->SetFileName (argv[1]);
> try {
> fieldReader->Update ();
> } catch (itk::ExceptionObject & excp) {
> std::cerr << "Exception thrown " << std::endl;
> std::cerr << excp << std::endl;
> return EXIT_FAILURE;
> }
> }
>
> std::cout << "Finished reading file" << std::endl;
> ITK2VTKAdaptorFilterType *m_ITK2VTKAdaptor =
>ITK2VTKAdaptorFilterType::New();
> m_ITK2VTKAdaptor->SetInput( fieldReader->GetOutput() );
> m_ITK2VTKAdaptor->Update();
>
> std::cout << "Finished converting to VTK" << std::endl;
>... Rest follows ...
>
>I get a segmentation fault within ITK2VTKAdaptorFilterType::Update().
>
>The mhd file I am testing with is correct, since I am able to load it
>within paraview and visualize it.
>
>what am I doing wrong here ?
>
>thanks,
>~Hari
>
>bhogaa na bhuktaa vayameva bhuktaaH
>tapo na tapta.n vayameva taptaaH |
>kaalo na yaato vayameva yaataaH
>tR^ishhNaa na jiirNaa vayameva jiirNaaH ||
>
>
>
>__________________________________
>Yahoo! Music Unlimited
>Access over 1 million songs. Try it free.
>http://music.yahoo.com/unlimited/
>_______________________________________________
>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