[vtkusers] itk::VTKImageToImageFilter Questions
Bill Lorensen
bill.lorensen at gmail.com
Sat Jan 29 08:27:36 EST 2011
Alexis,
The itkVTKImageToImageFilter (which is in Insight Applications) is
meant to be a base class and never used directly.
What are you trying to do in your application?
On Fri, Jan 28, 2011 at 8:09 PM, Alexis Cheng <acheng_1221 at hotmail.com> wrote:
> Hi all,
>
> I'm having a bit of trouble using the itk::VTKImageToImageFilter class. My
> program crashes on runtime. The following is a snippet of my code.
>
> static const unsigned int Dimension = 2;
> typedef float PixelType;
> typedef itk::Image< PixelType, Dimension > FixedImageType;
> typedef itk::VTKImageToImageFilter<FixedImageType> VTKImageToITKImageType;
>
> vtkSmartPointer<vtkImageData> USImage =
> vtkSmartPointer<vtkImageData>::New();
> VTKImageToITKImageType::Pointer VTKToITKConnector =
> VTKImageToITKImageType::New();
>
> vector<FixedImageType::Pointer> *ImagePanorama;
> ImagePanorama = NULL;
> vector<FixedImageType::Pointer>::iterator PanoramaIterator;
> USImage->SetScalarTypeToUnsignedChar();
> USImage->SetDimensions(960,480,1);
> USImage->SetSpacing(1,1,1);
> USImage = sonixGrabber->GetOutput();
> USImage->Update();
>
> VTKToITKConnector->SetInput(USImage);
> VTKToITKConnector->Execute();
>
> FixedImageType::Pointer ITKImagePointer = FixedImageType::New();
> ITKImagePointer = VTKToITKConnector->GetImporter()->GetOutput();
> ITKImagePointer->Update();
>
> I've isolated the error to the usage of VTKImageToImageFilter. I haven't had
> any luck finding examples that used this filter. What is the correct
> pipeline for using this filter? Thank you all in advance.
>
> Regards,
> Alexis Cheng
> University of British Columbia
> Electrical Engineering
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
More information about the vtkusers
mailing list