SimpleITK  1.2.4
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
itk::simple::IsolatedConnectedImageFilter Class Reference

Label pixels that are connected to one set of seeds but not another. More...

#include <sitkIsolatedConnectedImageFilter.h>

+ Inheritance diagram for itk::simple::IsolatedConnectedImageFilter:
+ Collaboration diagram for itk::simple::IsolatedConnectedImageFilter:

Public Types

typedef BasicPixelIDTypeList PixelIDTypeList
 
typedef IsolatedConnectedImageFilter Self
 
- Public Types inherited from itk::simple::ImageFilter< 1 >
typedef ImageFilter Self
 
- Public Types inherited from itk::simple::ProcessObject
typedef ProcessObject Self
 

Public Member Functions

Image Execute (const Image &image1)
 
Image Execute (const Image &image1, const std::vector< unsigned int > &seed1, const std::vector< unsigned int > &seed2, double lower, double upper, uint8_t replaceValue, double isolatedValueTolerance, bool findUpperThreshold)
 
SelfFindUpperThresholdOff ()
 
SelfFindUpperThresholdOn ()
 
bool GetFindUpperThreshold () const
 
double GetIsolatedValue () const
 
double GetIsolatedValueTolerance () const
 
double GetLower () const
 
std::string GetName () const
 
uint8_t GetReplaceValue () const
 
std::vector< unsigned int > GetSeed1 () const
 
std::vector< unsigned int > GetSeed2 () const
 
bool GetThresholdingFailed () const
 
double GetUpper () const
 
 IsolatedConnectedImageFilter ()
 
SelfSetFindUpperThreshold (bool FindUpperThreshold)
 
SelfSetIsolatedValueTolerance (double IsolatedValueTolerance)
 
SelfSetLower (double Lower)
 
SelfSetReplaceValue (uint8_t ReplaceValue)
 
SelfSetSeed1 (const std::vector< unsigned int > &Seed1)
 
SelfSetSeed2 (const std::vector< unsigned int > &Seed2)
 
SelfSetUpper (double Upper)
 
std::string ToString () const
 
virtual ~IsolatedConnectedImageFilter ()
 
- Public Member Functions inherited from itk::simple::ImageFilter< 1 >
 ImageFilter ()
 
virtual ~ImageFilter ()=0
 
- Public Member Functions inherited from itk::simple::ProcessObject
virtual void Abort ()
 
virtual int AddCommand (itk::simple::EventEnum event, itk::simple::Command &cmd)
 Add a Command Object to observer the event. More...
 
virtual float GetProgress () const
 An Active Measurement of the progress of execution. More...
 
virtual bool HasCommand (itk::simple::EventEnum event) const
 Query of this object has any registered commands for event. More...
 
 ProcessObject ()
 
virtual void RemoveAllCommands ()
 Remove all registered commands. More...
 
virtual ~ProcessObject ()
 
virtual void DebugOn ()
 
virtual void DebugOff ()
 
virtual bool GetDebug () const
 
virtual void SetDebug (bool debugFlag)
 
virtual void SetNumberOfThreads (unsigned int n)
 
virtual unsigned int GetNumberOfThreads () const
 

Private Types

typedef Image(Self::* MemberFunctionType) (const Image &image1)
 

Private Member Functions

template<class TImageType >
Image ExecuteInternal (const Image &image1)
 

Private Attributes

bool m_FindUpperThreshold
 
double m_IsolatedValue
 
double m_IsolatedValueTolerance
 
double m_Lower
 
nsstd::auto_ptr< detail::MemberFunctionFactory< MemberFunctionType > > m_MemberFactory
 
uint8_t m_ReplaceValue
 
std::vector< unsigned int > m_Seed1
 
std::vector< unsigned int > m_Seed2
 
bool m_ThresholdingFailed
 
double m_Upper
 

Friends

struct detail::MemberFunctionAddressor< MemberFunctionType >
 

Additional Inherited Members

- Static Public Member Functions inherited from itk::simple::ProcessObject
static bool GetGlobalDefaultDebug ()
 
static void GlobalDefaultDebugOff ()
 
static void GlobalDefaultDebugOn ()
 
static void SetGlobalDefaultDebug (bool debugFlag)
 
static void GlobalWarningDisplayOn ()
 
static void GlobalWarningDisplayOff ()
 
