Program: clitk
Module: $RCSfile: clitkImageToImageGenericFilter.h,v $
Language: C++
- Date: $Date: 2010/02/09 14:19:28 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2010/02/09 14:40:55 $
+ Version: $Revision: 1.7 $
Author : Joel Schaerer <joel.schaerer@creatis.insa-lyon.fr>
David Sarrut <david.sarrut@creatis.insa-lyon.fr>
// constructor - destructor
ImageToImageGenericFilter(std::string filterName);
- virtual ~ImageToImageGenericFilter() { delete mImageTypesManager; }
// Main function to call for using the filter.
virtual bool Update();
protected:
// Object that will manage the list of templatized function for
// each image type.
- ImageTypesManager<FilterType> * mImageTypesManager;
+ ImageTypesManager<FilterType> mImageTypesManager;
}; // end class clitk::ImageToImageGenericFilter
// #define ADD_IMAGE_DIMENSION(DIM) Initialize<DIM>();
-#define ADD_VEC_IMAGE_TYPE(DIM, COMP, PT) this->mImageTypesManager->template AddNewDimensionAndPixelType<DIM,COMP, PT>();
-#define ADD_IMAGE_TYPE(DIM, PT) this->mImageTypesManager->template AddNewDimensionAndPixelType<DIM, PT>();
+#define ADD_VEC_IMAGE_TYPE(DIM, COMP, PT) this->mImageTypesManager.template AddNewDimensionAndPixelType<DIM,COMP, PT>();
+#define ADD_IMAGE_TYPE(DIM, PT) this->mImageTypesManager.template AddNewDimensionAndPixelType<DIM, PT>();
#include "clitkImageToImageGenericFilter.txx"
Program: vv
Module: $RCSfile: clitkImageToImageGenericFilter.txx,v $
Language: C++
- Date: $Date: 2010/02/09 14:19:28 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2010/02/09 14:40:55 $
+ Version: $Revision: 1.4 $
Author : Joel Schaerer <joel.schaerer@creatis.insa-lyon.fr>
David Sarrut <david.sarrut@creatis.insa-lyon.fr>
//--------------------------------------------------------------------
template<class FilterType>
-clitk::ImageToImageGenericFilter<FilterType>::ImageToImageGenericFilter(std::string filterName)
- :ImageToImageGenericFilterBase(filterName){
- // Create main function manager
- this->mImageTypesManager = new
- ImageTypesManager<FilterType>(static_cast<FilterType*>(this));
+clitk::ImageToImageGenericFilter<FilterType>::ImageToImageGenericFilter(std::string filterName) :
+ ImageToImageGenericFilterBase(filterName),
+ mImageTypesManager(static_cast<FilterType*>(this))
+{
}
//--------------------------------------------------------------------
}
// Go ! Call the right templatized function
- mImageTypesManager->DoIt(mDim, mNbOfComponents, mPixelTypeName);
+ mImageTypesManager.DoIt(mDim, mNbOfComponents, mPixelTypeName);
return true;
}
//--------------------------------------------------------------------
template<class FilterType>
bool clitk::ImageToImageGenericFilter<FilterType>::CheckImageType(unsigned int dim,unsigned int ncomp, std::string pixeltype)
{
- return static_cast<bool>(mImageTypesManager->mMapOfImageTypeToFunction[dim][ncomp][pixeltype]);
+ return static_cast<bool>(mImageTypesManager.mMapOfImageTypeToFunction[dim][ncomp][pixeltype]);
}
template<class FilterType>
bool clitk::ImageToImageGenericFilter<FilterType>::CheckImageType()
{
- return static_cast<bool>(mImageTypesManager->mMapOfImageTypeToFunction[mDim][mNbOfComponents][mPixelTypeName]);
+ return static_cast<bool>(mImageTypesManager.mMapOfImageTypeToFunction[mDim][mNbOfComponents][mPixelTypeName]);
}
template<class FilterType>
typedef typename ImageTypesManager<FilterType>::MapOfImageComponentsToFunctionType::const_iterator MCompItType;
typedef typename ImageTypesManager<FilterType>::MapOfImageDimensionToFunctionType::const_iterator MDimItType;
typedef typename ImageTypesManager<FilterType>::MapOfPixelTypeToFunctionType::const_iterator MPixelItType;
- for (MDimItType i=mImageTypesManager->mMapOfImageTypeToFunction.begin();
- i!=mImageTypesManager->mMapOfImageTypeToFunction.end();
+ for (MDimItType i=mImageTypesManager.mMapOfImageTypeToFunction.begin();
+ i!=mImageTypesManager.mMapOfImageTypeToFunction.end();
i++) {
for (MCompItType j=(*i).second.begin(); j!= (*i).second.end(); j++) {
for (MPixelItType k=(*j).second.begin(); k!= (*j).second.end(); k++) {