|
Slicer 4.2
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
|
00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkMaskedMeanImageFilter.h,v $ 00005 Language: C++ 00006 Date: $Date$ 00007 Version: $Revision$ 00008 00009 Copyright (c) Insight Software Consortium. All rights reserved. 00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 #ifndef __itkMaskedMeanImageFilter_h 00018 #define __itkMaskedMeanImageFilter_h 00019 00020 #include "itkImageToImageFilter.h" 00021 #include "itkImage.h" 00022 #include "itkNumericTraits.h" 00023 00024 namespace itk 00025 { 00042 template <class TInputImage, class TOutputImage> 00043 class ITK_EXPORT MaskedMeanImageFilter : public ImageToImageFilter<TInputImage, TOutputImage> 00044 { 00045 public: 00047 typedef TInputImage InputImageType; 00048 typedef TOutputImage OutputImageType; 00049 typedef typename InputImageType::Pointer InputImagePointer; 00050 typedef typename InputImageType::ConstPointer InputImageConstPointer; 00051 typedef typename OutputImageType::Pointer OutputImagePointer; 00052 00054 typedef MaskedMeanImageFilter Self; 00055 typedef ImageToImageFilter<InputImageType, OutputImageType> Superclass; 00056 typedef SmartPointer<Self> Pointer; 00057 typedef SmartPointer<const Self> ConstPointer; 00058 00060 itkNewMacro(Self); 00061 00063 itkTypeMacro( MaskedMeanImageFilter, ImageToImageFilter ); 00064 00066 itkSetMacro( MinimumNumberOfUsedVoxels, int ); 00067 itkGetMacro( MinimumNumberOfUsedVoxels, int ); 00068 00070 typedef typename InputImageType::PixelType InputPixelType; 00071 typedef typename OutputImageType::PixelType OutputPixelType; 00072 typedef typename NumericTraits<InputPixelType>::RealType InputRealType; 00073 typedef typename InputImageType::RegionType InputImageRegionType; 00074 typedef typename OutputImageType::RegionType OutputImageRegionType; 00075 typedef typename InputImageType::SizeType InputSizeType; 00076 00078 itkSetMacro(Radius, InputSizeType); 00079 itkGetConstReferenceMacro(Radius, InputSizeType); 00080 00087 virtual void GenerateInputRequestedRegion() 00088 throw (InvalidRequestedRegionError); 00089 00090 protected: 00091 MaskedMeanImageFilter(); 00092 virtual ~MaskedMeanImageFilter() 00093 { 00094 } 00095 void PrintSelf( std::ostream& os, Indent indent) const; 00096 00107 #if ITK_VERSION_MAJOR < 4 00108 void ThreadedGenerateData( const OutputImageRegionType & outputRegionForThread, int threadId ); 00109 00110 #else 00111 void ThreadedGenerateData( const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId ); 00112 00113 #endif 00114 private: 00115 MaskedMeanImageFilter(const Self &); // purposely not implemented 00116 void operator=(const Self &); // purposely not implemented 00117 00118 InputSizeType m_Radius; 00119 int m_MinimumNumberOfUsedVoxels; 00120 00121 }; 00122 00123 } // end namespace itk 00124 00125 #ifndef ITK_MANUAL_INSTANTIATION 00126 #include "itkMaskedMeanImageFilter.txx" 00127 #endif 00128 00129 #endif
1.7.4