Slicer 5.9
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
vtkITKLabelShapeStatistics.h
Go to the documentation of this file.
1/*==============================================================================
2
3 Copyright (c) Laboratory for Percutaneous Surgery (PerkLab)
4 Queen's University, Kingston, ON, Canada. All Rights Reserved.
5
6 See COPYRIGHT.txt
7 or http://www.slicer.org/copyright/copyright.txt for details.
8
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14
15 This file was originally developed by Kyle Sunderland, PerkLab, Queen's University
16 and was supported through CANARIE's Research Software Program, Cancer
17 Care Ontario, OpenAnatomy, and Brigham and Women's Hospital through NIH grant R01MH112748.
18
19==============================================================================*/
20
21#ifndef __vtkITKLabelShapeStatistics_h
22#define __vtkITKLabelShapeStatistics_h
23
24#include "vtkITK.h"
25
26// VTK includes
27#include <vtkMatrix4x4.h>
28#include <vtkSmartPointer.h>
29#include <vtkTable.h>
30#include <vtkTableAlgorithm.h>
31#include <vtkVector.h>
32
33// vtkAddon includes
34#include <vtkAddonSetGet.h>
35
36// std includes
37#include <vector>
38
39class vtkPoints;
40
48class VTK_ITK_EXPORT vtkITKLabelShapeStatistics : public vtkTableAlgorithm
49{
50public:
52 vtkTypeMacro(vtkITKLabelShapeStatistics, vtkTableAlgorithm);
53 void PrintSelf(ostream& os, vtkIndent indent) override;
54
79
80 static std::string GetShapeStatisticAsString(ShapeStatistic statistic);
81 static ShapeStatistic GetShapeStatisticFromString(std::string statisticName);
82
83 vtkSetObjectMacro(Directions, vtkMatrix4x4);
84 vtkSetStdVectorMacro(ComputedStatistics, std::vector<std::string>);
85 vtkGetStdVectorMacro(ComputedStatistics, std::vector<std::string>);
86
90 void SetComputeShapeStatistic(std::string statisticName, bool state);
91 bool GetComputeShapeStatistic(std::string statisticName);
92 void ComputeShapeStatisticOn(std::string statisticName);
93 void ComputeShapeStatisticOff(std::string statisticName);
94
95protected:
98
99 int FillInputPortInformation(int vtkNotUsed(port), vtkInformation* info) override;
100 int RequestData(vtkInformation* request,
101 vtkInformationVector** inputVector,
102 vtkInformationVector* outputVector) override;
103
104protected:
105 std::vector<std::string> ComputedStatistics;
106 vtkMatrix4x4* Directions;
107
108private:
110 void operator=(const vtkITKLabelShapeStatistics&) = delete;
111};
112
113#endif
void SetComputeShapeStatistic(std::string statisticName, bool state)
void PrintSelf(ostream &os, vtkIndent indent) override
std::vector< std::string > ComputedStatistics
static ShapeStatistic GetShapeStatisticFromString(std::string statisticName)
void ComputeShapeStatisticOff(std::string statisticName)
@ Roundness
Ratio of the area of the hypersphere by the actual area. A value of 1 represents a spherical structur...
@ OrientedBoundingBox
Oriented bounding box of the label.
@ Flatness
Square root of the ratio of the second smallest principal moment by the smallest. A value of 0 repres...
@ Perimeter
Surface area of the label.
@ PrincipalMoments
Principal moments of inertia for the principal axes.
@ FeretDiameter
Diameter of the sphere that contains the label.
@ Elongation
Square root of the ratio of the second largest principal moment by the second smallest.
@ Centroid
Location of the center of mass of the label.
int RequestData(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override
static std::string GetShapeStatisticAsString(ShapeStatistic statistic)
void ComputeShapeStatisticOn(std::string statisticName)
static vtkITKLabelShapeStatistics * New()
~vtkITKLabelShapeStatistics() override
vtkGetStdVectorMacro(ComputedStatistics, std::vector< std::string >)
bool GetComputeShapeStatistic(std::string statisticName)
int FillInputPortInformation(int vtkNotUsed(port), vtkInformation *info) override
vtkSetStdVectorMacro(ComputedStatistics, std::vector< std::string >)