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 __itkHistogramToRunLengthFeaturesFilter_h 00019 #define __itkHistogramToRunLengthFeaturesFilter_h 00020 00021 #include "itkHistogram.h" 00022 #include "itkMacro.h" 00023 #include "itkProcessObject.h" 00024 #include "itkSimpleDataObjectDecorator.h" 00025 00026 namespace itk { 00027 namespace Statistics { 00065 template< class THistogram > 00066 class ITK_EXPORT HistogramToRunLengthFeaturesFilter : public ProcessObject 00067 { 00068 public: 00070 typedef HistogramToRunLengthFeaturesFilter Self; 00071 typedef ProcessObject Superclass; 00072 typedef SmartPointer<Self> Pointer; 00073 typedef SmartPointer<const Self> ConstPointer; 00074 00076 itkTypeMacro( HistogramToRunLengthFeaturesFilter, ProcessObject ); 00077 00079 itkNewMacro( Self ); 00080 00081 typedef THistogram HistogramType; 00082 typedef typename HistogramType::Pointer HistogramPointer; 00083 typedef typename HistogramType::ConstPointer HistogramConstPointer; 00084 typedef typename HistogramType::MeasurementType MeasurementType; 00085 typedef typename HistogramType::MeasurementVectorType MeasurementVectorType; 00086 typedef typename HistogramType::IndexType IndexType; 00087 typedef typename HistogramType:: 00088 TotalAbsoluteFrequencyType FrequencyType; 00089 00091 using Superclass::SetInput; 00092 void SetInput ( const HistogramType * histogram ); 00093 const HistogramType * GetInput() const; 00095 00097 typedef DataObject::Pointer DataObjectPointer; 00098 00100 typedef SimpleDataObjectDecorator<MeasurementType> MeasurementObjectType; 00101 00103 MeasurementType GetShortRunEmphasis() const; 00104 const MeasurementObjectType* GetShortRunEmphasisOutput() const; 00106 00108 MeasurementType GetLongRunEmphasis() const; 00109 const MeasurementObjectType* GetLongRunEmphasisOutput() const; 00111 00113 MeasurementType GetGreyLevelNonuniformity() const; 00114 const MeasurementObjectType* GetGreyLevelNonuniformityOutput() const; 00116 00118 MeasurementType GetRunLengthNonuniformity() const; 00119 const MeasurementObjectType* GetRunLengthNonuniformityOutput() const; 00121 00123 MeasurementType GetLowGreyLevelRunEmphasis() const; 00124 const MeasurementObjectType* GetLowGreyLevelRunEmphasisOutput() const; 00126 00128 MeasurementType GetHighGreyLevelRunEmphasis() const; 00129 const MeasurementObjectType* GetHighGreyLevelRunEmphasisOutput() const; 00131 00133 MeasurementType GetShortRunLowGreyLevelEmphasis() const; 00134 const MeasurementObjectType* GetShortRunLowGreyLevelEmphasisOutput() const; 00136 00138 MeasurementType GetShortRunHighGreyLevelEmphasis() const; 00139 const MeasurementObjectType* GetShortRunHighGreyLevelEmphasisOutput() const; 00141 00143 MeasurementType GetLongRunLowGreyLevelEmphasis() const; 00144 const MeasurementObjectType* GetLongRunLowGreyLevelEmphasisOutput() const; 00146 00148 MeasurementType GetLongRunHighGreyLevelEmphasis() const; 00149 const MeasurementObjectType* GetLongRunHighGreyLevelEmphasisOutput() const; 00151 00152 itkGetMacro( TotalNumberOfRuns, unsigned long ); 00153 00155 typedef enum 00156 { 00157 ShortRunEmphasis, 00158 LongRunEmphasis, 00159 GreyLevelNonuniformity, 00160 RunLengthNonuniformity, 00161 LowGreyLevelRunEmphasis, 00162 HighGreyLevelRunEmphasis, 00163 ShortRunLowGreyLevelEmphasis, 00164 ShortRunHighGreyLevelEmphasis, 00165 LongRunLowGreyLevelEmphasis, 00166 LongRunHighGreyLevelEmphasis 00167 } RunLengthFeatureName; 00168 00170 MeasurementType GetFeature( RunLengthFeatureName name ); 00171 00172 protected: 00173 HistogramToRunLengthFeaturesFilter(); 00174 ~HistogramToRunLengthFeaturesFilter() {}; 00175 void PrintSelf(std::ostream& os, Indent indent) const; 00176 00178 typedef ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType; 00179 using Superclass::MakeOutput; 00180 virtual DataObjectPointer MakeOutput( DataObjectPointerArraySizeType ); 00181 00182 void GenerateData(); 00183 00184 private: 00185 HistogramToRunLengthFeaturesFilter(const Self&); //purposely not implemented 00186 void operator=(const Self&); //purposely not implemented 00187 00188 unsigned long m_TotalNumberOfRuns; 00189 00190 }; 00191 00192 } // end of namespace Statistics 00193 } // end of namespace itk 00194 00195 #ifndef ITK_MANUAL_INSTANTIATION 00196 #include "itkHistogramToRunLengthFeaturesFilter.hxx" 00197 #endif 00198 00199 #endif 00200