ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkMaskedImageToHistogramFilter.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkMaskedImageToHistogramFilter_h
00019 #define __itkMaskedImageToHistogramFilter_h
00020 
00021 #include "itkHistogram.h"
00022 #include "itkImageToHistogramFilter.h"
00023 #include "itkBarrier.h"
00024 #include "itkSimpleDataObjectDecorator.h"
00025 
00026 namespace itk
00027 {
00028 namespace Statistics
00029 {
00041 template< class TImage, class TMaskImage >
00042 class ITK_EXPORT MaskedImageToHistogramFilter:public ImageToHistogramFilter<TImage>
00043 {
00044 public:
00046   typedef MaskedImageToHistogramFilter     Self;
00047   typedef ImageToHistogramFilter<TImage>   Superclass;
00048   typedef SmartPointer< Self >             Pointer;
00049   typedef SmartPointer< const Self >       ConstPointer;
00050 
00052   itkTypeMacro(MaskedImageToHistogramFilter, ImageToHistogramFilter);
00053 
00055   itkNewMacro(Self);
00056 
00057   typedef TImage                                         ImageType;
00058   typedef typename ImageType::PixelType                  PixelType;
00059   typedef typename ImageType::RegionType                 RegionType;
00060   typedef typename NumericTraits< PixelType >::ValueType ValueType;
00061   typedef typename NumericTraits< ValueType >::RealType  ValueRealType;
00062 
00063   typedef Histogram< ValueRealType >                    HistogramType;
00064   typedef typename HistogramType::Pointer               HistogramPointer;
00065   typedef typename HistogramType::ConstPointer          HistogramConstPointer;
00066   typedef typename HistogramType::SizeType              HistogramSizeType;
00067   typedef typename HistogramType::MeasurementType       HistogramMeasurementType;
00068   typedef typename HistogramType::MeasurementVectorType HistogramMeasurementVectorType;
00069 
00070   typedef TMaskImage                                     MaskImageType;
00071   typedef typename MaskImageType::PixelType              MaskPixelType;
00072 
00074   itkSetInputMacro(MaskImage, MaskImageType);
00075   itkGetInputMacro(MaskImage, MaskImageType);
00077 
00081   itkSetGetDecoratedInputMacro(MaskValue, MaskPixelType);
00082 
00083 protected:
00084   MaskedImageToHistogramFilter();
00085   virtual ~MaskedImageToHistogramFilter() {}
00086 
00087   virtual void ThreadedComputeMinimumAndMaximum( const RegionType & inputRegionForThread, ThreadIdType threadId, ProgressReporter & progress );
00088   virtual void ThreadedComputeHistogram( const RegionType & inputRegionForThread, ThreadIdType threadId, ProgressReporter & progress );
00089 
00090 private:
00091   MaskedImageToHistogramFilter(const Self &); //purposely not implemented
00092   void operator=(const Self &);         //purposely not implemented
00093 
00094 };
00095 } // end of namespace Statistics
00096 } // end of namespace itk
00097 
00098 #ifndef ITK_MANUAL_INSTANTIATION
00099 #include "itkMaskedImageToHistogramFilter.hxx"
00100 #endif
00101 
00102 #endif
00103