ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkMedianImageFilter.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 __itkMedianImageFilter_h
00019 #define __itkMedianImageFilter_h
00020 
00021 #include "itkBoxImageFilter.h"
00022 #include "itkImage.h"
00023 
00024 namespace itk
00025 {
00051 template< class TInputImage, class TOutputImage >
00052 class ITK_EXPORT MedianImageFilter:
00053   public BoxImageFilter< TInputImage, TOutputImage >
00054 {
00055 public:
00057   itkStaticConstMacro(InputImageDimension, unsigned int,
00058                       TInputImage::ImageDimension);
00059   itkStaticConstMacro(OutputImageDimension, unsigned int,
00060                       TOutputImage::ImageDimension);
00062 
00064   typedef TInputImage  InputImageType;
00065   typedef TOutputImage OutputImageType;
00066 
00068   typedef MedianImageFilter                                     Self;
00069   typedef ImageToImageFilter< InputImageType, OutputImageType > Superclass;
00070   typedef SmartPointer< Self >                                  Pointer;
00071   typedef SmartPointer< const Self >                            ConstPointer;
00072 
00074   itkNewMacro(Self);
00075 
00077   itkTypeMacro(MedianImageFilter, BoxImageFilter);
00078 
00080   typedef typename InputImageType::PixelType  InputPixelType;
00081   typedef typename OutputImageType::PixelType OutputPixelType;
00082 
00083   typedef typename InputImageType::RegionType  InputImageRegionType;
00084   typedef typename OutputImageType::RegionType OutputImageRegionType;
00085 
00086   typedef typename InputImageType::SizeType InputSizeType;
00087 
00088 #ifdef ITK_USE_CONCEPT_CHECKING
00089 
00090   itkConceptMacro( SameDimensionCheck,
00091                    ( Concept::SameDimension< InputImageDimension, OutputImageDimension > ) );
00092   itkConceptMacro( InputConvertibleToOutputCheck,
00093                    ( Concept::Convertible< InputPixelType, OutputPixelType > ) );
00094   itkConceptMacro( InputLessThanComparableCheck,
00095                    ( Concept::LessThanComparable< InputPixelType > ) );
00096 
00098 #endif
00099 protected:
00100   MedianImageFilter();
00101   virtual ~MedianImageFilter() {}
00102 
00113   void ThreadedGenerateData(const OutputImageRegionType & outputRegionForThread,
00114                             ThreadIdType threadId);
00115 
00116 private:
00117   MedianImageFilter(const Self &); //purposely not implemented
00118   void operator=(const Self &);    //purposely not implemented
00119 };
00120 } // end namespace itk
00121 
00122 #ifndef ITK_MANUAL_INSTANTIATION
00123 #include "itkMedianImageFilter.hxx"
00124 #endif
00125 
00126 #endif
00127