]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Visualization/ImageBlender.h
Double click widget integrated with segmentation and deformation filters.
[cpPlugins.git] / lib / cpExtensions / Visualization / ImageBlender.h
index 6ba1a43137a7f52801249c896fb14ce9ffb4c445..f12282295da44d6ac107d962d3cd8b1648a207b8 100644 (file)
@@ -3,7 +3,9 @@
 
 #include <cpExtensions/cpExtensions_Export.h>
 
+#include <cmath>
 #include <map>
+
 #include <vtkThreadedImageAlgorithm.h>
 
 namespace cpExtensions
@@ -84,7 +86,7 @@ namespace cpExtensions
     protected:
       struct TColor
       {
-        double R, G, B;
+        double R, G, B, N;
         TColor(
           const double& r = double( 1 ),
           const double& g = double( 0 ),
@@ -93,7 +95,9 @@ namespace cpExtensions
           : R( r ),
             G( g ),
             B( b )
-          { }
+          {
+            this->N = std::sqrt( ( r * r ) + ( g * g ) + ( b * b ) );
+          }
       };
       mutable std::map< unsigned int, TColor > m_Colors;