]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Visualization/ImageBlender.h
...
[cpPlugins.git] / lib / cpExtensions / Visualization / ImageBlender.h
index b74b51a9ce4d7fb706ecda5a299a0919e2f3b209..e4bf27c5bff9aef3653d620ee94e521d7531daa8 100644 (file)
@@ -3,7 +3,8 @@
 
 #include <cpExtensions/cpExtensions_Export.h>
 
-#include <map>
+#include <vector>
+
 #include <vtkThreadedImageAlgorithm.h>
 
 namespace cpExtensions
@@ -11,6 +12,7 @@ namespace cpExtensions
   namespace Visualization
   {
     /**
+     * @note: Based on vtkImageWeightedSum
      */
     class cpExtensions_EXPORT ImageBlender
       : public vtkThreadedImageAlgorithm
@@ -21,31 +23,8 @@ namespace cpExtensions
 
     public:
       static Self* New( );
-      void PrintSelf( std::ostream& os, vtkIndent indent );
-
-      const double& GetMaxWindow( ) const;
-      const double& GetMaxLevel( ) const;
-      const double& GetMinWindow( ) const;
-      const double& GetMinLevel( ) const;
-      const double& GetWindow( ) const;
-      const double& GetLevel( ) const;
-
-      void SetWindow( const double& w );
-      void SetLevel( const double& l );
-      void SetWindowLevel( const double& w, const double& l );
 
-      void GetColor(
-        const unsigned int& i,
-        double& r,
-        double& g,
-        double& b
-        ) const;
-      void SetColor(
-        const unsigned int& i,
-        const double& r,
-        const double& g,
-        const double& b
-        );
+      unsigned int GetNumberOfInputs( );
 
     protected:
       ImageBlender( );
@@ -56,51 +35,27 @@ namespace cpExtensions
         vtkInformationVector** inputVector,
         vtkInformationVector* outputVector
         );
+      int RequestData(
+        vtkInformation* request,
+        vtkInformationVector** inputVector,
+        vtkInformationVector* outputVector
+        );
       void ThreadedRequestData(
         vtkInformation* request,
         vtkInformationVector** inputVector,
         vtkInformationVector* outputVector,
-        vtkImageData*** inData,
-        vtkImageData** outData,
+        vtkImageData*** inData, vtkImageData** outData,
         int outExt[ 6 ], int id
         );
       int FillInputPortInformation( int i, vtkInformation* info );
 
-      void _GenerateData(
-        vtkImageData** inDatas,
-        int numInputs,
-        vtkImageData* outData,
-        int outExt[6],
-        int id
-        );
-
     private:
       // Purposely not implemented.
       ImageBlender( const Self& other );
       void operator=( const Self& other );
 
     protected:
-      struct TColor
-      {
-        double R, G, B;
-        TColor(
-          const double& r = double( 1 ),
-          const double& g = double( 0 ),
-          const double& b = double( 0 )
-          )
-          : R( r ),
-            G( g ),
-            B( b )
-          { }
-      };
-      mutable std::map< unsigned int, TColor > m_Colors;
-
-      double m_MaxWindow;
-      double m_MaxLevel;
-      double m_MinWindow;
-      double m_MinLevel;
-      double m_Window;
-      double m_Level;
+      std::vector< double > m_Ranges;
     };
 
   } // ecapseman