/*=========================================================================
+ Program: vv http://www.creatis.insa-lyon.fr/rio/vv
- Program: clitk
- Module: $RCSfile: clitkImageToImageGenericFilterBase.h,v $
- Language: C++
- Date: $Date: 2010/03/24 10:48:05 $
- Version: $Revision: 1.3 $
- Author : Joel Schaerer <joel.schaerer@creatis.insa-lyon.fr>
- David Sarrut <david.sarrut@creatis.insa-lyon.fr>
+ 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
- Copyright (C) 2008
- Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
- CREATIS-LRMN 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.
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, version 3 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- =========================================================================*/
+ 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
+// clitk
#include "clitkCommon.h"
#include "clitkImageCommon.h"
#include "clitkCommonGenericFilter.h"
-// itk include
+// itk
#include <itkImage.h>
-// vv include
+// vv
#include "vvImage.h"
#include "vvFromITK.h"
#include "vvToITK.h"
// 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
virtual bool Update() = 0;
protected:
- bool mReadOnDisk;
+ bool m_ReadOnDisk;
/// Call this function to dispatch an output towards the correct sink
template<class ImageType>
void SetNextOutput(typename ImageType::Pointer output);
template<class ImageType>
typename ImageType::Pointer GetInput(unsigned int n);
- std::vector<std::string> mInputFilenames;
- std::list<std::string> mOutputFilenames;
+ std::vector<std::string> m_InputFilenames;
+ std::list<std::string> 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<vvImage::Pointer> mInputVVImages;
- std::vector<vvImage::Pointer> mOutputVVImages;
+ std::vector<vvImage::Pointer> m_InputVVImages;
+ std::vector<vvImage::Pointer> 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<DIM,COMP, PT>();
#define ADD_IMAGE_TYPE(DIM, PT) this->mImageTypesManager.template AddNewDimensionAndPixelType<DIM, PT>();
+#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"