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  -------------------------------------------------------------------------*/
56 #ifndef vtkStatisticsAlgorithm_h
57 #define vtkStatisticsAlgorithm_h
58 
59 #include "vtkFiltersStatisticsModule.h" // For export macro
60 #include "vtkTableAlgorithm.h"
61 
64 class vtkStdString;
65 class vtkStringArray;
66 class vtkVariant;
67 class vtkVariantArray;
68 class vtkDoubleArray;
70 
71 class VTKFILTERSSTATISTICS_EXPORT vtkStatisticsAlgorithm : public vtkTableAlgorithm
72 {
73 public:
75  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
76 
81  {
82  INPUT_DATA = 0,
83  LEARN_PARAMETERS = 1,
84  INPUT_MODEL = 2
85  };
86 
91  {
92  OUTPUT_DATA = 0,
93  OUTPUT_MODEL = 1,
94  OUTPUT_TEST = 2
95  };
96 
103 
108  virtual void SetLearnOptionParameters( vtkDataObject* params )
110 
117 
122  virtual void SetInputModel( vtkDataObject* model )
124 
126 
129  vtkSetMacro( LearnOption, bool );
130  vtkGetMacro( LearnOption, bool );
132 
134 
137  vtkSetMacro( DeriveOption, bool );
138  vtkGetMacro( DeriveOption, bool );
140 
142 
145  vtkSetMacro( AssessOption, bool );
146  vtkGetMacro( AssessOption, bool );
148 
150 
153  vtkSetMacro( TestOption, bool );
154  vtkGetMacro( TestOption, bool );
156 
158 
161  vtkSetMacro( NumberOfPrimaryTables, vtkIdType );
162  vtkGetMacro( NumberOfPrimaryTables, vtkIdType );
164 
166 
169  virtual void SetAssessNames( vtkStringArray* );
170  vtkGetObjectMacro(AssessNames,vtkStringArray);
172 
174 
178  public:
179  virtual void operator() ( vtkDoubleArray*,
180  vtkIdType ) = 0;
181  virtual ~AssessFunctor() { }
182  };
184 
198  virtual void SetColumnStatus( const char* namCol, int status );
199 
203  virtual void ResetAllColumnStates();
204 
209  virtual int RequestSelectedColumns();
210 
214  virtual void ResetRequests();
215 
223  virtual vtkIdType GetNumberOfRequests();
224 
228  virtual vtkIdType GetNumberOfColumnsForRequest( vtkIdType request );
229 
243  virtual const char* GetColumnForRequest( vtkIdType r, vtkIdType c );
244 
245  virtual int GetColumnForRequest( vtkIdType r, vtkIdType c, vtkStdString& columnName );
246 
254  void AddColumn( const char* namCol );
255 
266  void AddColumnPair( const char* namColX, const char* namColY );
267 
275  virtual bool SetParameter( const char* parameter,
276  int index,
277  vtkVariant value );
278 
282  virtual void Aggregate( vtkDataObjectCollection*,
283  vtkMultiBlockDataSet* ) = 0;
284 
285 protected:
287  ~vtkStatisticsAlgorithm() VTK_OVERRIDE;
288 
289  int FillInputPortInformation( int port, vtkInformation* info ) VTK_OVERRIDE;
290  int FillOutputPortInformation( int port, vtkInformation* info ) VTK_OVERRIDE;
291 
292  int RequestData(
295  vtkInformationVector* ) VTK_OVERRIDE;
296 
300  virtual void Learn( vtkTable*,
301  vtkTable*,
302  vtkMultiBlockDataSet* ) = 0;
303 
307  virtual void Derive( vtkMultiBlockDataSet* ) = 0;
308 
312  virtual void Assess( vtkTable*,
313  vtkMultiBlockDataSet*,
314  vtkTable* ) = 0;
315 
319  void Assess( vtkTable*,
320  vtkMultiBlockDataSet*,
321  vtkTable*,
322  int );
323 
327  virtual void Test( vtkTable*,
328  vtkMultiBlockDataSet*,
329  vtkTable* ) = 0;
330 
334  virtual void SelectAssessFunctor( vtkTable* outData,
335  vtkDataObject* inMeta,
336  vtkStringArray* rowNames,
337  AssessFunctor*& dfunc ) = 0;
338 
339  vtkIdType NumberOfPrimaryTables;
340  bool LearnOption;
341  bool DeriveOption;
342  bool AssessOption;
343  bool TestOption;
344  vtkStringArray* AssessNames;
346 
347 private:
348  vtkStatisticsAlgorithm(const vtkStatisticsAlgorithm&) VTK_DELETE_FUNCTION;
349  void operator=(const vtkStatisticsAlgorithm&) VTK_DELETE_FUNCTION;
350 };
351 
352 #endif
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:41
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:345
Port 1 is for learn parameters (initial guesses, etc.)
A atomic type representing the union of many types.
Definition: vtkVariant.h:69
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:33
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:62
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:58
Port 2 is for a priori models.