[Insight-users] write vector image

Mathieu Malaterre Mathieu . Malaterre at creatis . insa-lyon . fr
Thu, 13 Nov 2003 15:03:55 +0100


Bing,

	You should be able to save your file, as I was able back in february:

http://www . itk . org/pipermail/insight-users/2003-February/002483 . html

HTH
mathieu

Bing Jian wrote:
> 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!
> 
> 


-- 
Mathieu Malaterre
CREATIS
28 Avenue du Doyen LEPINE
B.P. Lyon-Montchat
69394 Lyon Cedex 03
http://www . creatis . insa-lyon . fr/~malaterre/