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 "itkImageSink.h"
22#include "itkImageMaskSpatialObject.h"
23
24namespace itk
25{
32template <typename TInputImage>
33class ITK_TEMPLATE_EXPORT ComputeImageExtremaFilter : public ImageSink<TInputImage>
34{
35public:
37
41 using Pointer = SmartPointer<Self>;
42 using ConstPointer = SmartPointer<const Self>;
43
45 itkNewMacro(Self);
46
48 itkTypeMacro(ComputeImageExtremaFilter, StatisticsImageFilter);
49
51 using InputImagePointer = typename TInputImage::Pointer;
52
53 using Superclass::InputImageDimension;
54 using typename Superclass::InputImageRegionType;
55 using PixelType = typename Superclass::InputImagePixelType;
56
58 itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension);
59
60 using ImageSpatialMaskType = ImageMaskSpatialObject<Self::ImageDimension>;
61 using ImageSpatialMaskPointer = typename ImageSpatialMaskType::Pointer;
62 using ImageSpatialMaskConstPointer = typename ImageSpatialMaskType::ConstPointer;
63 itkSetConstObjectMacro(ImageSpatialMask, ImageSpatialMaskType);
64 itkGetConstObjectMacro(ImageSpatialMask, ImageSpatialMaskType);
65
66 PixelType
67 GetMinimum() const
68 {
69 return m_ThreadMin;
70 }
71
72 PixelType
73 GetMaximum() const
74 {
75 return m_ThreadMax;
76 }
77
78protected:
80 ~ComputeImageExtremaFilter() override = default;
81
83 void
85
87 void
88 ThreadedStreamedGenerateData(const InputImageRegionType &) override;
89
90private:
92 {
93 PixelType Min;
94 PixelType Max;
95 };
96
97 static MinMaxResult
98 RetrieveMinMax(const TInputImage &, const InputImageRegionType &, const ImageSpatialMaskType *, bool);
99
100 ImageSpatialMaskConstPointer m_ImageSpatialMask{};
101 bool m_SameGeometry{ false };
102
103 PixelType m_ThreadMin{ 1 };
104 PixelType m_ThreadMax{ 1 };
105
106 std::mutex m_Mutex{};
107}; // end of class
108} // end namespace itk
109
110#ifndef ITK_MANUAL_INSTANTIATION
111# include "itkComputeImageExtremaFilter.hxx"
112#endif
113
114#endif
Compute minimum and maximum pixel value of an Image.
~ComputeImageExtremaFilter() override=default
itkStaticConstMacro(ImageDimension, unsigned int, TInputImage::ImageDimension)
typename ImageSpatialMaskType::ConstPointer ImageSpatialMaskConstPointer
typename TInputImage::Pointer InputImagePointer
ImageMaskSpatialObject< Self::ImageDimension > ImageSpatialMaskType
typename ImageSpatialMaskType::Pointer ImageSpatialMaskPointer
void ThreadedStreamedGenerateData(const InputImageRegionType &) override
static MinMaxResult RetrieveMinMax(const TInputImage &, const InputImageRegionType &, const ImageSpatialMaskType *, bool)
void BeforeStreamedGenerateData() override
ITK_DISALLOW_COPY_AND_MOVE(ComputeImageExtremaFilter)


Generated on 2024-07-17 for elastix by doxygen 1.11.0 (9b424b03c9833626cd435af22a444888fbbb192d) elastix logo