ITK  4.6.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 
101 
106 
112 
116  itkSetGetDecoratedInputMacro(AutoMinimumMaximum, bool);
117 
120  virtual void GraftOutput(DataObject *output);
121 
122 protected:
125  void PrintSelf(std::ostream & os, Indent indent) const;
126 
127  void BeforeThreadedGenerateData(void);
128  void ThreadedGenerateData(const RegionType & inputRegionForThread, ThreadIdType threadId);
129  void AfterThreadedGenerateData(void);
130 
135 
136  virtual void ThreadedComputeMinimumAndMaximum( const RegionType & inputRegionForThread, ThreadIdType threadId, ProgressReporter & progress );
137  virtual void ThreadedComputeHistogram( const RegionType & inputRegionForThread, ThreadIdType threadId, ProgressReporter & progress );
138 
139  std::vector< HistogramPointer > m_Histograms;
140  std::vector< HistogramMeasurementVectorType > m_Minimums;
141  std::vector< HistogramMeasurementVectorType > m_Maximums;
142 
143 private:
144  ImageToHistogramFilter(const Self &); //purposely not implemented
145  void operator=(const Self &); //purposely not implemented
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
DataObject::Pointer MakeOutput(DataObjectPointerArraySizeType)
Light weight base class for most itk classes.
virtual void ThreadedComputeMinimumAndMaximum(const RegionType &inputRegionForThread, ThreadIdType threadId, ProgressReporter &progress)
itkSetGetDecoratedInputMacro(HistogramSize, HistogramSizeType)
ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
This class stores measurement vectors in the context of n-dimensional histogram.
Definition: itkHistogram.h:77
This class generates an histogram from an image.
SimpleDataObjectDecorator< HistogramSizeType > InputHistogramSizeObjectType
void ThreadedGenerateData(const RegionType &inputRegionForThread, ThreadIdType threadId)
void ApplyMarginalScale(HistogramMeasurementVectorType &min, HistogramMeasurementVectorType &max, HistogramSizeType &size)
SimpleDataObjectDecorator< HistogramMeasurementVectorType > InputHistogramMeasurementVectorObjectType
SimpleDataObjectDecorator< HistogramMeasurementType > InputHistogramMeasurementObjectType
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)
std::vector< HistogramMeasurementVectorType > m_Minimums
SimpleDataObjectDecorator< bool > InputBooleanObjectType
virtual DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx)
TMeasurement MeasurementType
Definition: itkHistogram.h:95
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
void PrintSelf(std::ostream &os, Indent indent) const
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Define additional traits for native types such as int or float.
std::vector< HistogramPointer > m_Histograms
Base class for all data objects in ITK.
unsigned int ThreadIdType
Definition: itkIntTypes.h:159