Cast Vector Image To Another Type

Synopsis

Cast a VectorImage to another type of VectorImage.

Results

Warning

Fix Errors Example contains errors needed to be fixed for proper output.

Code

C++

#include "itkVectorImage.h"
#include "itkCastImageFilter.h"

int
main(int /*argc*/, char * /*argv*/[])
{
  typedef itk::VectorImage<unsigned char, 2> UnsignedCharVectorImageType;
  typedef itk::VectorImage<float, 2>         FloatVectorImageType;

  FloatVectorImageType::Pointer image = FloatVectorImageType::New();

  typedef itk::CastImageFilter<FloatVectorImageType, UnsignedCharVectorImageType> CastImageFilterType;
  CastImageFilterType::Pointer vectorCastImageFilter = CastImageFilterType::New();
  vectorCastImageFilter->SetInput(image);
  vectorCastImageFilter->Update();

  return EXIT_SUCCESS;
}

Classes demonstrated