VTK
vtkStatisticsAlgorithm.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3 Program: Visualization Toolkit
4 Module: vtkStatisticsAlgorithm.h
5 
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*-------------------------------------------------------------------------
16  Copyright 2011 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19  -------------------------------------------------------------------------*/
62 #ifndef vtkStatisticsAlgorithm_h
63 #define vtkStatisticsAlgorithm_h
64 
65 #include "vtkFiltersStatisticsModule.h" // For export macro
66 #include "vtkTableAlgorithm.h"
67 
70 class vtkStdString;
71 class vtkStringArray;
72 class vtkVariant;
73 class vtkVariantArray;
74 class vtkDoubleArray;
76 
77 class VTKFILTERSSTATISTICS_EXPORT vtkStatisticsAlgorithm : public vtkTableAlgorithm
78 {
79 public:
81  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
82 
87  {
88  INPUT_DATA = 0,
89  LEARN_PARAMETERS = 1,
90  INPUT_MODEL = 2
91  };
92 
97  {
98  OUTPUT_DATA = 0,
99  OUTPUT_MODEL = 1,
100  OUTPUT_TEST = 2
101  };
102 
109 
114  virtual void SetLearnOptionParameters( vtkDataObject* params )
116 
123 
128  virtual void SetInputModel( vtkDataObject* model )
130 
132 
135  vtkSetMacro( LearnOption, bool );
136  vtkGetMacro( LearnOption, bool );
138 
140 
143  vtkSetMacro( DeriveOption, bool );
144  vtkGetMacro( DeriveOption, bool );
146 
148 
151  vtkSetMacro( AssessOption, bool );
152  vtkGetMacro( AssessOption, bool );
154 
156 
159  vtkSetMacro( TestOption, bool );
160  vtkGetMacro( TestOption, bool );
162 
164 
167  vtkSetMacro( NumberOfPrimaryTables, vtkIdType );
168  vtkGetMacro( NumberOfPrimaryTables, vtkIdType );
170 
172 
175  virtual void SetAssessNames( vtkStringArray* );
176  vtkGetObjectMacro(AssessNames,vtkStringArray);
178 
180 
184  public:
185  virtual void operator() ( vtkDoubleArray*,
186  vtkIdType ) = 0;
187  virtual ~AssessFunctor() { }
188  };
190 
204  virtual void SetColumnStatus( const char* namCol, int status );
205 
209  virtual void ResetAllColumnStates();
210 
215  virtual int RequestSelectedColumns();
216 
220  virtual void ResetRequests();
221 
229  virtual vtkIdType GetNumberOfRequests();
230 
234  virtual vtkIdType GetNumberOfColumnsForRequest( vtkIdType request );
235 
249  virtual const char* GetColumnForRequest( vtkIdType r, vtkIdType c );
250 
251  virtual int GetColumnForRequest( vtkIdType r, vtkIdType c, vtkStdString& columnName );
252 
260  void AddColumn( const char* namCol );
261 
272  void AddColumnPair( const char* namColX, const char* namColY );
273 
281  virtual bool SetParameter( const char* parameter,
282  int index,
283  vtkVariant value );
284 
288  virtual void Aggregate( vtkDataObjectCollection*,
289  vtkMultiBlockDataSet* ) = 0;
290 
291 protected:
293  ~vtkStatisticsAlgorithm() VTK_OVERRIDE;
294 
295  int FillInputPortInformation( int port, vtkInformation* info ) VTK_OVERRIDE;
296  int FillOutputPortInformation( int port, vtkInformation* info ) VTK_OVERRIDE;
297 
298  int RequestData(
301  vtkInformationVector* ) VTK_OVERRIDE;
302 
306  virtual void Learn( vtkTable*,
307  vtkTable*,
308  vtkMultiBlockDataSet* ) = 0;
309 
313  virtual void Derive( vtkMultiBlockDataSet* ) = 0;
314 
318  virtual void Assess( vtkTable*,
319  vtkMultiBlockDataSet*,
320  vtkTable* ) = 0;
321 
325  void Assess( vtkTable*,
326  vtkMultiBlockDataSet*,
327  vtkTable*,
328  int );
329 
333  virtual void Test( vtkTable*,
334  vtkMultiBlockDataSet*,
335  vtkTable* ) = 0;
336 
340  virtual void SelectAssessFunctor( vtkTable* outData,
341  vtkDataObject* inMeta,
342  vtkStringArray* rowNames,
343  AssessFunctor*& dfunc ) = 0;
344 
345  vtkIdType NumberOfPrimaryTables;
346  bool LearnOption;
347  bool DeriveOption;
348  bool AssessOption;
349  bool TestOption;
350  vtkStringArray* AssessNames;
352 
353 private:
354  vtkStatisticsAlgorithm(const vtkStatisticsAlgorithm&) VTK_DELETE_FUNCTION;
355  void operator=(const vtkStatisticsAlgorithm&) VTK_DELETE_FUNCTION;
356 };
357 
358 #endif
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:47
A base class for a functor that assesses data.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
An array holding vtkVariants.
Store vtkAlgorithm input/output information.
maintain an unordered list of data objects
InputPorts
enumeration values to specify input port types
Tests instantiations of the vtkNew class template.
virtual void SetInputModelConnection(vtkAlgorithmOutput *model)
A convenience method for setting the input model connection (if one is expected or allowed)...
a vtkAbstractArray subclass for strings
OutputIndices
enumeration values to specify output port types
int vtkIdType
Definition: vtkType.h:287
Port 1 is for learn parameters (initial guesses, etc.)
A atomic type representing the union of many types.
Definition: vtkVariant.h:75
Proxy object to connect input/output ports.
dynamic, self-adjusting array of double
Base class for statistics algorithms.
virtual void SetLearnOptionParameterConnection(vtkAlgorithmOutput *params)
A convenience method for setting learn input parameters (if one is expected or allowed).
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual void SetInputConnection(int port, vtkAlgorithmOutput *input)
Set the connection for the given input port index.
void SetInputData(vtkDataObject *obj)
Assign a data object as input.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:68
Composite dataset that organizes datasets into blocks.
Superclass for algorithms that produce only vtkTables as output.
Store zero or more vtkInformation instances.
virtual void SetInputModel(vtkDataObject *model)
A convenience method for setting the input model (if one is expected or allowed). ...
virtual void SetLearnOptionParameters(vtkDataObject *params)
A convenience method for setting learn input parameters (if one is expected or allowed).
general representation of visualization data
Definition: vtkDataObject.h:64
Port 2 is for a priori models.