[Insight-users] Photographic Negative ?

Atwood, Robert C r.atwood at imperial.ac.uk
Mon, 19 Apr 2004 19:27:58 +0100


Yes that does indeed do the trick...=20
(but I cannot find it in the ITK software guide( PDF, Aug 21 2003 )? )

Thanks again,

Robert




-----Original Message-----
From: Luis Ibanez [mailto:luis.ibanez at kitware.com]=20
Sent: 16 April 2004 19:38
To: Atwood, Robert C
Cc: insight-users at itk.org
Subject: Re: [Insight-users] Photographic Negative ?


Hi Robert,

The itkIntensityWindowingImageFilter will do the trick:

http://www.itk.org/Insight/Doxygen/html/classitk_1_1IntensityWindowingIm
ageFilter.html

Just set up the OutputMinimum and OutputMaximum
inverted, that is:

   SetOutputMinimum( 255 );
   SetOutputMaximum(   0 );

Please let us know if you find any problem with it.

   Thanks

    Luis



----------------------
Atwood, Robert C wrote:

> I cannot figure out a simple filter that returns the negative of an=20
> image. The RescaleImageFilter does not allow a negative scale, and=20
> ScaleShift also seems to choke if the scale is -1
>=20
>=20
> For example I have an image containing values (x) between 0 and 200, I

> want to pass through an image in which each value is 200-x (output of=20
> distance map)
>=20
> Outputting the dmap->GetOutput() data shows me the correct distance=20
> map, but output of rescaler->GetOutput() creates a file that is all=20
> zeros. RescaleImageFilter simply returns an error if the minimum is=20
> greater than the maximum. I am guessing that negative SetScale value=20
> is not intended to be used in the ShiftScaleImageFilter?
>=20
>=20
> What is the correct filter to use for this purpose?
>=20
> Thanks,
> Robert
>=20
> =20
> Here are the important definitions and statements used to get all=20
> zeros:
>=20
>=20
>=20
> typedef itk::Image<unsigned long, 3>   LabeledImageType;
> typedef itk::ShiftScaleImageFilter<LabeledImageType,LabeledImageType>
> RescaleType;
> RescaleType::Pointer rescaler =3D RescaleType::New();
>=20
> rescaler->SetScale(-1);
> rescaler->SetShift(200);
>=20
> rescaler->SetInput(dmapvol->GetOutput());
>=20
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org=20
> http://www.itk.org/mailman/listinfo/insight-users
>=20