13 #ifndef __itkAdaptiveThresholdIterator_h 14 #define __itkAdaptiveThresholdIterator_h 16 #include "itkConditionalConstIterator.h" 36 template <
class TImage,
class TFunction>
83 itkStaticConstMacro(NDimensions,
unsigned int, TImage::ImageDimension);
104 void InitializeIterator();
107 void DoExtendedFloodStep();
110 void SetExpansionDirection(
bool upwards);
113 void InitRegionGrowingState();
115 void SetMinTH(
int min);
117 void SetMaxTH(
int max);
119 int GetSeedPointValue(
void);
124 m_FineDetectionMode = fine;
125 m_DetectionStop =
false;
134 return (*m_QueueMap.find(m_RegionGrowingState)).second.front();
137 const PixelType
Get(
void)
const override 139 return const_cast<ImageType *
>(this->m_Image.GetPointer())
140 ->GetPixel((*m_QueueMap.find(m_RegionGrowingState)).second.front());
144 void Set(
const PixelType &value)
146 const_cast<ImageType *
>(this->m_Image.GetPointer())
147 ->GetPixel((*m_QueueMap.find(m_RegionGrowingState)).second.front()) = value;
153 bool IsAtEnd()
override {
return this->m_IsAtEnd; };
161 this->m_Image = it.m_Image;
162 this->m_Region = it.m_Region;
164 this->m_RegionGrowingState = it.m_RegionGrowingState;
165 this->m_MinTH = it.m_MinTH;
166 this->m_MaxTH = it.m_MaxTH;
167 this->m_SeedPointValue = it.m_SeedPointValue;
168 this->m_VoxelCounter = it.m_VoxelCounter;
169 this->m_LastVoxelNumber = it.m_LastVoxelNumber;
170 this->m_DetectedLeakagePoint = it.m_DetectedLeakagePoint;
171 this->m_CurrentLeakageRatio = it.m_CurrentLeakageRatio;
176 bool IsPixelIncluded(
const IndexType &index)
const override;
205 void ExpandThresholdUpwards();
207 void ExpandThresholdDownwards();
209 void IncrementRegionGrowingState();
212 int EstimateDistance(IndexType);
215 unsigned int CalculateMaxRGS();
218 void InsertIndexTypeIntoQueueMap(
unsigned int key, IndexType index);
220 int m_RegionGrowingState;
222 QueueMapType m_QueueMap;
228 int m_SeedPointValue;
230 unsigned int m_VoxelCounter;
231 unsigned int m_LastVoxelNumber;
233 int m_DetectedLeakagePoint;
234 float m_CurrentLeakageRatio;
236 void CheckSeedPointValue();
241 bool m_FineDetectionMode;
242 bool m_DetectionStop;
246 #ifndef ITK_MANUAL_INSTANTIATION
std::vector< IndexType > m_StartIndices
void operator++() override
SmartPointer< FunctionType > m_Function
ImageType::PointType m_ImageOrigin
virtual SmartPointer< FunctionType > GetFunction() const
TFunction::InputType FunctionInputType
ConditionalConstIterator< TImage > Superclass
TImage::SizeType SizeType
SmartPointer< ImageType > m_OutputImage
std::queue< IndexType > IndexQueueType
static int CalculateInitializeValue(int lower, int upper)
void Set(const PixelType &value)
AdaptiveThresholdIterator Self
Iterates over an image using a variable image function, which threshold can be varied during the iter...
int GetLeakagePoint(void)
TImage::InternalPixelType InternalPixelType
TImage::RegionType RegionType
TImage::IndexType IndexType
ImageType::SpacingType m_ImageSpacing
std::map< unsigned int, IndexQueueType > QueueMapType
const PixelType Get(void) const override
const IndexType GetIndex() override
~AdaptiveThresholdIterator() override
TImage::PixelType PixelType
Self & operator=(const Self &it)
void SetFineDetectionMode(bool fine=false)
TTempImage::Pointer tempPtr