VTK  9.7.1
vtkVisualStatistics.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright 2010 Sandia Corporation
3 // SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
16 #ifndef vtkVisualStatistics_h
17 #define vtkVisualStatistics_h
18 
20 #include "vtkFiltersStatisticsModule.h" // For export macro
21 
22 VTK_ABI_NAMESPACE_BEGIN
24 class vtkStringArray;
25 class vtkTable;
26 class vtkVariant;
27 class vtkDoubleArray;
28 
29 class VTKFILTERSSTATISTICS_EXPORT vtkVisualStatistics : public vtkDescriptiveStatistics
30 {
31 public:
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34  static vtkVisualStatistics* New();
35 
46  virtual void SetFieldRange(const char* field, double lo, double hi);
47  virtual void SetFieldRange(const std::string& field, double lo, double hi);
48 
50  virtual void ResetFieldRanges() { this->FieldRanges.clear(); }
51 
73  vtkSetClampMacro(NumberOfBins, int, 1, VTK_INT_MAX - 3);
74  vtkGetMacro(NumberOfBins, int);
75 
80  vtkDataArray* GetHistogramForField(const std::string& fieldName);
81 
83  void AppendAlgorithmParameters(std::string& algorithmParameters) const override;
84 
87  vtkStringToken parameterName, const std::string& algorithmParameters) override;
88 
89 protected:
91  ~vtkVisualStatistics() override;
92 
97  void Learn(vtkTable*, vtkTable*, vtkStatisticalModel*) override;
98 
102  void Derive(vtkStatisticalModel*) override;
103 
108 
109 private:
110  std::map<std::string, std::pair<double, double>> FieldRanges;
111  int NumberOfBins{ 512 };
112 
113  vtkVisualStatistics(const vtkVisualStatistics&) = delete;
114  void operator=(const vtkVisualStatistics&) = delete;
115 };
116 
117 VTK_ABI_NAMESPACE_END
118 #endif
void Learn(vtkTable *, vtkTable *, vtkStatisticalModel *) override
Execute the calculations required by the Learn option, given some input Data NB: input parameters are...
a base class for statistical modeling of other data
maintain an unordered list of data objects
#define VTK_INT_MAX
Definition: vtkType.h:192
std::size_t ConsumeNextAlgorithmParameter(vtkStringToken parameterName, const std::string &algorithmParameters) override
Implement the inverse of GetAlgorithmParameters(): given a parameter, update this algorithm...
A class to provide normality estimation and binned histogram data to render.
a vtkAbstractArray subclass for strings
A type representing the union of many types.
Definition: vtkVariant.h:52
dynamic, self-adjusting array of double
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:28
void Derive(vtkStatisticalModel *) override
Execute the calculations required by the Derive option.
abstract superclass for arrays of numeric data
Definition: vtkDataArray.h:44
bool Aggregate(vtkDataObjectCollection *, vtkStatisticalModel *) override
Given a collection of models, calculate aggregate model.
Represent a string by its integer hash.
A class for univariate descriptive statistics.
void AppendAlgorithmParameters(std::string &algorithmParameters) const override
Provide a string that can be used to recreate an instance of this algorithm.
static vtkDescriptiveStatistics * New()
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:59
virtual void ResetFieldRanges()
Clear all field ranges from this filter.