[Insight-users] Making a normalization filter

Gaetan Lehmann gaetan.lehmann at jouy.inra.fr
Mon Oct 16 06:37:42 EDT 2006


Hi Prename Surname,

The filter you want to write already exist in ITK:  
itk::RescaleIntensityImageFilter.
It's surely a good example to look to find what a filter must do.
http://www.itk.org/Doxygen/html/classitk_1_1RescaleIntensityImageFilter.html

You will also find a introduction to the writing of filters in the ITK  
user guide: http://www.itk.org/ItkSoftwareGuide.pdf .

And ITK is open source, so you can have a look at all the classes in ITK  
to get some examples :-)

Regards,

Gaetan



On Mon, 16 Oct 2006 12:16:52 +0200, Prename Surname  
<bsd.diverse at gmail.com> wrote:

> Hello. I want to write a very simple filter in order to get a better
> understanding of how i can write filters in ITK.
> I have not been able to find any examples or guides on how a filter is
> written ie. what interfaces it should implement, which class it should
> inherit from etc.
> So i was hoping someone could help me with some guidelines for how i can
> write my own filter that can accept an input image, access the data in  
> this
> image, scale and translate it so that it is normalized ie. between 0 to  
> 255.
> I have wild data which ranges from -300000 to 300000.
> So basically what my filter should do is only
>
> newImg=(oldImg+min(oldImg))/max(oldImg+min(oldImg));
>
> where min finds the pixel with smallest value and max finds the pixel  
> with
> maximum value
> newImg is the normalized image and oldImg is the input image that should  
> be
> normalized.
>
> This a very simple procedure, probably the most simple at all. So how  
> can i
> put this functionality in a filter that i can use in ITK?
>
> Guidelines would be great, links would be great and example would be
> fantastic.
>
> I really hope someone can help me a bit.
>
> Thank you very much in advance and many regards



-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr


More information about the Insight-users mailing list