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 2010 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  -------------------------------------------------------------------------*/
57 #ifndef __vtkStatisticsAlgorithm_h
58 #define __vtkStatisticsAlgorithm_h
59 
60 #include "vtkTableAlgorithm.h"
61 
64 class vtkStdString;
65 class vtkStringArray;
66 class vtkVariant;
67 class vtkVariantArray;
69 
71 {
72 public:
74  void PrintSelf(ostream& os, vtkIndent indent);
75 
76 //BTX
78 
80  {
81  INPUT_DATA = 0,
82  LEARN_PARAMETERS = 1,
83  INPUT_MODEL = 2
84  };
86 
88 
90  {
91  OUTPUT_DATA = 0,
92  OUTPUT_MODEL = 1,
93  ASSESSMENT = 2,
94  OUTPUT_TEST = 2
95  };
96 //ETX
98 
100 
106 
108 
111  virtual void SetLearnOptionParameters( vtkDataObject* params )
114 
116 
122 
124 
126  virtual void SetInputModel( vtkDataObject* model )
127  { this->SetInput( vtkStatisticsAlgorithm::INPUT_MODEL, model ); }
129 
131 
132  vtkSetMacro( LearnOption, bool );
133  vtkGetMacro( LearnOption, bool );
135 
137 
138  vtkSetMacro( DeriveOption, bool );
139  vtkGetMacro( DeriveOption, bool );
141 
143 
144  vtkSetMacro( AssessOption, bool );
145  vtkGetMacro( AssessOption, bool );
147 
149 
150  vtkSetMacro( TestOption, bool );
151  vtkGetMacro( TestOption, bool );
153 
155 
156  vtkSetMacro( NumberOfPrimaryTables, vtkIdType );
157  vtkGetMacro( NumberOfPrimaryTables, vtkIdType );
159 
161 
162  virtual void SetAssessParameters( vtkStringArray* );
163  vtkGetObjectMacro(AssessParameters,vtkStringArray);
165 
167 
168  virtual void SetAssessNames( vtkStringArray* );
169  vtkGetObjectMacro(AssessNames,vtkStringArray);
171 
173  void SetAssessOptionParameter( vtkIdType id, vtkStdString name );
174 
176  vtkStdString GetAssessParameter( vtkIdType id );
177 
178 //BTX
180 
182  public:
183  virtual void operator() ( vtkVariantArray*,
184  vtkIdType ) = 0;
185  virtual ~AssessFunctor() { }
186  };
187 //ETX
189 
201  virtual void SetColumnStatus( const char* namCol, int status );
202 
205  virtual void ResetAllColumnStates();
206 
210  virtual int RequestSelectedColumns();
211 
213  virtual void ResetRequests();
214 
220  virtual vtkIdType GetNumberOfRequests();
221 
223  virtual vtkIdType GetNumberOfColumnsForRequest( vtkIdType request );
224 
226 
235  virtual const char* GetColumnForRequest( vtkIdType r, vtkIdType c );
236  //BTX
237  virtual int GetColumnForRequest( vtkIdType r, vtkIdType c, vtkStdString& columnName );
238  //ETX
240 
242 
247  virtual bool SetParameter( const char* parameter,
248  int index,
249  vtkVariant value );
251 
253 
254  virtual void Aggregate( vtkDataObjectCollection*,
255  vtkMultiBlockDataSet* ) = 0;
257 
258 protected:
261 
262  virtual int FillInputPortInformation( int port, vtkInformation* info );
263  virtual int FillOutputPortInformation( int port, vtkInformation* info );
264 
265  virtual int RequestData(
269 
271 
273  virtual void Learn( vtkTable*,
274  vtkTable*,
275  vtkMultiBlockDataSet* ) = 0;
277 
279  virtual void Derive( vtkMultiBlockDataSet* ) = 0;
280 
282 
283  virtual void Assess( vtkTable*,
285  vtkTable* ) = 0;
287 
289 
290  virtual void Test( vtkTable*,
292  vtkTable* ) = 0;
294 
295  //BTX
297 
298  virtual void SelectAssessFunctor( vtkTable* outData,
299  vtkDataObject* inMeta,
300  vtkStringArray* rowNames,
301  AssessFunctor*& dfunc ) = 0;
302  //ETX
304 
313 
314 private:
315  vtkStatisticsAlgorithm(const vtkStatisticsAlgorithm&); // Not implemented
316  void operator=(const vtkStatisticsAlgorithm&); // Not implemented
317 };
318 
319 #endif
virtual int FillOutputPortInformation(int port, vtkInformation *info)
Wrapper around vtkstd::string to keep symbols short.
Definition: vtkStdString.h:45
void PrintSelf(ostream &os, vtkIndent indent)
vtkStatisticsAlgorithmPrivate * Internals
An array holding vtkVariants.
Store vtkAlgorithm input/output information.
maintain an unordered list of data objects
virtual void SetInputModelConnection(vtkAlgorithmOutput *model)
a vtkAbstractArray subclass for strings
int vtkIdType
Definition: vtkType.h:255
Port 1 is for learn parameters (initial guesses, etc.)
A atomic type representing the union of many types.
Definition: vtkVariant.h:72
Proxy object to connect input/output ports.
Base class for statistics algorithms.
virtual void SetLearnOptionParameterConnection(vtkAlgorithmOutput *params)
a simple class to control print indentation
Definition: vtkIndent.h:37
virtual void SetInputConnection(int port, vtkAlgorithmOutput *input)
virtual int FillInputPortInformation(int port, vtkInformation *info)
void SetInput(vtkDataObject *obj)
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:66
#define VTK_INFOVIS_EXPORT
virtual int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector)
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)
virtual void SetLearnOptionParameters(vtkDataObject *params)
general representation of visualization data
Definition: vtkDataObject.h:70
Port 2 is for a priori models.