VTK
vtkStatisticsAlgorithm.h
Go to the documentation of this file.
1/*=========================================================================
2
3Program: Visualization Toolkit
4Module: vtkStatisticsAlgorithm.h
5
6Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7All rights reserved.
8See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10This software is distributed WITHOUT ANY WARRANTY; without even
11the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12PURPOSE. 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
70class vtkStdString;
71class vtkStringArray;
72class vtkVariant;
73class vtkVariantArray;
74class vtkDoubleArray;
76
77class VTKFILTERSSTATISTICS_EXPORT vtkStatisticsAlgorithm : public vtkTableAlgorithm
78{
79public:
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
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
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
216
220 virtual void ResetRequests();
221
230
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,
284
290
291protected:
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*,
309
313 virtual void Derive( vtkMultiBlockDataSet* ) = 0;
314
318 virtual void Assess( vtkTable*,
320 vtkTable* ) = 0;
321
325 void Assess( vtkTable*,
327 vtkTable*,
328 int );
329
333 virtual void Test( vtkTable*,
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
353private:
354 vtkStatisticsAlgorithm(const vtkStatisticsAlgorithm&) VTK_DELETE_FUNCTION;
355 void operator=(const vtkStatisticsAlgorithm&) VTK_DELETE_FUNCTION;
356};
357
358#endif
Tests instantiations of the vtkNew class template.
Proxy object to connect input/output ports.
virtual void SetInputConnection(int port, vtkAlgorithmOutput *input)
Set the connection for the given input port index.
maintain an unordered list of data objects
general representation of visualization data
Definition: vtkDataObject.h:65
dynamic, self-adjusting array of double
a simple class to control print indentation
Definition: vtkIndent.h:40
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
Composite dataset that organizes datasets into blocks.
A base class for a functor that assesses data.
Base class for statistics algorithms.
virtual void SetAssessNames(vtkStringArray *)
Set/get assessment names.
virtual void SetColumnStatus(const char *namCol, int status)
Add or remove a column from the current analysis request.
virtual int GetColumnForRequest(vtkIdType r, vtkIdType c, vtkStdString &columnName)
~vtkStatisticsAlgorithm() override
virtual void ResetAllColumnStates()
Set the the status of each and every column in the current request to OFF (0).
virtual void SetInputModelConnection(vtkAlgorithmOutput *model)
A convenience method for setting the input model connection (if one is expected or allowed).
virtual const char * GetColumnForRequest(vtkIdType r, vtkIdType c)
Provide the name of the c-th column for the r-th request.
OutputIndices
enumeration values to specify output port types
virtual void ResetRequests()
Empty the list of current requests.
virtual vtkIdType GetNumberOfRequests()
Return the number of requests.
virtual void Aggregate(vtkDataObjectCollection *, vtkMultiBlockDataSet *)=0
Given a collection of models, calculate aggregate model.
void AddColumnPair(const char *namColX, const char *namColY)
Convenience method to create a request with a single column name pair (namColX, namColY) in a single ...
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void SetLearnOptionParameterConnection(vtkAlgorithmOutput *params)
A convenience method for setting learn input parameters (if one is expected or allowed).
virtual void SetInputModel(vtkDataObject *model)
A convenience method for setting the input model (if one is expected or allowed).
void AddColumn(const char *namCol)
Convenience method to create a request with a single column name namCol in a single call; this is the...
virtual int RequestSelectedColumns()
Use the current column status values to produce a new request for statistics to be produced when Requ...
virtual vtkIdType GetNumberOfColumnsForRequest(vtkIdType request)
Return the number of columns for a given request.
virtual bool SetParameter(const char *parameter, int index, vtkVariant value)
A convenience method (in particular for access from other applications) to set parameter values of Le...
virtual void SetLearnOptionParameters(vtkDataObject *params)
A convenience method for setting learn input parameters (if one is expected or allowed).
InputPorts
enumeration values to specify input port types
@ LEARN_PARAMETERS
Port 1 is for learn parameters (initial guesses, etc.)
@ INPUT_MODEL
Port 2 is for a priori models.
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:49
a vtkAbstractArray subclass for strings
Superclass for algorithms that produce only vtkTables as output.
void SetInputData(vtkDataObject *obj)
Assign a data object as input.
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:69
An array holding vtkVariants.
A atomic type representing the union of many types.
Definition: vtkVariant.h:76
@ info
Definition: vtkX3D.h:376
@ value
Definition: vtkX3D.h:220
@ port
Definition: vtkX3D.h:447
@ parameter
Definition: vtkX3D.h:443
@ index
Definition: vtkX3D.h:246
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
int vtkIdType
Definition: vtkType.h:287