Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
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 
39 class vtkPoints;
40 
48 class VTK_ITK_EXPORT vtkITKLabelShapeStatistics : public vtkTableAlgorithm
49 {
50 public:
51  static vtkITKLabelShapeStatistics *New();
52  vtkTypeMacro(vtkITKLabelShapeStatistics, vtkTableAlgorithm);
53  void PrintSelf(ostream& os, vtkIndent indent) override;
54 
58  {
75  // Principal axes of rotation
78  };
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 
95 protected:
97  ~vtkITKLabelShapeStatistics() override;
98 
99  int FillInputPortInformation(int vtkNotUsed(port), vtkInformation* info) override;
100  int RequestData(vtkInformation* request,
101  vtkInformationVector** inputVector,
102  vtkInformationVector* outputVector) override;
103 
104 protected:
105  std::vector<std::string> ComputedStatistics;
106  vtkMatrix4x4* Directions;
107 
108 private:
110  void operator=(const vtkITKLabelShapeStatistics&) = delete;
111 };
112 
113 #endif
Ratio of the area of the hypersphere by the actual area. A value of 1 represents a spherical structur...
std::vector< std::string > ComputedStatistics
Diameter of the sphere that contains the label.
Principal moments of inertia for the principal axes.
Location of the center of mass of the label.
ITK-based utilities for calculating label statistics. Utilizes itk::LabelImageToShapeLabelMapFilter t...
Square root of the ratio of the second largest principal moment by the second smallest.
Square root of the ratio of the second smallest principal moment by the smallest. A value of 0 repres...