[Insight-users] How to cast one image type to another?
Pieter Vos
p . vos at rad . umcn . nl
Fri, 16 Aug 2002 12:44:22 +0200 (CEST)
Hello Zhao,
That is not so difficult since there is an image caster filter in ITK:
vtkCastImageFilter (itk)
Set the input image to float and output image to usigned long.
Easy does it.
Pieter
On Fri, 16 Aug 2002, zhao wrote:
> Hi all,
>
> Under MSVC6, I use output of a filter(CurvatureAnisotropicDiffusionImageFilter) as input of a image file writer:
> writer->SetInput(diffusion->GetOutput());
>
> There is a compiling error:
> error C2664: 'SetInput' : cannot convert parameter 1 from 'class itk::Image<float,2> *' to 'const class itk::Image<unsigned long,2> *
>
> My question is how to convert one image type to another? Thanks!
>
> Zhao
>
> Zhao ChenGuang
> P.O.Box:010,
> Dept. BME,
> Shanghai Jiao Tong University,
> 1954# Hua Shan Road,
> Shanghai,P.R.China,
> 200030
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-users
>
--
Pieter Vos
UMC Radboud Nijmegen
The Netherlands
mailto:p.vos@rad.umcn.nl