X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FclitkImageToImageGenericFilterBase.h;h=2d624baecef67ecb87d25124528c9c4f5940f09f;hb=ccf3ed5310ce0983c1335dcfc699e7c3b8267ba4;hp=2b40e127541b11078c5d3d6ffde8f51ff6114e23;hpb=0083c3fb2c66812489631c7551709d121de51625;p=clitk.git diff --git a/common/clitkImageToImageGenericFilterBase.h b/common/clitkImageToImageGenericFilterBase.h index 2b40e12..2d624ba 100644 --- a/common/clitkImageToImageGenericFilterBase.h +++ b/common/clitkImageToImageGenericFilterBase.h @@ -1,13 +1,32 @@ +/*========================================================================= + Program: vv http://www.creatis.insa-lyon.fr/rio/vv + + Authors belong to: + - University of LYON http://www.universite-lyon.fr/ + - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr + - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the copyright notices for more information. + + It is distributed under dual licence + + - BSD See included LICENSE.txt file + - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html +======================================================================-====*/ #ifndef CLITKIMAGETOIMAGEGENERICFILTERBASE_H #define CLITKIMAGETOIMAGEGENERICFILTERBASE_H + +// clitk #include "clitkCommon.h" #include "clitkImageCommon.h" #include "clitkCommonGenericFilter.h" -// itk include +// itk #include -// vv include +// vv #include "vvImage.h" #include "vvFromITK.h" #include "vvToITK.h" @@ -31,6 +50,11 @@ namespace clitk { // Filters information const std::string & GetFilterName(); void SetFilterName(std::string & n); + + // Error management + itkSetMacro(LastError, std::string); + itkGetConstMacro(LastError, std::string); + bool HasError() { return (GetLastError() != ""); } // Generic IO /// Returns the dimension and pixel type of the *first* input @@ -66,7 +90,7 @@ namespace clitk { virtual bool Update() = 0; protected: - bool mReadOnDisk; + bool m_ReadOnDisk; /// Call this function to dispatch an output towards the correct sink template void SetNextOutput(typename ImageType::Pointer output); @@ -75,26 +99,35 @@ namespace clitk { template typename ImageType::Pointer GetInput(unsigned int n); - std::vector mInputFilenames; - std::list mOutputFilenames; + std::vector m_InputFilenames; + std::list m_OutputFilenames; - bool mIOVerbose; - unsigned int mDim; - std::string mPixelTypeName; - unsigned int mNbOfComponents; - std::string mFilterName; + bool m_IOVerbose; + unsigned int m_Dim; + std::string m_PixelTypeName; + unsigned int m_NbOfComponents; + std::string m_FilterName; - std::vector mInputVVImages; - std::vector mOutputVVImages; + std::vector m_InputVVImages; + std::vector m_OutputVVImages; void ImageTypeError(); void SetImageTypeError(); - bool mFailOnImageTypeError; + bool m_FailOnImageTypeError; + + std::string m_LastError; }; // end class clitk::ImageToImageGenericFilter #define ADD_VEC_IMAGE_TYPE(DIM, COMP, PT) this->mImageTypesManager.template AddNewDimensionAndPixelType(); #define ADD_IMAGE_TYPE(DIM, PT) this->mImageTypesManager.template AddNewDimensionAndPixelType(); +#define ADD_DEFAULT_IMAGE_TYPES(DIM) ADD_IMAGE_TYPE(DIM, char); \ + ADD_IMAGE_TYPE(DIM, uchar); \ + ADD_IMAGE_TYPE(DIM, short); \ + ADD_IMAGE_TYPE(DIM, ushort); \ + ADD_IMAGE_TYPE(DIM, int); \ + ADD_IMAGE_TYPE(DIM, float); \ + ADD_IMAGE_TYPE(DIM, double); //#include "clitkImageToImageGenericFilterBase.txx"