00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00030 #ifndef __vtkImageWeightedSum_h
00031 #define __vtkImageWeightedSum_h
00032
00033 #include "vtkThreadedImageAlgorithm.h"
00034
00035 class vtkDoubleArray;
00036 class VTK_IMAGING_EXPORT vtkImageWeightedSum : public vtkThreadedImageAlgorithm
00037 {
00038 public:
00039 static vtkImageWeightedSum *New();
00040 vtkTypeRevisionMacro(vtkImageWeightedSum,vtkThreadedImageAlgorithm);
00041 void PrintSelf(ostream& os, vtkIndent indent);
00042
00044
00046 virtual void SetWeights(vtkDoubleArray*);
00047 vtkGetObjectMacro(Weights, vtkDoubleArray);
00049
00051 virtual void SetWeight(vtkIdType id, double weight);
00052
00054
00058 vtkGetMacro(NormalizeByWeight, int);
00059 vtkSetClampMacro(NormalizeByWeight, int, 0, 1);
00060 vtkBooleanMacro(NormalizeByWeight, int);
00062
00064 double CalculateTotalWeight();
00065
00066 protected:
00067 vtkImageWeightedSum();
00068 ~vtkImageWeightedSum();
00069
00070
00071 vtkDoubleArray *Weights;
00072
00073
00074 int NormalizeByWeight;
00075
00076 int RequestInformation (vtkInformation * vtkNotUsed(request),
00077 vtkInformationVector** vtkNotUsed( inputVector ),
00078 vtkInformationVector *outputVector);
00079
00080 void ThreadedRequestData (vtkInformation* request,
00081 vtkInformationVector** inputVector,
00082 vtkInformationVector* outputVector,
00083 vtkImageData ***inData, vtkImageData **outData,
00084 int ext[6], int id);
00085 int FillInputPortInformation(int i, vtkInformation* info);
00086
00087 private:
00088 vtkImageWeightedSum(const vtkImageWeightedSum&);
00089 void operator=(const vtkImageWeightedSum&);
00090 };
00091
00092 #endif
00093