freBinaryFunctorImageFilterControllerBase.txx

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   F.R.E.E. - flexible registration evaluation engine
00004   Version:   v.1.0.0
00005   Date:      $Date: 2006/09/01 12:00:00 $
00006   Module:    $RCSfile: freBinaryFunctorImageFilterControllerBase.txx,v $
00007   Language:  C++
00008 
00009 
00010 
00011   Copyright (c) 2007 Ralf o Floca (Department of Medical Informatics,
00012   Institute for Medical Biometry and Informatics, University of Heidelberg,
00013   Germany). All rights reserved.
00014   See FREECopyright.txt or http://www.mi.med.uni-hd.de/free/copyright.htm
00015   for details.
00016 
00017      This software is distributed WITHOUT ANY WARRANTY; without even 
00018      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00019      PURPOSE.  See the above copyright notices for more information.
00020 
00021 =========================================================================*/
00022 
00023 #ifndef __freBinaryFunctorImageFilterControllerBase_txx
00024 #define __freBinaryFunctorImageFilterControllerBase_txx
00025 
00026 #include "freBinaryFunctorImageFilterControllerBase.h"
00027 #include "freIntensityImageMediaController.h"
00028 
00029 namespace FREE
00030 {
00034 
00035 template <class TControlledFilter>
00036 ValidityTag::Pointer
00037 BinaryFunctorImageFilterControllerBase<TControlledFilter>::
00038 GetMediaValidityTagRequirement(const MediaID& mediaID, SessionComponentCache* pComponentCache) const
00039 {
00040   if (mediaID == "output")
00041   {
00042     ValidityTag::Pointer smpReq = ValidityTag::New(this->GetMediaValidityTag(mediaID,pComponentCache)->GetTimeStamp());
00043     this->CompareValidityTagRequirement("input",smpReq,pComponentCache);
00044     this->CompareValidityTagRequirement("input2",smpReq,pComponentCache);
00045     return smpReq;
00046   }
00047 
00048   return Superclass::GetMediaValidityTagRequirement(mediaID, pComponentCache);
00049 }
00050 
00051 template <class TControlledFilter>
00052 BinaryFunctorImageFilterControllerBase<TControlledFilter>::
00053 BinaryFunctorImageFilterControllerBase()
00054 {       
00055   //Profile settings
00056   this->UpdateControllerID(ControllerID::BinaryFunctorImageFilterControllerBase);
00057   this->m_Description = "Basic class for controller of itk based binary functor image filters.";
00058 };
00059 
00060 template <class TControlledFilter>
00061 void
00062 BinaryFunctorImageFilterControllerBase<TControlledFilter>::
00063 GenerateProfile(CtrlProfile::ControllerProfile& profile,
00064                 const SessionComponentCache* pComponentCache,
00065                 bool bRegardOldSetup) const
00066 {
00067   Superclass::GenerateProfile(profile,pComponentCache,bRegardOldSetup);
00068 
00069   //Media
00070   profile.MediaMap().AddMedia("input2",ControllerID::IntensityImageMediaControllerBase,DASet,ComponentType::InputImageType::ImageDimension);
00071 };
00072 
00073 template <class TControlledFilter>
00074 void
00075 BinaryFunctorImageFilterControllerBase<TControlledFilter>::
00076 SetMediaCasted(const MediaID& mediaID, GenericMediaType* pMedia, ComponentType* pComponent, SessionComponentCache* pComponentCache,
00077                SessionInfo* pSessionInfo) const
00078 {
00079   if (mediaID == "input2")
00080   {
00081     pComponent->SetInput2(dynamic_cast<typename TControlledFilter::Input2ImageType*>(pMedia));
00082     this->ActualizeMediaValidityTag("input",pComponentCache);
00083   }
00084   else Superclass::SetMediaCasted(mediaID, pMedia, pComponent, pComponentCache, pSessionInfo);
00085 }; 
00086 
00087 } //end of namespace free
00088 
00089 #endif

Generated at Sat Oct 13 15:19:50 2007 for f.r.e.e. - Flexible Registration and Evaluation Engine by doxygen 1.5.3 written by Dimitri van Heesch, © 1997-2000