static void SetGlobalWarningDisplay (bool flag)
 
static bool GetGlobalWarningDisplay ()
 
static void SetGlobalDefaultNumberOfThreads (unsigned int n)
 
static unsigned int GetGlobalDefaultNumberOfThreads ()
 
static double GetGlobalDefaultCoordinateTolerance ()
 Access the global tolerance to determine congruent spaces. More...
 
static void SetGlobalDefaultCoordinateTolerance (double)
 Access the global tolerance to determine congruent spaces. More...
 
static double GetGlobalDefaultDirectionTolerance ()
 Access the global tolerance to determine congruent spaces. More...
 
static void SetGlobalDefaultDirectionTolerance (double)
 Access the global tolerance to determine congruent spaces. More...
 
- Protected Member Functions inherited from itk::simple::ProcessObject
virtual unsigned long AddITKObserver (const itk::EventObject &, itk::Command *)
 
virtual itk::ProcessObjectGetActiveProcess ()
 
virtual void OnActiveProcessDelete ()
 
virtual void onCommandDelete (const itk::simple::Command *cmd) SITK_NOEXCEPT
 
virtual void PreUpdate (itk::ProcessObject *p)
 
virtual void RemoveITKObserver (EventCommand &e)
 
- Protected Member Functions inherited from itk::simple::NonCopyable
 NonCopyable ()
 
- Static Protected Member Functions inherited from itk::simple::ImageFilter< 1 >
static void FixNonZeroIndex (TImageType *img)
 
- Static Protected Member Functions inherited from itk::simple::ProcessObject
template<class TImageType >
static TImageType::ConstPointer CastImageToITK (const Image &img)
 
template<class TImageType >
static Image CastITKToImage (TImageType *img)
 
template<class TPixelType , unsigned int VImageDimension, unsigned int VLength, template< typename, unsigned int > class TVector>
static Image CastITKToImage (itk::Image< TVector< TPixelType, VLength >, VImageDimension > *img)
 
static const itk::EventObjectGetITKEventObject (EventEnum e)
 
template<typename T >
static std::ostream & ToStringHelper (std::ostream &os, const T &v)
 
static std::ostream & ToStringHelper (std::ostream &os, const char &v)
 
static std::ostream & ToStringHelper (std::ostream &os, const signed char &v)
 
static std::ostream & ToStringHelper (std::ostream &os, const unsigned char &v)
 

Detailed Description

Label pixels that are connected to one set of seeds but not another.

IsolatedConnectedImageFilter finds the optimal threshold to separate two regions. It has two modes, one to separate dark regions surrounded by bright regions by automatically finding a minimum isolating upper threshold, and another to separate bright regions surrounded by dark regions by automatically finding a maximum lower isolating threshold. The mode can be chosen by setting FindUpperThresholdOn() /Off(). In both cases, the isolating threshold is retrieved with GetIsolatedValue() .

The algorithm labels pixels with ReplaceValue that are connected to Seeds1 AND NOT connected to Seeds2. When finding the threshold to separate two dark regions surrounded by bright regions, given a fixed lower threshold, the filter adjusts the upper threshold until the two sets of seeds are not connected. The algorithm uses a binary search to adjust the upper threshold, starting at Upper. The reverse is true for finding the threshold to separate two bright regions. Lower defaults to the smallest possible value for the InputImagePixelType, and Upper defaults to the largest possible value for the InputImagePixelType.

The user can also supply the Lower and Upper values to restrict the search. However, if the range is too restrictive, it could happen that no isolating threshold can be found between the user specified Lower and Upper values. Therefore, unless the user is sure of the bounds to set, it is recommended that the user set these values to the lowest and highest intensity values in the image, respectively.

The user can specify more than one seed for both regions to separate. The algorithm will try find the threshold that ensures that all of the first seeds are contained in the resulting segmentation and all of the second seeds are not contained in the segmentation.

It is possible that the algorithm may not be able to find the isolating threshold because no such threshold exists. The user can check for this by querying the GetThresholdingFailed() flag.

See also
itk::simple::IsolatedConnected for the procedural interface
itk::IsolatedConnectedImageFilter for the Doxygen on the original ITK class.

Definition at line 50 of file sitkIsolatedConnectedImageFilter.h.

Member Typedef Documentation

typedef Image(Self::* itk::simple::IsolatedConnectedImageFilter::MemberFunctionType) (const Image &image1)
private

