17 #ifndef __vtkKWHistogram_h
18 #define __vtkKWHistogram_h
20 #include "vtkObject.h"
23 class vtkColorTransferFunction;
34 void PrintSelf(ostream& os, vtkIndent indent);
41 vtkGetVector2Macro(Range,
double);
45 vtkGetObjectMacro(Bins, vtkDoubleArray);
49 virtual vtkIdType GetNumberOfBins();
54 vtkSetMacro(MaximumNumberOfBins, vtkIdType);
55 vtkGetMacro(MaximumNumberOfBins, vtkIdType);
59 virtual double GetMinimumOccurence();
60 virtual double GetMaximumOccurence();
61 virtual double GetTotalOccurence();
65 virtual double GetOccurenceAtValue(
double value);
71 virtual double GetValueAtAccumulatedOccurence(
72 double acc,
double *exclude_value = 0);
77 virtual void BuildHistogram(vtkDataArray *scalars,
int component);
90 vtkSetVector2Macro(Range,
double);
95 virtual void EstimateHistogramRange(
96 vtkDataArray *scalars,
int component,
double range[2]);
113 virtual void AccumulateHistogram(vtkDataArray *scalars,
int component);
118 virtual void EmptyHistogram();
122 virtual void SetLogMode(
int);
123 vtkBooleanMacro(LogMode,
int);
124 vtkGetMacro(LogMode,
int);
132 vtkDoubleArray *Bins;
135 vtkIntArray *ImageCoordinates;
137 unsigned long LastImageBuildTime;
138 unsigned long LastTransferFunctionTime;
140 vtkIdType MaximumNumberOfBins;
142 virtual void ComputeStatistics();
143 unsigned long LastStatisticsBuildTime;
145 double MinimumOccurence;
146 double MaximumOccurence;
147 double TotalOccurence;
152 virtual void UpdateHistogram(
153 vtkDataArray *scalars,
int component,
int reset_range);
158 virtual void EstimateHistogramRangeAndNumberOfBins(
159 vtkDataArray *scalars,
int component,
160 double range[2], vtkIdType *nb_of_bins);
178 int IsEqualTo(
const ImageDescriptor *desc);
179 void Copy(
const ImageDescriptor *desc);
194 void SetRange(
double range0,
double range1);
195 void SetRange(
double range[2]);
199 void SetDimensions(
unsigned int width,
unsigned int height);
202 void SetColor(
double color[3]);
204 double BackgroundColor[3];
205 void SetBackgroundColor(
double color[3]);
207 double OutOfRangeColor[3];
208 void SetOutOfRangeColor(
double color[3]);
211 void SetGridColor(
double color[3]);
213 vtkColorTransferFunction *ColorTransferFunction;
228 double DefaultMaximumOccurence;
229 double LastMaximumOccurence;
232 virtual int IsImageUpToDate(
const ImageDescriptor *desc = 0);
233 virtual vtkImageData* GetImage(ImageDescriptor *desc);
234 virtual vtkIntArray* GetImageCoordinates(ImageDescriptor *desc);
239 vtkKWHistogram::ImageDescriptor *LastImageDescriptor;
242 virtual int RefreshImage(ImageDescriptor *desc);