[Insight-users] logarithmic scaling
Jakub Bican
jakub.bican at matfyz.cz
Wed Jul 13 11:37:16 EDT 2005
Hi Isabelle,
you should add 1 to all image values after Abs filter and before Log
filter. This can be done by
AddImageAdaptor
(http://www.itk.org/Doxygen/html/classitk_1_1AddImageAdaptor.html)
which enables you to add a constant value to all image pixels. The value
can set via SetValue() method of the adaptor class. Log filter will then
produce no "infinities" as you skip "problematic" interval <0,1).
HTH,
Jakub
Renaud Isabelle napsal(a):
> Hi,
>
> I'm still triing to improve the quality of visualization of raw data.
>
> - by computing *absolute value* of raw data, my displayed images are
> too *dark*.
>
> - by applliing a *log scaling* after abs(), my displayed data are now
> too *bright*. That's the reason why:
> after having taken a look on *LogImageFilter* and
> *LogImageAdaptor*, it seems that *the case where input data = 0* is
> not dealed with: log(x=0) returns a very big negative value equivalent
> to -infinite. So, when I applied a linear *rescaling* between 0 and
> 255, my rescaled data is in [-infinite, alpha].
>
> Here is why I did:
>
> *absFilter->SetInput( imageInitiale );*
> *logFilter->SetInput( absFilter->GetOutput() );
> rescaleFilter->SetInput( logFilter->GetOutput()) ;*
>
> **
>
> So I'm triing to implement my own *logImageAdaptor* to deal with the
> case where my input data is null.
>
> class LogPixelAccessor
> {
> public:
> typedef short InternalType;
> typedef short ExternalType;
>
> ExternalType Get( const InternalType & input ) const
> {
>
> return ( (input != 0) ? (ExternalType)log((double)input) : 0 );
>
> }
> };
>
> But I'm always having an error at execution that I can't solve: the
> debugger says error encounterd is in Set function of
> DefaultPixelAccessor class.
>
> class ITK_EXPORT DefaultPixelAccessor
> {
> public:
>
> /** External typedef. It defines the external aspect
> * that this class will exhibit. */
> typedef TType ExternalType ;
>
> /** Internal typedef. It defines the internal real
> * representation of data. */
> typedef TType InternalType ;
>
> * /** Set the pixel. */
> inline void Set(TType & output, const TType & input) const
> {output = input;}*
>
> --> Could anybody tell me why?
>
> isabelle
>
> */Kuba Bican <kuba at smyslzivota.cz>/* a écrit :
>
>
> Hi Isabelle,
>
> logarithmic scaling can be done by these filters:
>
> LogImageFilter (
> http://www.itk.org/Doxygen/html/classitk_1_1LogImageFilter.html )
> Log10ImageFilter (
> http://www.itk.org/Doxygen/html/classitk_1_1Log10ImageFilter.html )
>
> and/or adaptors:
>
> LogImageAdaptor (
> http://www.itk.org/Doxygen/html/classitk_1_1LogImageAdaptor.html )
> Log10ImageAdaptor (
> http://www.itk.org/Doxygen/html/classitk_1_1Log10ImageAdaptor.html )
>
> Hope this will help you.
>
> Regards,
> Jakub
>
>
>
> Renaud Isabelle napsal(a):
>
> > Hi Luis,
> >
> > In one of your numerous posted replies, you already mentioned
> the use
> > of *logarithmic scaling* to improve visualisation of images.
> >
> > "It is not rare to use a logarithmic intensity transformation in
> order
> > to display the FFT output and still be able to "see" something."
> >
> http://public.kitware.com/pipermail/insight-users/2004-November/011201.html
> >
> > This is actually what I need to do to improve the quality of my
> > ultrasonographic image.
> >
> > --> Could you tell me a way to perform this logarithmic scaling? Is
> > there already a function for that, or maybe could I compute my
> own one
> > if you tell me how to get access of the pixel data of my image
> > displayed with ITK and VTK.
> >
> > Thanks for answer,
> >
> > Isabelle
> >
> >
> ------------------------------------------------------------------------
> > *Appel audio GRATUIT partout dans le monde* avec le nouveau Yahoo!
> > Messenger
> > Téléchargez le ici !
> >
> >
> >
> >------------------------------------------------------------------------
> >
> >_______________________________________________
> >Insight-users mailing list
> >Insight-users at itk.org
> >http://www.itk.org/mailman/listinfo/insight-users
> >
> >
>
> ------------------------------------------------------------------------
> *Appel audio GRATUIT partout dans le monde* avec le nouveau Yahoo!
> Messenger
> Téléchargez le ici !
> <http://us.rd.yahoo.com/messenger/mail_taglines/default/*http://fr.messenger.yahoo.com>
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Insight-users mailing list
>Insight-users at itk.org
>http://www.itk.org/mailman/listinfo/insight-users
>
>
More information about the Insight-users
mailing list