Setup for member function dispatching

Definition at line 171 of file sitkIsolatedConnectedImageFilter.h.

Define the pixels types supported by this filter

Definition at line 62 of file sitkIsolatedConnectedImageFilter.h.

Definition at line 52 of file sitkIsolatedConnectedImageFilter.h.

Constructor & Destructor Documentation

virtual itk::simple::IsolatedConnectedImageFilter::~IsolatedConnectedImageFilter ( )
virtual

Destructor

itk::simple::IsolatedConnectedImageFilter::IsolatedConnectedImageFilter ( )

Default Constructor that takes no arguments and initializes default parameters

Member Function Documentation

Image itk::simple::IsolatedConnectedImageFilter::Execute ( const Image image1)

Execute the filter on the input image

Image itk::simple::IsolatedConnectedImageFilter::Execute ( const Image image1,
const std::vector< unsigned int > &  seed1,
const std::vector< unsigned int > &  seed2,
double  lower,
double  upper,
uint8_t  replaceValue,
double  isolatedValueTolerance,
bool  findUpperThreshold 
)

Execute the filter on the input image with the given parameters

template<class TImageType >
Image itk::simple::IsolatedConnectedImageFilter::ExecuteInternal ( const Image image1)
private
Self& itk::simple::IsolatedConnectedImageFilter::FindUpperThresholdOff ( )
inline

Definition at line 131 of file sitkIsolatedConnectedImageFilter.h.

Self& itk::simple::IsolatedConnectedImageFilter::FindUpperThresholdOn ( )
inline

Set the value of FindUpperThreshold to true or false respectfully.

Definition at line 130 of file sitkIsolatedConnectedImageFilter.h.

bool itk::simple::IsolatedConnectedImageFilter::GetFindUpperThreshold ( ) const
inline

Set/Get whether to find an upper threshold (separating two dark regions) or a lower threshold (separating two bright regions).

Definition at line 136 of file sitkIsolatedConnectedImageFilter.h.

double itk::simple::IsolatedConnectedImageFilter::GetIsolatedValue ( ) const
inline

Get value that isolates the two seeds.

This is a measurement. Its value is updated in the Execute methods, so the value will only be valid after an execution.

Definition at line 151 of file sitkIsolatedConnectedImageFilter.h.

double itk::simple::IsolatedConnectedImageFilter::GetIsolatedValueTolerance ( ) const
inline

Set/Get the precision required for the intensity threshold value. The default is 1.

Definition at line 122 of file sitkIsolatedConnectedImageFilter.h.

double itk::simple::IsolatedConnectedImageFilter::GetLower ( ) const
inline

Set/Get the limit on the lower threshold value. The default is the NonpositiveMin() for the InputPixelType.

Definition at line 92 of file sitkIsolatedConnectedImageFilter.h.

std::string itk::simple::IsolatedConnectedImageFilter::GetName ( ) const
inlinevirtual

Name of this class

Implements itk::simple::ProcessObject.

Definition at line 154 of file sitkIsolatedConnectedImageFilter.h.

uint8_t itk::simple::IsolatedConnectedImageFilter::GetReplaceValue ( ) const
inline

Set/Get value to replace thresholded pixels. Pixels that lie within the thresholds will be replaced with this value. The default is 1.

Definition at line 112 of file sitkIsolatedConnectedImageFilter.h.

std::vector<unsigned int> itk::simple::IsolatedConnectedImageFilter::GetSeed1 ( ) const
inline

Definition at line 73 of file sitkIsolatedConnectedImageFilter.h.

std::vector<unsigned int> itk::simple::IsolatedConnectedImageFilter::GetSeed2 ( ) const
inline

Definition at line 82 of file sitkIsolatedConnectedImageFilter.h.

bool itk::simple::IsolatedConnectedImageFilter::GetThresholdingFailed ( ) const
inline

Get the flag that tells whether the algorithm failed to find a threshold.

This is a measurement. Its value is updated in the Execute methods, so the value will only be valid after an execution.

Definition at line 143 of file sitkIsolatedConnectedImageFilter.h.

double itk::simple::IsolatedConnectedImageFilter::GetUpper ( ) const
inline

Set/Get the limit on the upper threshold value. The default is the max() for the InputPixelType.

Definition at line 102 of file sitkIsolatedConnectedImageFilter.h.

