00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkStatisticsAlgorithm_h
00018 #define __itkStatisticsAlgorithm_h
00019
00020 #include "itkSample.h"
00021 #include "itkSubsample.h"
00022
00023 namespace itk {
00024 namespace Statistics {
00025
00026 #if !defined(_MSC_VER)
00027
00028 template< class TSize >
00029 TSize FloorLog(TSize size);
00030
00031 template< class TValue >
00032 TValue MedianOfThree(const TValue a, const TValue b, const TValue c);
00033
00034 template< class TSample >
00035 void FindSampleBound(const TSample* sample,
00036 typename TSample::ConstIterator begin,
00037 typename TSample::ConstIterator end,
00038 typename TSample::MeasurementVectorType &min,
00039 typename TSample::MeasurementVectorType &max);
00040
00041 template< class TSubsample >
00042 void FindSampleBoundAndMean(const TSubsample* sample,
00043 int beginIndex,
00044 int endIndex,
00045 typename TSubsample::MeasurementVectorType &min,
00046 typename TSubsample::MeasurementVectorType &max,
00047 typename TSubsample::MeasurementVectorType &mean);
00048
00061 template< class TSubsample >
00062 int Partition(TSubsample* sample,
00063 unsigned int activeDimension,
00064 int beginIndex, int endIndex,
00065 const typename TSubsample::MeasurementType partitionValue);
00066
00075 template< class TSubsample >
00076 typename TSubsample::MeasurementType
00077 QuickSelect(TSubsample* sample,
00078 unsigned int activeDimension,
00079 int beginIndex, int endIndex,
00080 int kth,
00081 typename TSubsample::MeasurementType medianGuess);
00082
00089 template< class TSubsample >
00090 typename TSubsample::MeasurementType
00091 QuickSelect(TSubsample* sample,
00092 unsigned int activeDimension,
00093 int beginIndex, int endIndex,
00094 int kth);
00095
00102 template< class TSubsample >
00103 typename TSubsample::MeasurementType
00104 NthElement(TSubsample* sample,
00105 unsigned int activeDimension,
00106 int beginIndex, int endIndex,
00107 int nth);
00108
00109 template< class TSubsample >
00110 void InsertSort(TSubsample* sample,
00111 unsigned int activeDimension,
00112 int beginIndex, int endIndex);
00113
00114 template< class TSubsample >
00115 void DownHeap(TSubsample* sample,
00116 unsigned int activeDimension,
00117 int beginIndex, int endIndex, int node);
00118
00119 template< class TSubsample >
00120 void HeapSort(TSubsample* sample,
00121 unsigned int activeDimension,
00122 int beginIndex, int endIndex);
00123
00124
00125 template< class TSubsample >
00126 void IntrospectiveSortLoop(TSubsample* sample,
00127 unsigned int activeDimension,
00128 int beginIndex,
00129 int endIndex,
00130 int depthLimit,
00131 int sizeThreshold);
00132
00133 template< class TSubsample >
00134 void IntrospectiveSort(TSubsample* sample,
00135 unsigned int activeDimension,
00136 int beginIndex, int endIndex,
00137 int sizeThreshold);
00138
00139 #endif // #if defined(_MSC_VER)
00140
00141 }
00142 }
00143
00144 #ifndef ITK_MANUAL_INSTANTIATION
00145 #include "itkStatisticsAlgorithm.txx"
00146 #endif
00147
00148 #endif // #ifndef __itkStatisticsAlgorithm_h
00149