- //--------------------------------------------------------------------
- class ImageToImageGenericFilterBase: public itk::Object {
-
- public:
- // constructor - destructor
- ImageToImageGenericFilterBase(std::string filterName);
- virtual ~ImageToImageGenericFilterBase() {}
-
- // Types
- typedef ImageToImageGenericFilterBase Self;
- typedef Object Superclass;
- typedef itk::SmartPointer<Self> Pointer;
- typedef itk::SmartPointer<const Self> ConstPointer;
-
- // Filters information
- const std::string & GetFilterName() { return mFilterName; }
- void SetFilterName(std::string & n) { mFilterName = n; }
-
- // Generic IO
- /// Returns the dimension and pixel type of the *first* input
- void GetInputImageDimensionAndPixelType(unsigned int& dim, std::string& pixeltype,unsigned int & components);
-
- // File IO
- void SetInputFilename(const std::string & filename);
- void AddInputFilename(const std::string & filename);
- void SetInputFilenames(const std::vector<std::string> & filenames);
- void SetOutputFilename(const std::string & filename);
- void AddOutputFilename(const std::string & filename);
- void SetOutputFilenames(const std::vector<std::string> & filenames);
- std::string GetOutputFilename();
- void SetIOVerbose(bool b) { mIOVerbose = b; }
-
- // VVImage IO
- void SetInputVVImage (vvImage::Pointer input);
- void SetInputVVImages (std::vector<vvImage::Pointer> input);
- void AddInputVVImage (vvImage::Pointer input);
- vvImage::Pointer GetOutputVVImage ();
- std::vector<vvImage::Pointer> GetOutputVVImages ();
-
- // Information on available image types
- void PrintAvailableImageTypes();
- bool CheckDimension(unsigned int d);
- bool CheckPixelType(std::string pt);
-
- // Main function to call for using the filter.
- virtual bool Update() = 0;
-
- // Use internally only (TO PUT PROTECTED !!!)
- void AddImageType(unsigned int d, std::string p);
-
- protected:
- /// Call this function to dispatch an output towards the correct sink
- template<class ImageType>
- void SetNextOutput(typename ImageType::Pointer output);
-
- /// Call this function to get the nth itk input image, regardless of input source
- template<class ImageType>
- typename ImageType::Pointer GetInput(unsigned int n);
-
- std::vector<std::string> mInputFilenames;
- std::list<std::string> mOutputFilenames;
-
- bool mIOVerbose;
- unsigned int mDim;
- std::string mPixelTypeName;
- unsigned int mNbOfComponents;
- std::string mFilterName;
-
- std::vector<vvImage::Pointer> mInputVVImages;
- std::vector<vvImage::Pointer> mOutputVVImages;
-
- std::vector<std::string> mListOfAllowedPixelType;
- std::vector<unsigned int> mListOfAllowedDimension;
- bool CheckImageType();
- bool CheckDimension();
- bool CheckPixelType();
- void ImageTypeError();
- void SetImageTypeError();
- bool mFailOnImageTypeError;
-
- }; // end class clitk::ImageToImageGenericFilter
-
-
- //--------------------------------------------------------------------