Self& itk::simple::IsolatedConnectedImageFilter::SetFindUpperThreshold ( bool  FindUpperThreshold)
inline

Set/Get whether to find an upper threshold (separating two dark regions) or a lower threshold (separating two bright regions).

Definition at line 127 of file sitkIsolatedConnectedImageFilter.h.

Self& itk::simple::IsolatedConnectedImageFilter::SetIsolatedValueTolerance ( double  IsolatedValueTolerance)
inline

Set/Get the precision required for the intensity threshold value. The default is 1.

Definition at line 117 of file sitkIsolatedConnectedImageFilter.h.

Self& itk::simple::IsolatedConnectedImageFilter::SetLower ( double  Lower)
inline

Set/Get the limit on the lower threshold value. The default is the NonpositiveMin() for the InputPixelType.

Definition at line 87 of file sitkIsolatedConnectedImageFilter.h.

Self& itk::simple::IsolatedConnectedImageFilter::SetReplaceValue ( uint8_t  ReplaceValue)
inline

Set/Get value to replace thresholded pixels. Pixels that lie within the thresholds will be replaced with this value. The default is 1.

Definition at line 107 of file sitkIsolatedConnectedImageFilter.h.

Self& itk::simple::IsolatedConnectedImageFilter::SetSeed1 ( const std::vector< unsigned int > &  Seed1)
inline

DeprecatedSet seed point 1. This seed will be isolated from Seed2 (if possible). All pixels connected to this seed will be replaced with ReplaceValue. This method is deprecated, please use AddSeed1() .

Definition at line 69 of file sitkIsolatedConnectedImageFilter.h.

Self& itk::simple::IsolatedConnectedImageFilter::SetSeed2 ( const std::vector< unsigned int > &  Seed2)
inline

DeprecatedSet seed point 2. This seed will be isolated from Seed1 (if possible). This method is deprecated, please use AddSeed2() .

Definition at line 78 of file sitkIsolatedConnectedImageFilter.h.

Self& itk::simple::IsolatedConnectedImageFilter::SetUpper ( double  Upper)
inline

Set/Get the limit on the upper threshold value. The default is the max() for the InputPixelType.

Definition at line 97 of file sitkIsolatedConnectedImageFilter.h.

std::string itk::simple::IsolatedConnectedImageFilter::ToString ( ) const
virtual

Print ourselves out

Reimplemented from itk::simple::ProcessObject.

Friends And Related Function Documentation

Definition at line 175 of file sitkIsolatedConnectedImageFilter.h.

Member Data Documentation

bool itk::simple::IsolatedConnectedImageFilter::m_FindUpperThreshold
private

Definition at line 187 of file sitkIsolatedConnectedImageFilter.h.

double itk::simple::IsolatedConnectedImageFilter::m_IsolatedValue
private

Definition at line 191 of file sitkIsolatedConnectedImageFilter.h.

double itk::simple::IsolatedConnectedImageFilter::m_IsolatedValueTolerance
private

Definition at line 185 of file sitkIsolatedConnectedImageFilter.h.

double itk::simple::IsolatedConnectedImageFilter::m_Lower
private

Definition at line 182 of file sitkIsolatedConnectedImageFilter.h.

nsstd::auto_ptr<detail::MemberFunctionFactory<MemberFunctionType> > itk::simple::IsolatedConnectedImageFilter::m_MemberFactory
private

Definition at line 177 of file sitkIsolatedConnectedImageFilter.h.

uint8_t itk::simple::IsolatedConnectedImageFilter::m_ReplaceValue
private

Definition at line 184 of file sitkIsolatedConnectedImageFilter.h.

std::vector<unsigned int> itk::simple::IsolatedConnectedImageFilter::m_Seed1
private

Definition at line 180 of file sitkIsolatedConnectedImageFilter.h.

std::vector<unsigned int> itk::simple::IsolatedConnectedImageFilter::m_Seed2
private

Definition at line 181 of file sitkIsolatedConnectedImageFilter.h.

bool itk::simple::IsolatedConnectedImageFilter::m_ThresholdingFailed
private

Definition at line 189 of file sitkIsolatedConnectedImageFilter.h.

double itk::simple::IsolatedConnectedImageFilter::m_Upper
private

Definition at line 183 of file sitkIsolatedConnectedImageFilter.h.


The documentation for this class was generated from the following file: