ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkSpatialObjectToImageStatisticsCalculator.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkSpatialObjectToImageStatisticsCalculator_h
19#define itkSpatialObjectToImageStatisticsCalculator_h
20
21#include "itkObject.h"
22#include "itkMatrix.h"
23#include "itkNumericTraits.h"
24#include "itkListSample.h"
25#include "itkVector.h"
26
27namespace itk
28{
36template <typename TInputImage, typename TInputSpatialObject, unsigned int TSampleDimension = 1>
37class ITK_TEMPLATE_EXPORT SpatialObjectToImageStatisticsCalculator : public Object
38{
39public:
40 ITK_DISALLOW_COPY_AND_MOVE(SpatialObjectToImageStatisticsCalculator);
41
47
49 itkNewMacro(Self);
50
52 itkOverrideGetNameOfClassMacro(SpatialObjectToImageStatisticsCalculator);
53
55 using ImageType = TInputImage;
56 using ImagePointer = typename TInputImage::Pointer;
57 using ImageConstPointer = typename TInputImage::ConstPointer;
58 using PixelType = typename TInputImage::PixelType;
59 using IndexType = typename TInputImage::IndexType;
60 using PointType = typename TInputImage::PointType;
61 using RegionType = typename TInputImage::RegionType;
62 using SizeType = typename RegionType::SizeType;
63
65
66 static constexpr unsigned int ImageDimension = ImageType::ImageDimension;
67
68 static constexpr unsigned int SampleDimension = TSampleDimension;
69
70 static constexpr unsigned int ObjectDimension = TInputSpatialObject::ObjectDimension;
71
73 using SpatialObjectType = TInputSpatialObject;
74 using SpatialObjectPointer = typename SpatialObjectType::Pointer;
75 using SpatialObjectConstPointer = typename SpatialObjectType::ConstPointer;
76
80
83
85 itkSetMacro(SampleDirection, unsigned int);
86 itkGetConstMacro(SampleDirection, unsigned int);
88
90 itkSetConstObjectMacro(Image, ImageType);
91
93 itkSetObjectMacro(SpatialObject, SpatialObjectType);
94
96 const VectorType &
97 GetMean() const
98 {
99 return m_Mean;
100 }
101
103 const MatrixType &
105 {
106 return m_CovarianceMatrix;
107 }
108
111 GetSum() const
112 {
113 return m_Sum;
114 }
115
117 itkGetConstMacro(NumberOfPixels, SizeValueType);
118
120 void
122
123protected:
126 void
127 PrintSelf(std::ostream & os, Indent indent) const override;
128
130 bool
132
133private:
140 unsigned int m_SampleDirection{};
144
146};
147} // end namespace itk
148
149#ifndef ITK_MANUAL_INSTANTIATION
150# include "itkSpatialObjectToImageStatisticsCalculator.hxx"
151#endif
152
153#endif /* itkSpatialObjectToImageStatisticsCalculator_h */
Templated n-dimensional image class.
Definition itkImage.h:89
Control indentation during Print() invocation.
Definition itkIndent.h:50
A templated class holding a M x N size Matrix.
Definition itkMatrix.h:53
Implements transparent reference counting.
Matrix< double, TSampleDimension, TSampleDimension > MatrixType
typename NumericTraits< PixelType >::AccumulateType AccumulateType
~SpatialObjectToImageStatisticsCalculator() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
Implementation of the composite pattern.
This class is the native implementation of the a Sample with an STL container.
Generate a unique, increasing time value.
A templated class holding a n-Dimensional vector.
Definition itkVector.h:63
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
unsigned long SizeValueType
Definition itkIntTypes.h:86
SizeValueType ModifiedTimeType