ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkMinimumMaximumImageFilter.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 itkMinimumMaximumImageFilter_h
19 #define itkMinimumMaximumImageFilter_h
20 
21 #include "itkImageToImageFilter.h"
23 #include <mutex>
24 
25 #include <vector>
26 
27 #include "itkNumericTraits.h"
28 
29 namespace itk
30 {
44 template< typename TInputImage >
45 class ITK_TEMPLATE_EXPORT MinimumMaximumImageFilter:
46  public ImageToImageFilter< TInputImage, TInputImage >
47 {
48 public:
49  ITK_DISALLOW_COPY_AND_ASSIGN(MinimumMaximumImageFilter);
50 
52  static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension;
53  static constexpr unsigned int OutputImageDimension = TInputImage::ImageDimension;
54 
60 
62  using InputImagePointer = typename TInputImage::Pointer;
63 
65  using SizeType = typename TInputImage::SizeType;
67  using PixelType = typename TInputImage::PixelType;
68 
71 
73  itkNewMacro(Self);
74 
77 
79  using InputImageType = TInputImage;
80 
83 
86  { return this->GetMinimumOutput()->Get(); }
87  PixelObjectType * GetMinimumOutput();
89 
90  const PixelObjectType * GetMinimumOutput() const;
91 
94  { return this->GetMaximumOutput()->Get(); }
95  PixelObjectType * GetMaximumOutput();
97 
98  const PixelObjectType * GetMaximumOutput() const;
99 
103  using Superclass::MakeOutput;
104  DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override;
105 
106 #ifdef ITK_USE_CONCEPT_CHECKING
107  // Begin concept checking
108  itkConceptMacro( LessThanComparableCheck,
110  itkConceptMacro( GreaterThanComparableCheck,
112  itkConceptMacro( OStreamWritableCheck,
114  // End concept checking
115 #endif
116 
117 protected:
119  ~MinimumMaximumImageFilter() override = default;
120  void PrintSelf(std::ostream & os, Indent indent) const override;
121 
124  void AllocateOutputs() override;
125 
127  void BeforeThreadedGenerateData() override;
128 
131  void AfterThreadedGenerateData() override;
132 
133  void DynamicThreadedGenerateData( const RegionType & ) override;
134 
135  // Override since the filter needs all the data for the algorithm
136  void GenerateInputRequestedRegion() override;
137 
138  // Override since the filter produces all of its output
139  void EnlargeOutputRequestedRegion(DataObject *data) override;
140 
141 private:
144 
145  std::mutex m_Mutex;
146 };
147 } // end namespace itk
148 
149 #ifndef ITK_MANUAL_INSTANTIATION
150 #include "itkMinimumMaximumImageFilter.hxx"
151 #endif
152 
153 #endif
typename TInputImage::PixelType PixelType
Light weight base class for most itk classes.
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
Computes the minimum and the maximum intensity values of an image.
typename TInputImage::RegionType RegionType
Decorates any &quot;simple&quot; data type (data types without smart pointers) with a DataObject API...
typename TInputImage::IndexType IndexType
Base class for filters that take an image as input and produce an image as output.
typename TInputImage::SizeType SizeType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename TInputImage::Pointer InputImagePointer
SmartPointer< Self > Pointer
#define itkConceptMacro(name, concept)
Base class for all data objects in ITK.