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

Karthik Krishnan Karthik.Krishnan at kitware.com
Thu Jul 7 15:49:50 EDT 2005


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 <Karthik.Krishnan at kitware.com>/* 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 ! 
> <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 vtkusers mailing list