X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpExtensions%2FVisualization%2FImageBlender.h;h=e4bf27c5bff9aef3653d620ee94e521d7531daa8;hb=73332fee95f5410c46e3b0cff1e2755d5e4a8b71;hp=7ccc86494c09d093dac237e5300bf0f4d0c18ba4;hpb=d5863750d8146d52ee20ce7835f5fb92e6d13fe9;p=cpPlugins.git diff --git a/lib/cpExtensions/Visualization/ImageBlender.h b/lib/cpExtensions/Visualization/ImageBlender.h index 7ccc864..e4bf27c 100644 --- a/lib/cpExtensions/Visualization/ImageBlender.h +++ b/lib/cpExtensions/Visualization/ImageBlender.h @@ -3,8 +3,7 @@ #include -#include -#include +#include #include @@ -13,6 +12,7 @@ namespace cpExtensions namespace Visualization { /** + * @note: Based on vtkImageWeightedSum */ class cpExtensions_EXPORT ImageBlender : public vtkThreadedImageAlgorithm @@ -21,39 +21,10 @@ namespace cpExtensions typedef ImageBlender Self; vtkTypeMacro( ImageBlender, vtkThreadedImageAlgorithm ); - vtkGetMacro( MaxWindow, double ); - vtkGetMacro( MaxLevel, double ); - vtkGetMacro( MinWindow, double ); - vtkGetMacro( MinLevel, double ); - vtkGetMacro( Window, double ); - vtkGetMacro( Level, double ); - - vtkSetMacro( MaxWindow, double ); - vtkSetMacro( MaxLevel, double ); - vtkSetMacro( MinWindow, double ); - vtkSetMacro( MinLevel, double ); - vtkSetMacro( Window, double ); - vtkSetMacro( Level, double ); - public: static Self* New( ); - void PrintSelf( std::ostream& os, vtkIndent indent ); - - unsigned int GetNumberOfImages( ) const; - 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( ); @@ -64,57 +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, N; - TColor( - const double& r = double( 1 ), - const double& g = double( 0 ), - const double& b = double( 0 ) - ) - : R( r ), - G( g ), - B( b ) - { - this->N = std::sqrt( ( r * r ) + ( g * g ) + ( b * b ) ); - } - }; - mutable std::map< unsigned int, TColor > Colors; - - double MaxWindow; - double MaxLevel; - double MinWindow; - double MinLevel; - double Window; - double Level; - - int m_Extent[ 6 ]; - double m_WLSlope; - double m_WLOffset; + std::vector< double > m_Ranges; }; } // ecapseman