- //-----------------------------------------------------------
- // Constructor
- //-----------------------------------------------------------
- SetBackgroundGenericFilter::SetBackgroundGenericFilter()
- {
- m_Verbose=false;
- m_InputFileName="";
+//-----------------------------------------------------------
+// Constructor
+//-----------------------------------------------------------
+SetBackgroundGenericFilter::SetBackgroundGenericFilter()
+{
+ m_Verbose=false;
+ m_InputFileName="";
+}
+
+
+//-----------------------------------------------------------
+// Update
+//-----------------------------------------------------------
+void SetBackgroundGenericFilter::Update()
+{
+ // Read the Dimension and PixelType
+ int Dimension, Components;
+ std::string PixelType;
+ //ReadImageDimensionAndPixelType(m_InputFileName, Dimension, PixelType);
+ ReadImageDimensionAndPixelType(m_InputFileName, Dimension, PixelType, Components);
+
+ if (Dimension > 4) {
+ std::cout<<"Error, Only for 2 , 3 or 4 Dimensions!!!"<<std::endl ;
+ return;
+ }
+
+ if (Components > 3) {
+ std::cout<<"Error, Only 1, 2, or 3-component images are supported!!!"<<std::endl ;
+ return;