#ifndef __CPEXTENSIONS__VISUALIZATION__IMAGEBLENDER__H__ #define __CPEXTENSIONS__VISUALIZATION__IMAGEBLENDER__H__ #include #include #include #include namespace cpExtensions { namespace Visualization { /** */ class cpExtensions_EXPORT ImageBlender : public vtkThreadedImageAlgorithm { public: typedef ImageBlender Self; vtkTypeMacro( ImageBlender, vtkThreadedImageAlgorithm ); public: static Self* New( ); void PrintSelf( std::ostream& os, vtkIndent indent ); unsigned int GetNumberOfImages( ) const; 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 ); protected: ImageBlender( ); virtual ~ImageBlender( ); int RequestInformation( vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector ); void ThreadedRequestData( vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector, 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 > m_Colors; double m_MaxWindow; double m_MaxLevel; double m_MinWindow; double m_MinLevel; double m_Window; double m_Level; int m_Extent[ 6 ]; double m_WLSlope; double m_WLOffset; }; } // ecapseman } // ecapseman #endif // __CPEXTENSIONS__VISUALIZATION__IMAGEBLENDER__H__ // eof - $RCSfile$