00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00037 #ifndef __vtkImageColorMerge_h
00038 #define __vtkImageColorMerge_h
00039
00040 #include "vtkIntensityTransferFunction.h"
00041 #include "vtkColorTransferFunction.h"
00042
00043 #include "vtkThreadedImageAlgorithm.h"
00044
00045 class VTK_IMAGING_EXPORT vtkImageColorMerge : public vtkThreadedImageAlgorithm
00046 {
00047 public:
00048 static vtkImageColorMerge *New();
00049 vtkTypeRevisionMacro(vtkImageColorMerge, vtkThreadedImageAlgorithm);
00050
00051 void PrintSelf(ostream& os, vtkIndent indent);
00052 vtkColorTransferFunction* GetColorTransferFunction(int i) { return ColorTransferFunctions[i]; }
00053 vtkIntensityTransferFunction* GetIntensityTransferFunction(int i) { return IntensityTransferFunctions[i]; }
00054
00055 void AddLookupTable(vtkColorTransferFunction* ctf) {
00056 ColorTransferFunctions[CTFCount++] = ctf; this->Modified();
00057 }
00058
00059 void AddIntensityTransferFunction(vtkIntensityTransferFunction* itf) {
00060 IntensityTransferFunctions[ITFCount++] = itf;
00061 this->Modified();
00062 }
00063 vtkGetMacro(ITFCount,int);
00064 vtkGetMacro(CTFCount,int);
00065
00066 vtkBooleanMacro(BuildAlpha,int);
00067 vtkSetMacro(BuildAlpha,int);
00068 vtkGetMacro(BuildAlpha,int);
00069
00071
00073 vtkBooleanMacro(MaximumMode,int);
00074 vtkSetMacro(MaximumMode,int);
00075 vtkGetMacro(MaximumMode,int);
00076
00077
00078
00079 vtkBooleanMacro(LuminanceMode,int);
00080 vtkSetMacro(LuminanceMode,int);
00081 vtkGetMacro(LuminanceMode,int);
00082
00083
00084
00085 vtkBooleanMacro(AverageMode,int);
00086 vtkSetMacro(AverageMode,int);
00087 vtkGetMacro(AverageMode,int);
00089
00090
00091 vtkSetMacro(AverageThreshold,int);
00092 vtkGetMacro(AverageThreshold,int);
00093
00094 protected:
00095 vtkImageColorMerge();
00096 ~vtkImageColorMerge();
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108 virtual int RequestInformation (vtkInformation *, vtkInformationVector **,
00109 vtkInformationVector *);
00110
00111
00112
00113 void ThreadedRequestData (vtkInformation* request,
00114 vtkInformationVector** inputVector,
00115 vtkInformationVector* outputVector,
00116 vtkImageData ***inData, vtkImageData **outData,
00117 int ext[6], int id);
00118
00119
00120 virtual int FillInputPortInformation(int, vtkInformation*);
00121
00122 void InitOutput(int outExt[6], vtkImageData *outData);
00123
00124 void ClearItfs();
00125
00126 private:
00127 vtkImageColorMerge(const vtkImageColorMerge&);
00128 void operator=(const vtkImageColorMerge&);
00129
00130 vtkIntensityTransferFunction* IntensityTransferFunctions[10];
00131 vtkColorTransferFunction* ColorTransferFunctions[10];
00132 int ITFCount;
00133 int CTFCount;
00134 int BuildAlpha;
00135
00136 int AverageMode;
00137 int AverageThreshold;
00138 int MaximumMode;
00139 int LuminanceMode;
00140
00141 };
00142
00143 #endif
00144
00145
00146
00147