ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkImageToHistogramFilter.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 itkImageToHistogramFilter_h
19 #define itkImageToHistogramFilter_h
20 
21 #include "itkHistogram.h"
22 #include "itkImageTransformer.h"
23 #include "itkBarrier.h"
25 #include "itkProgressReporter.h"
26 
27 namespace itk
28 {
29 namespace Statistics
30 {
42 template< typename TImage >
44 {
45 public:
51 
54 
56  itkNewMacro(Self);
57 
58  typedef TImage ImageType;
59  typedef typename ImageType::PixelType PixelType;
60  typedef typename ImageType::RegionType RegionType;
63 
70 
71 public:
72 
74  const HistogramType * GetOutput() const;
77 
81 
85 
90 
93 
100  itkSetGetDecoratedInputMacro(HistogramSize, HistogramSizeType);
101 
105  itkSetGetDecoratedInputMacro(MarginalScale, HistogramMeasurementType);
106 
109  itkSetGetDecoratedInputMacro(HistogramBinMinimum, HistogramMeasurementVectorType);
110  itkSetGetDecoratedInputMacro(HistogramBinMaximum, HistogramMeasurementVectorType);
112 
116  itkSetGetDecoratedInputMacro(AutoMinimumMaximum, bool);
117 
120  virtual void GraftOutput(DataObject *output);
121 
122 protected:
125  void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
126 
127  void BeforeThreadedGenerateData(void) ITK_OVERRIDE;
128  void ThreadedGenerateData(const RegionType & inputRegionForThread, ThreadIdType threadId) ITK_OVERRIDE;
129  void AfterThreadedGenerateData(void) ITK_OVERRIDE;
130 
133  using Superclass::MakeOutput;
134  DataObject::Pointer MakeOutput(DataObjectPointerArraySizeType) ITK_OVERRIDE;
135 
136  virtual void ThreadedComputeMinimumAndMaximum( const RegionType & inputRegionForThread, ThreadIdType threadId, ProgressReporter & progress );
137  virtual void ThreadedComputeHistogram( const RegionType & inputRegionForThread, ThreadIdType threadId, ProgressReporter & progress );
138 
142 
143 private:
144  ImageToHistogramFilter(const Self &) ITK_DELETE_FUNCTION;
145  void operator=(const Self &) ITK_DELETE_FUNCTION;
146 
149 
150 };
151 } // end of namespace Statistics
152 } // end of namespace itk
153 
154 #ifndef ITK_MANUAL_INSTANTIATION
155 #include "itkImageToHistogramFilter.hxx"
156 #endif
157 
158 #endif
void AfterThreadedGenerateData(void) override
Light weight base class for most itk classes.
virtual void ThreadedComputeMinimumAndMaximum(const RegionType &inputRegionForThread, ThreadIdType threadId, ProgressReporter &progress)
void BeforeThreadedGenerateData(void) override
This class stores measurement vectors in the context of n-dimensional histogram.
Definition: itkHistogram.h:77
This class generates an histogram from an image.
The base class for all process objects (source, filters, mappers) in the Insight data processing pipe...
SimpleDataObjectDecorator< HistogramSizeType > InputHistogramSizeObjectType
void ApplyMarginalScale(HistogramMeasurementVectorType &min, HistogramMeasurementVectorType &max, HistogramSizeType &size)
SimpleDataObjectDecorator< HistogramMeasurementVectorType > InputHistogramMeasurementVectorObjectType
SimpleDataObjectDecorator< HistogramMeasurementType > InputHistogramMeasurementObjectType
DataObject::Pointer MakeOutput(DataObjectPointerArraySizeType) override
Make a DataObject of the correct type to used as the specified output.
const HistogramType * GetOutput() const
Decorates any &quot;simple&quot; data type (data types without smart pointers) with a DataObject API...
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
Superclass::MeasurementVectorType MeasurementVectorType
Definition: itkHistogram.h:101
std::vector< HistogramMeasurementVectorType > m_Maximums
virtual void GraftOutput(DataObject *output)
HistogramType::MeasurementVectorType HistogramMeasurementVectorType
virtual void ThreadedComputeHistogram(const RegionType &inputRegionForThread, ThreadIdType threadId, ProgressReporter &progress)
void ThreadedGenerateData(const RegionType &inputRegionForThread, ThreadIdType threadId) override
std::vector< HistogramMeasurementVectorType > m_Minimums
SimpleDataObjectDecorator< bool > InputBooleanObjectType
TMeasurement MeasurementType
Definition: itkHistogram.h:95
unsigned int ThreadIdType
Definition: itkIntTypes.h:159
Implements progress tracking for a filter.
HistogramType::MeasurementType HistogramMeasurementType
Base class for all process objects that transform an image into something else.
NumericTraits< PixelType >::ValueType ValueType
NumericTraits< ValueType >::RealType ValueRealType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Define additional traits for native types such as int or float.
void PrintSelf(std::ostream &os, Indent indent) const override
std::vector< HistogramPointer > m_Histograms
Base class for all data objects in ITK.
Standard barrier class implementation for synchronizing the execution of threads. ...
Definition: itkBarrier.h:41