[Insight-developers] RescaleIntensityImageFilter is broken!

Lorensen, William E (Research) lorensen@crd.ge.com
Fri, 28 Feb 2003 10:36:41 -0500


John,
Thanks for digging into this and providing such a good example of the failure.

First, I believe "unsigned" is non-standard. You should specify "unsigned int".

Second, the traits for some types are inconsistent. For some signed types, min returns 0 and others
returns a negative number. Jim had added a NonpositiveMin trait to add some consistency.

At any rate, we're looking at the problem. I hope to fix it before we tag this afternoon, but that
may not be possible.

Bill

-----Original Message-----
From: John M. Galeotti [mailto:jgaleotti@cmu.edu]
Sent: Thursday, February 27, 2003 6:00 PM
To: insight-developers@public.kitware.com
Subject: [Insight-developers] RescaleIntensityImageFilter is broken!


RescaleIntensityImageFilter does not work for some output data types.  
Specifically, it incorrectly chooses the scaling parameter when 
converting from unsigned char to either int or long, and as a result 
produces a completely black image.  Also, the VNL numeric traits 
implementation seems to be missing a definition for the type unsigned.

I've attached a relatively simple program (110 lines) to demonstrate 
the problems.  It is explained in the first 40 lines of code.

This should probably be fixed before the upcoming release.

Thank you,
John Galeotti