VTK
vtkSimilarityBalls.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkSimilarityBalls.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 
17 Copyright (c) 2017, Los Alamos National Security, LLC
18 
19 All rights reserved.
20 
21 Copyright 2017. Los Alamos National Security, LLC.
22 This software was produced under U.S. Government contract DE-AC52-06NA25396
23 for Los Alamos National Laboratory (LANL), which is operated by
24 Los Alamos National Security, LLC for the U.S. Department of Energy.
25 The U.S. Government has rights to use, reproduce, and distribute this software.
26 NEITHER THE GOVERNMENT NOR LOS ALAMOS NATIONAL SECURITY, LLC MAKES ANY WARRANTY,
27 EXPRESS OR IMPLIED, OR ASSUMES ANY LIABILITY FOR THE USE OF THIS SOFTWARE.
28 If software is modified to produce derivative works, such modified software
29 should be clearly marked, so as not to confuse it with the version available
30 from LANL.
31 
32 Additionally, redistribution and use in source and binary forms, with or
33 without modification, are permitted provided that the following conditions
34 are met:
35 - Redistributions of source code must retain the above copyright notice,
36  this list of conditions and the following disclaimer.
37 - Redistributions in binary form must reproduce the above copyright notice,
38  this list of conditions and the following disclaimer in the documentation
39  and/or other materials provided with the distribution.
40 - Neither the name of Los Alamos National Security, LLC, Los Alamos National
41  Laboratory, LANL, the U.S. Government, nor the names of its contributors
42  may be used to endorse or promote products derived from this software
43  without specific prior written permission.
44 
45 THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND CONTRIBUTORS
46 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
47 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
48 ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS NATIONAL SECURITY, LLC OR
49 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
50 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
51 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
52 OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
53 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
54 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
55 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
56 
57 =========================================================================*/
85 #ifndef vtkSimilarityBalls_h
86 #define vtkSimilarityBalls_h
87 
88 #include "vtkDataSetAlgorithm.h"
89 #include "vtkFiltersMomentInvariantsModule.h" // For export macro
90 
91 #include <vector> // Needed for internal API
92 
93 class vtkImageData;
94 
95 class VTKFILTERSMOMENTINVARIANTS_EXPORT vtkSimilarityBalls : public vtkDataSetAlgorithm
96 {
97 public:
101  static vtkSimilarityBalls* New();
102 
107 
112  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
113 
118  void SetSimilarityData(vtkDataObject* input) { this->SetInputData(0, input); };
119 
125  {
126  this->SetInputConnection(0, algOutput);
127  };
128 
134  void SetGridData(vtkDataObject* input) { this->SetInputData(1, input); };
135 
141  void SetGridConnection(vtkAlgorithmOutput* algOutput) { this->SetInputConnection(1, algOutput); };
142 
146  vtkSetMacro(KindOfMaxima, int);
147  vtkGetMacro(KindOfMaxima, int);
148 
149 protected:
154 
158  ~vtkSimilarityBalls() VTK_OVERRIDE;
159 
165  int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) VTK_OVERRIDE;
166 
170  int RequestUpdateExtent(vtkInformation*,
172  vtkInformationVector*) VTK_OVERRIDE;
173 
174 private:
175  vtkSimilarityBalls(const vtkSimilarityBalls&) = delete;
176  void operator=(const vtkSimilarityBalls&) = delete;
177 
181  int Dimension;
182 
190  int KindOfMaxima;
191 
197  int FillInputPortInformation(int port, vtkInformation* info) override;
198 
208  int FillOutputPortInformation(int port, vtkInformation* info) override;
209 
215  void CheckValidity(vtkImageData* similarityData, vtkImageData* gridData);
216 
221  void InterpretSimilarityData(vtkImageData* similarityData);
222 
232  void LocalMaxSimilarity(vtkImageData* similarityData, vtkImageData* localMaxData);
233 
244  void Balls(vtkImageData* localMaxData,
245  vtkImageData* gridData,
246  vtkImageData* ballsData,
247  vtkImageData* spheresData);
248 };
249 
250 #endif
void SetSimilarityConnection(vtkAlgorithmOutput *algOutput)
standard pipeline input for port 1 This is the similarity data as produced by vtkMomentInvariants.
Store vtkAlgorithm input/output information.
void SetGridData(vtkDataObject *input)
standard pipeline input for port 1 This vtkImageData input steers the resolution of the balls...
void SetInputData(vtkDataObject *)
Assign a data object as input.
void SetSimilarityData(vtkDataObject *input)
standard pipeline input for port 1 This is the similarity data as produced by vtkMomentInvariants.
compute the local maxima in the similarity field and draw a circle of radius around it ...
Proxy object to connect input/output ports.
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:33
topologically and geometrically regular array of data
Definition: vtkImageData.h:39
virtual void SetInputConnection(int port, vtkAlgorithmOutput *input)
Set the connection for the given input port index.
void SetGridConnection(vtkAlgorithmOutput *algOutput)
standard pipeline input for port 1 This vtkImageData input steers the resolution of the balls...
Store zero or more vtkInformation instances.
Superclass for algorithms that produce output of the same type as input.
general representation of visualization data
Definition: vtkDataObject.h:58
static vtkDataSetAlgorithm * New()