[Insight-users] turn on/off a filter in pipeline

Renaud Isabelle renauisa at yahoo.fr
Thu Jul 7 16:10:23 EDT 2005


Hi again, 
 
Because anyway, I have to add a filter to cast data, I decided to change my AbsImageAdaptor in a AbsImageFilter. :-D 
 
Thanks again, you were very helpful.
 
Isabelle

Karthik Krishnan <Karthik.Krishnan at kitware.com> a écrit :
Yes, you are right. You could always cast the data type back to a common 
type as in, so your definitions of RescaleIntensityImageFilter are the 
samein both cases. You waste a cast operation though..

castFilter->SetInput( adaptor )
if (on)
{
logFilter->SetInput(castFilter);
rescaleFilter->SetInput( logFilter->GetOutput()) ;
}
else
{
rescaleFilter->SetInput( castFilter );
}

rescaleFilter->Update();

Renaud Isabelle wrote:

> Thanks.
> 
> But don't you think I will have to define 2 types of rescalefilter 
> such as:
> 
> typedef itk::RescaleIntensityImageFilter<*ImageType3D*, ImageType3D> 
> *RescaleWithLog*;
> typedef 
> itk::RescaleIntensityImageFilter<*ImageAdaptorType*, ImageType3D> 
> *RescaleWithoutLog*; 
> 
> Because, if on, the input of my rescale filter is a filter's output. 
> If off, the input of my rescale filter will be an ImageAdaptor. OR can 
> I switch so easily the input of my rescale filter?
> 
> Isabelle
>
> */Karthik Krishnan /* a écrit :
>
> if (on)
> {
> logFilter->SetInput( adaptor );
> rescaleFilter->SetInput( logFilter->GetOutput()) ;
> }
> else
> {
> rescaleFilter->SetInput( adaptor );
> }
>
> rescaleFilter->Update();
>
> Renaud Isabelle wrote:
>
> > Hi,
> >
> > I'm working on building an user interface in Visual C++ in order to
> > display medical images and execute some image processing.
> >
> > I would offer the choice to the user to execute some image
> processing
> > such as logarithmic scaling or not in order to improve
> visualization
> > of the image. (depending on the quality of the image displayed)
> >
> > Here is my actual pipeline:
> >
> > *adaptor->SetPixelAccessor(acessor); //*ImageAdaptor
> > * adaptor->SetImage(image);*
> > **
> > * logFilter->SetInput( adaptor ); //*LogImageFilter
> > * *
> > * rescaleFilter->SetInput( logFilter->GetOutput()
> > ); //*RescaleIntensityImageFilter
> > *
> > connector->SetInput( rescaleFilter->GetOutput()
> > ); //*ImageToVTKImageFilter
> > **
> > --> I would make turn on/off log filter () possible if user
> desires.
> > (by turn on/off a radio button). How could I proceed? Is it a
> way to
> > make it properly?
> >
> > Isabelle
> >
> > * *
> >
> > *
> > *
> >
> >
> >
> >
> ------------------------------------------------------------------------
> > *Appel audio GRATUIT partout dans le monde* avec le nouveau Yahoo!
> > Messenger
> > Téléchargez le ici !
> >
> >
> >
> >------------------------------------------------------------------------
> >
> >_______________________________________________
> >Insigh! t-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 ! 
> 
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>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 !  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20050707/878c3551/attachment-0001.html


More information about the Insight-users mailing list