[Insight-users] image casting

Luis Ibanez luis.ibanez@kitware.com
Mon, 09 Dec 2002 08:33:18 -0500


Hi Zein,

You have several options depending on the pixel
types you are converting.

1) use the itkCastImageFilter
http://www.itk.org/Insight/Doxygen/html/classitk_1_1CastImageFilter.html

This will apply only C-style casting.
so trunction and information loss is at
your own risk.

If you are casting from float to char,
for example you better use one of the
following:

2) itkRescaleIntensityImageFilter
http://www.itk.org/Insight/Doxygen/html/classitk_1_1RescaleIntensityImage=
Filter.html

3) itkShiftScaleImageFilter
http://www.itk.org/Insight/Doxygen/html/classitk_1_1ShiftScaleImageFilter=
=2Ehtml

These two filters apply a linear transformation to
the intensities of the images.

Examples for all the three filters can be found in

     Insight/Examples/Filtering

in the file:

      CastingImageFilters.cxx


Please let us know if you have further questions

Thanks

Luis

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

Zein Salah wrote:

> Hi friends,
>=20
> =20
>=20
> how can I cast an image from one tzpe to another ?
>=20
> =20
>=20
> thanks,
>=20
> zein
>=20
> =20
>=20
> =20
>=20
> ->8<------------->8<------------->8<------------->8<------------->8<---=
---------->8<-
> Zein I. Salah
> Universit=E4t T=FCbingen, WSI-GRIS, Sand 14, 72076 T=FCbingen
> Email: salah@gris.uni-tuebingen.de <mailto:salah@gris.uni-tuebingen.de>=
 =20
> / zeinsalah@hotmail.com <mailto:zeinsalah@hotmail.com>
> Tel.: (07071) 29 75465 (GRIS) , (07071) 25 69 43 (privat)
> Fax: (07071) 29 54 66
>=20