ITK  5.2.0
Insight Toolkit
itkMinimumMaximumImageFilter.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  * 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 itkMinimumMaximumImageFilter_h
19 #define itkMinimumMaximumImageFilter_h
20 
21 #include "itkImageSink.h"
23 #include <mutex>
24 
25 #include <vector>
26 
27 #include "itkNumericTraits.h"
28 
29 namespace itk
30 {
47 template <typename TInputImage>
48 class ITK_TEMPLATE_EXPORT MinimumMaximumImageFilter : public ImageSink<TInputImage>
49 {
50 public:
51  ITK_DISALLOW_COPY_AND_MOVE(MinimumMaximumImageFilter);
52 
54  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
55 
61 
63  using InputImagePointer = typename TInputImage::Pointer;
64 
66  using SizeType = typename TInputImage::SizeType;
68  using PixelType = typename TInputImage::PixelType;
69 
72 
74  itkNewMacro(Self);
75 
78 
80  using InputImageType = TInputImage;
81 
84 
86  itkGetDecoratedOutputMacro(Minimum, PixelType);
87 
89  itkGetDecoratedOutputMacro(Maximum, PixelType);
90 
94  using Superclass::MakeOutput;
96  MakeOutput(const DataObjectIdentifierType & name) override;
97 
98 
99  // Change the access from protected to public to expose streaming option, a using statement can not be used due to
100  // limitations of wrapping.
101  void
102  SetNumberOfStreamDivisions(const unsigned int n) override
103  {
104  Superclass::SetNumberOfStreamDivisions(n);
105  }
106  unsigned int
107  GetNumberOfStreamDivisions() const override
108  {
109  return Superclass::GetNumberOfStreamDivisions();
110  }
111 
112 #ifdef ITK_USE_CONCEPT_CHECKING
113  // Begin concept checking
114  itkConceptMacro(LessThanComparableCheck, (Concept::LessThanComparable<PixelType>));
115  itkConceptMacro(GreaterThanComparableCheck, (Concept::GreaterThanComparable<PixelType>));
116  itkConceptMacro(OStreamWritableCheck, (Concept::OStreamWritable<PixelType>));
117  // End concept checking
118 #endif
119 
120 protected:
122  ~MinimumMaximumImageFilter() override = default;
123  void
124  PrintSelf(std::ostream & os, Indent indent) const override;
125 
127  void
128  BeforeStreamedGenerateData() override;
129 
132  void
133  AfterStreamedGenerateData() override;
134 
135  void
136  ThreadedStreamedGenerateData(const RegionType &) override;
137 
138 
139  itkSetDecoratedOutputMacro(Minimum, PixelType);
140  itkSetDecoratedOutputMacro(Maximum, PixelType);
141 
142 private:
145 
146  std::mutex m_Mutex;
147 };
148 } // end namespace itk
149 
150 #ifndef ITK_MANUAL_INSTANTIATION
151 # include "itkMinimumMaximumImageFilter.hxx"
152 #endif
153 
154 #endif
itk::SimpleDataObjectDecorator
Decorates any "simple" data type (data types without smart pointers) with a DataObject API.
Definition: itkSimpleDataObjectDecorator.h:66
itk::MinimumMaximumImageFilter::m_ThreadMax
PixelType m_ThreadMax
Definition: itkMinimumMaximumImageFilter.h:144
itk::Concept::OStreamWritable
Definition: itkConceptChecking.h:636
itk::MinimumMaximumImageFilter::GetNumberOfStreamDivisions
unsigned int GetNumberOfStreamDivisions() const override
Definition: itkMinimumMaximumImageFilter.h:107
itk::MinimumMaximumImageFilter
Computes the minimum and the maximum intensity values of an image.
Definition: itkMinimumMaximumImageFilter.h:48
itk::Concept::GreaterThanComparable
Definition: itkConceptChecking.h:284
itk::ProcessObject::DataObjectIdentifierType
DataObject::DataObjectIdentifierType DataObjectIdentifierType
Definition: itkProcessObject.h:161
itk::MinimumMaximumImageFilter::PixelType
typename TInputImage::PixelType PixelType
Definition: itkMinimumMaximumImageFilter.h:68
itk::MinimumMaximumImageFilter::RegionType
typename TInputImage::RegionType RegionType
Definition: itkMinimumMaximumImageFilter.h:65
itk::StreamingProcessObject
Base class interface to process data on multiple requested input chunks.
Definition: itkStreamingProcessObject.h:40
itk::ImageSink::InputImagePointer
typename InputImageType::Pointer InputImagePointer
Definition: itkImageSink.h:74
itk::GTest::TypedefsAndConstructors::Dimension2::SizeType
ImageBaseType::SizeType SizeType
Definition: itkGTestTypedefsAndConstructors.h:49
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::MinimumMaximumImageFilter::SetNumberOfStreamDivisions
void SetNumberOfStreamDivisions(const unsigned int n) override
Definition: itkMinimumMaximumImageFilter.h:102
itk::GTest::TypedefsAndConstructors::Dimension2::IndexType
ImageBaseType::IndexType IndexType
Definition: itkGTestTypedefsAndConstructors.h:50
itk::ImageToImageFilter
Base class for filters that take an image as input and produce an image as output.
Definition: itkImageToImageFilter.h:108
itk::MinimumMaximumImageFilter::m_ThreadMin
PixelType m_ThreadMin
Definition: itkMinimumMaximumImageFilter.h:143
itkImageSink.h
itk::MinimumMaximumImageFilter::IndexType
typename TInputImage::IndexType IndexType
Definition: itkMinimumMaximumImageFilter.h:67
itk::GTest::TypedefsAndConstructors::Dimension2::RegionType
ImageBaseType::RegionType RegionType
Definition: itkGTestTypedefsAndConstructors.h:54
itkConceptMacro
#define itkConceptMacro(name, concept)
Definition: itkConceptChecking.h:65
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::MinimumMaximumImageFilter::m_Mutex
std::mutex m_Mutex
Definition: itkMinimumMaximumImageFilter.h:146
itkNumericTraits.h
itk::MinimumMaximumImageFilter::SizeType
typename TInputImage::SizeType SizeType
Definition: itkMinimumMaximumImageFilter.h:66
itkSimpleDataObjectDecorator.h
itk::DataObject::Pointer
SmartPointer< Self > Pointer
Definition: itkDataObject.h:301
itk::ImageSink
Definition: itkImageSink.h:53
itk::ImageSink::InputImageType
TInputImage InputImageType
Definition: itkImageSink.h:73
itk::Concept::LessThanComparable
Definition: itkConceptChecking.h:262
itk::ImageSink::DataObjectIdentifierType
typename Superclass::DataObjectIdentifierType DataObjectIdentifierType
Definition: itkImageSink.h:82