ITK
4.1.0
Insight Segmentation and Registration Toolkit
|
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 __itkRankImageFilter_h 00019 #define __itkRankImageFilter_h 00020 00021 #include "itkMovingHistogramImageFilter.h" 00022 #include <list> 00023 #include <map> 00024 #include <set> 00025 #include "itkRankHistogram.h" 00026 #include "itkFlatStructuringElement.h" 00027 00028 namespace itk 00029 { 00066 template< class TInputImage, class TOutputImage, class TKernel = 00067 FlatStructuringElement< ::itk::GetImageDimension< TInputImage >::ImageDimension > > 00068 class ITK_EXPORT RankImageFilter: 00069 public MovingHistogramImageFilter< TInputImage, TOutputImage, TKernel, 00070 Function::RankHistogram< typename TInputImage::PixelType > > 00071 { 00072 public: 00074 typedef RankImageFilter Self; 00075 typedef SmartPointer< Self > Pointer; 00076 typedef SmartPointer< const Self > ConstPointer; 00077 typedef MovingHistogramImageFilter< TInputImage, TOutputImage, TKernel, 00078 Function::RankHistogram< typename TInputImage::PixelType > > Superclass; 00079 00081 itkNewMacro(Self); 00082 00084 itkTypeMacro(RankImageFilter, 00085 MovingHistogramImageFilter); 00086 00088 typedef TInputImage InputImageType; 00089 typedef TOutputImage OutputImageType; 00090 typedef typename TInputImage::RegionType RegionType; 00091 typedef typename TInputImage::SizeType SizeType; 00092 typedef typename TInputImage::IndexType IndexType; 00093 typedef typename TInputImage::PixelType PixelType; 00094 typedef typename TInputImage::OffsetType OffsetType; 00095 typedef typename Superclass::OutputImageRegionType OutputImageRegionType; 00096 typedef typename TOutputImage::PixelType OutputPixelType; 00097 typedef typename TInputImage::PixelType InputPixelType; 00098 00099 typedef typename Superclass::HistogramType HistogramType; 00100 00102 itkStaticConstMacro(ImageDimension, unsigned int, 00103 TInputImage::ImageDimension); 00104 00106 typedef TKernel KernelType; 00107 00109 typedef typename KernelType::ConstIterator KernelIteratorType; 00110 00112 typedef typename KernelType::SizeType RadiusType; 00113 00114 itkSetMacro(Rank, float) 00115 itkGetConstMacro(Rank, float) 00116 00117 bool GetUseVectorBasedAlgorithm() 00118 { 00119 return HistogramType::UseVectorBasedAlgorithm(); 00120 } 00121 00122 protected: 00123 RankImageFilter(); 00124 ~RankImageFilter() {} 00125 00126 void PrintSelf(std::ostream & os, Indent indent) const; 00127 00128 virtual void ConfigureHistogram( HistogramType & histogram ); 00129 00130 private: 00131 RankImageFilter(const Self &); //purposely not implemented 00132 void operator=(const Self &); //purposely not implemented 00133 00134 float m_Rank; 00135 }; // end of class 00136 } // end namespace itk 00137 00138 #ifndef ITK_MANUAL_INSTANTIATION 00139 #include "itkRankImageFilter.hxx" 00140 #endif 00141 00142 #endif 00143