17 #include "itkVectorImage.h" 18 #include "itkImageFileReader.h" 20 #include "vtkSmartPointer.h" 21 #include "vtkXMLImageDataWriter.h" 25 #include "VectorImageToVTKXMLImageConverterCLP.h" 28 main(
int argc,
char *argv[])
33 const static unsigned int Dimension = 3;
34 typedef double PixelType;
35 typedef itk::VectorImage<PixelType, Dimension> ImageType;
36 typedef itk::ImageFileReader<ImageType> ReaderType;
37 typedef vtkSmartPointer<vtkXMLImageDataWriter> WriterType;
38 WriterType writer = WriterType::New();
41 ImageType::Pointer image = ImageType::New();
46 ConverterType::Pointer converter = ConverterType::New();
47 converter->SetInput( image );
53 std::cout <<
"Writing file: " << _OutputFile << std::endl;
54 writer->SetInputData( converter->GetOutput() );
55 writer->SetFileName( _OutputFile.c_str() );
58 catch ( itk::ExceptionObject & err )
60 std::cerr <<
"ExceptionObject caught!" << std::endl;
61 std::cerr << err << std::endl;
Converts an ITK image to VTK image data.
helper functions specifically used in dmritool
void ReadVectorImage(const std::string &filename, SmartPointer< VectorImage< PixelType, 3 > > &image, const std::string &printInfo="Reading Image:")
int main(int argc, char *argv[])