[Insight-users] write vector image

Bing Jian bjian at cise . ufl . edu
Thu, 13 Nov 2003 08:57:31 -0500 (EST)


Hi, everybody,

   Had anyone attempted to write a vector image into file?
I don't know why I always get run-time errors when trying
to do that.

   Following is what I did:

	typedef itk::ImageFileReader<ScalarImageType> ReaderType;
	typedef itk::ImageFileWriter<VectorImageType> WriterType;

   	ReaderType::Pointer reader = ReaderType::New();
	reader->SetFileName(  argv[1] );
	reader->Update();

	WriterType::Pointer writer = WriterType::New();
        writer->SetFileName(  argv[2] );

	filter->SetInput(reader->GetOutput());
	writer->SetInput(filter->GetOutput());
	writer->Update();

  where filter is an instance of GradientRecursiveGaussianImageFilter
and VectorImageType is Image<CovariantVector<double, dim>,dim>.

  I am wondering if the writer only supports scalar image type.

  Thanks!


-- 
Best wishes,
Bing Jian
bjian at cise . ufl . edu