SimpleITK
|
Label pixels that are connected to one set of seeds but not another. More...
#include <sitkIsolatedConnectedImageFilter.h>
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.
Definition at line 49 of file sitkIsolatedConnectedImageFilter.h.
Public Types | |
using | PixelIDTypeList = BasicPixelIDTypeList |
using | Self = IsolatedConnectedImageFilter |
Public Types inherited from itk::simple::ImageFilter | |
using | Self = ImageFilter |
Public Types inherited from itk::simple::ProcessObject | |
using | Self = ProcessObject |
Public Member Functions | |
Image | Execute (const Image &image1) |
Self & | FindUpperThresholdOff () |
Self & | FindUpperThresholdOn () |
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 () | |
Self & | SetFindUpperThreshold (bool FindUpperThreshold) |
Self & | SetIsolatedValueTolerance (double IsolatedValueTolerance) |
Self & | SetLower (double Lower) |
Self & | SetReplaceValue (uint8_t ReplaceValue) |
Self & | SetSeed1 (std::vector< unsigned int > Seed1) |
Self & | SetSeed2 (std::vector< unsigned int > Seed2) |
Self & | SetUpper (double Upper) |
std::string | ToString () const |
virtual | ~IsolatedConnectedImageFilter () |
Public Member Functions inherited from itk::simple::ImageFilter | |
ImageFilter () | |
virtual | ~ImageFilter ()=0 |
Public Member Functions inherited from itk::simple::ProcessObject | |
virtual void | Abort () |
virtual int | AddCommand (itk::simple::EventEnum event, const std::function< void()> &func) |
Directly add a callback to observe an event. More... | |
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 |
virtual void | SetNumberOfWorkUnits (unsigned int n) |
virtual unsigned int | GetNumberOfWorkUnits () const |
Private Types | |
using | MemberFunctionType = Image(Self::*)(const Image &image1) |
Private Member Functions | |
template<class TImageType > | |
Image | ExecuteInternal (const Image &image1) |
Private Attributes | |
bool | m_FindUpperThreshold {true} |
double | m_IsolatedValue {0.0} |
double | m_IsolatedValueTolerance {1.0} |
double | m_Lower {0} |
std::unique_ptr< detail::MemberFunctionFactory< MemberFunctionType > > | m_MemberFactory |
uint8_t | m_ReplaceValue {1u} |
std::vector< unsigned int > | m_Seed1 {std::vector<unsigned int>(3, 0)} |
std::vector< unsigned int > | m_Seed2 {std::vector<unsigned int>(3, 0)} |
bool | m_ThresholdingFailed {false} |
double | m_Upper {1} |
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 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... | |
static bool | SetGlobalDefaultThreader (const std::string &threader) |
Set/Get the default threader used for process objects. More... | |
static std::string | GetGlobalDefaultThreader () |
Set/Get the default threader used for process objects. More... | |
static void | SetGlobalDefaultNumberOfThreads (unsigned int n) |
static unsigned int | GetGlobalDefaultNumberOfThreads () |
Set/Get the default threader used for process objects. More... | |
Protected Member Functions inherited from itk::simple::ImageFilter | |
void | CheckImageMatchingDimension (const Image &image1, const Image &image2, const std::string &image2Name) |
void | CheckImageMatchingPixelType (const Image &image1, const Image &image2, const std::string &image2Name) |
void | CheckImageMatchingSize (const Image &image1, const Image &image2, const std::string &image2Name) |
Protected Member Functions inherited from itk::simple::ProcessObject | |
virtual unsigned long | AddITKObserver (const itk::EventObject &, itk::Command *) |
virtual itk::ProcessObject * | GetActiveProcess () |
virtual void | OnActiveProcessDelete () |
virtual void | onCommandDelete (const itk::simple::Command *cmd) noexcept |
virtual void | PreUpdate (itk::ProcessObject *p) |
virtual void | RemoveITKObserver (EventCommand &e) |
Protected Member Functions inherited from itk::simple::NonCopyable | |
NonCopyable ()=default | |
NonCopyable (const NonCopyable &)=delete | |
NonCopyable & | operator= (const NonCopyable &)=delete |
Static Protected Member Functions inherited from itk::simple::ImageFilter | |
template<class TImageType > | |
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 TPixelType , unsigned int VImageDimension, unsigned int VLength, template< typename, unsigned int > class TVector> | |
static Image | CastITKToImage (itk::Image< TVector< TPixelType, VLength >, VImageDimension > *img) |
template<unsigned int VImageDimension, unsigned int VLength, template< unsigned int > class TVector> | |
static Image | CastITKToImage (itk::Image< TVector< VLength >, VImageDimension > *img) |
template<class TImageType > | |
static Image | CastITKToImage (TImageType *img) |
static const itk::EventObject & | GetITKEventObject (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) |
|
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 61 of file sitkIsolatedConnectedImageFilter.h.
Definition at line 51 of file sitkIsolatedConnectedImageFilter.h.
|
virtual |
Destructor
itk::simple::IsolatedConnectedImageFilter::IsolatedConnectedImageFilter | ( | ) |
Default Constructor that takes no arguments and initializes default parameters
Execute the filter on the input image
|
private |
|
inline |
Definition at line 133 of file sitkIsolatedConnectedImageFilter.h.
|
inline |
Set the value of FindUpperThreshold to true or false respectfully.
Definition at line 132 of file sitkIsolatedConnectedImageFilter.h.
|
inline |
Set/Get whether to find an upper threshold (separating two dark regions) or a lower threshold (separating two bright regions).
Definition at line 138 of file sitkIsolatedConnectedImageFilter.h.
|
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 153 of file sitkIsolatedConnectedImageFilter.h.
|
inline |
Set/Get the precision required for the intensity threshold value. The default is 1.
Definition at line 124 of file sitkIsolatedConnectedImageFilter.h.
|
inline |
Set/Get the limit on the lower threshold value. The default is the NonpositiveMin() for the InputPixelType.
Definition at line 94 of file sitkIsolatedConnectedImageFilter.h.
|
inlinevirtual |
Name of this class
Implements itk::simple::ProcessObject.
Definition at line 157 of file sitkIsolatedConnectedImageFilter.h.
|
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 114 of file sitkIsolatedConnectedImageFilter.h.
|
inline |
Definition at line 73 of file sitkIsolatedConnectedImageFilter.h.
|
inline |
Definition at line 84 of file sitkIsolatedConnectedImageFilter.h.
|
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 145 of file sitkIsolatedConnectedImageFilter.h.
|
inline |
Set/Get the limit on the upper threshold value. The default is the max() for the InputPixelType.
Definition at line 104 of file sitkIsolatedConnectedImageFilter.h.
|
inline |
Set/Get whether to find an upper threshold (separating two dark regions) or a lower threshold (separating two bright regions).
Definition at line 129 of file sitkIsolatedConnectedImageFilter.h.
|
inline |
Set/Get the precision required for the intensity threshold value. The default is 1.
Definition at line 119 of file sitkIsolatedConnectedImageFilter.h.
|
inline |
Set/Get the limit on the lower threshold value. The default is the NonpositiveMin() for the InputPixelType.
Definition at line 89 of file sitkIsolatedConnectedImageFilter.h.
|
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 109 of file sitkIsolatedConnectedImageFilter.h.
|
inline |
Set a single seed point 1.
This seed will be isolated from Seed2 (if possible). All pixels connected to this seed will be replaced with ReplaceValue.
Definition at line 69 of file sitkIsolatedConnectedImageFilter.h.
|
inline |
Set a single seed point 2.
This seed will be isolated from Seed1 (if possible).
Definition at line 80 of file sitkIsolatedConnectedImageFilter.h.
|
inline |
Set/Get the limit on the upper threshold value. The default is the max() for the InputPixelType.
Definition at line 99 of file sitkIsolatedConnectedImageFilter.h.
|
virtual |
Print ourselves out
Reimplemented from itk::simple::ProcessObject.
|
friend |
Definition at line 175 of file sitkIsolatedConnectedImageFilter.h.
|
private |
Definition at line 193 of file sitkIsolatedConnectedImageFilter.h.
|
private |
Definition at line 198 of file sitkIsolatedConnectedImageFilter.h.
|
private |
Definition at line 190 of file sitkIsolatedConnectedImageFilter.h.
|
private |
Definition at line 184 of file sitkIsolatedConnectedImageFilter.h.
|
private |
Definition at line 177 of file sitkIsolatedConnectedImageFilter.h.
|
private |
Definition at line 188 of file sitkIsolatedConnectedImageFilter.h.
|
private |
Definition at line 180 of file sitkIsolatedConnectedImageFilter.h.
|
private |
Definition at line 182 of file sitkIsolatedConnectedImageFilter.h.
|
private |
Definition at line 196 of file sitkIsolatedConnectedImageFilter.h.
|
private |
Definition at line 186 of file sitkIsolatedConnectedImageFilter.h.