go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
itkComputeImageExtremaFilter.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright Insight Software Consortium
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 * http://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 itkComputeImageExtremaFilter_h
19#define itkComputeImageExtremaFilter_h
20
21#include "itkStatisticsImageFilter.h"
22#include "itkSpatialObject.h"
23#include "itkImageMaskSpatialObject.h"
24
25namespace itk
26{
47template <typename TInputImage>
48class ITK_TEMPLATE_EXPORT ComputeImageExtremaFilter : public StatisticsImageFilter<TInputImage>
49{
50public:
54 using Pointer = SmartPointer<Self>;
55 using ConstPointer = SmartPointer<const Self>;
56
58 itkNewMacro(Self);
59
62
64 using InputImagePointer = typename TInputImage::Pointer;
65
66 using typename Superclass::RegionType;
67 using typename Superclass::SizeType;
68 using typename Superclass::IndexType;
69 using typename Superclass::PixelType;
70 using PointType = typename TInputImage::PointType;
71
73 itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension);
74
76 using typename Superclass::RealType;
77
78 itkSetMacro(ImageRegion, RegionType);
79 itkSetMacro(UseMask, bool);
80
81 using ImageMaskType = SpatialObject<Self::ImageDimension>;
82 using ImageMaskPointer = typename ImageMaskType::Pointer;
83 using ImageMaskConstPointer = typename ImageMaskType::ConstPointer;
84 itkSetConstObjectMacro(ImageMask, ImageMaskType);
85 itkGetConstObjectMacro(ImageMask, ImageMaskType);
86
87 using ImageSpatialMaskType = ImageMaskSpatialObject<Self::ImageDimension>;
88 using ImageSpatialMaskPointer = typename ImageSpatialMaskType::Pointer;
89 using ImageSpatialMaskConstPointer = typename ImageSpatialMaskType::ConstPointer;
90 itkSetConstObjectMacro(ImageSpatialMask, ImageSpatialMaskType);
91 itkGetConstObjectMacro(ImageSpatialMask, ImageSpatialMaskType);
92
93protected:
95 ~ComputeImageExtremaFilter() override = default;
96
98 void
100
103 void
105
107 void
108 ThreadedStreamedGenerateData(const RegionType &) override;
109 virtual void
111 virtual void
112 ThreadedGenerateDataImageMask(const RegionType &);
113 virtual void
115 RegionType m_ImageRegion;
118 bool m_UseMask{ false };
119 bool m_SameGeometry{ false };
120
121private:
123 void
124 operator=(const Self &);
125
126 CompensatedSummation<RealType> m_ThreadSum{ 1 };
127 CompensatedSummation<RealType> m_SumOfSquares{ 1 };
128 SizeValueType m_Count{ 1 };
129 PixelType m_ThreadMin{ 1 };
130 PixelType m_ThreadMax{ 1 };
131
132 std::mutex m_Mutex;
133}; // end of class
134} // end namespace itk
135
136#ifndef ITK_MANUAL_INSTANTIATION
137# include "itkComputeImageExtremaFilter.hxx"
138#endif
139
140#endif
Compute min. max, variance and mean of an Image.
typename ImageMaskType::ConstPointer ImageMaskConstPointer
ComputeImageExtremaFilter(const Self &)
~ComputeImageExtremaFilter() override=default
itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension)
typename ImageMaskType::Pointer ImageMaskPointer
typename ImageSpatialMaskType::ConstPointer ImageSpatialMaskConstPointer
typename TInputImage::Pointer InputImagePointer
ImageMaskSpatialObject< Self::ImageDimension > ImageSpatialMaskType
void ThreadedStreamedGenerateData(const RegionType &) override
virtual void ThreadedGenerateDataImageMask(const RegionType &)
ImageSpatialMaskConstPointer m_ImageSpatialMask
SpatialObject< Self::ImageDimension > ImageMaskType
typename ImageSpatialMaskType::Pointer ImageSpatialMaskPointer
void BeforeStreamedGenerateData() override
virtual void ThreadedGenerateDataImageSpatialMask(const RegionType &)
void operator=(const Self &)
void AfterStreamedGenerateData() override
typename TInputImage::PointType PointType


Generated on 2023-01-13 for elastix by doxygen 1.9.6 elastix logo