|
SimpleITK
|
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: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 66 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) |
| void | FindUpperThresholdOff () |
| void | 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 () | |
| void | SetFindUpperThreshold (bool FindUpperThreshold) |
| void | SetIsolatedValueTolerance (double IsolatedValueTolerance) |
| void | SetLower (double Lower) |
| void | SetReplaceValue (uint8_t ReplaceValue) |
| void | SetSeed1 (std::vector< unsigned int > Seed1) |
| void | SetSeed2 (std::vector< unsigned int > Seed2) |
| void | 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. | |
| virtual int | AddCommand (itk::simple::EventEnum event, itk::simple::Command &cmd) |
| Add a Command Object to observer the event. | |
| virtual float | GetProgress () const |
| An Active Measurement of the progress of execution. | |
| virtual bool | HasCommand (itk::simple::EventEnum event) const |
| Query of this object has any registered commands for event. | |
| ProcessObject () | |
| virtual void | RemoveAllCommands () |
| Remove all registered commands. | |
| 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) |
Static Private Member Functions | |
| static const detail::MemberFunctionFactory< MemberFunctionType > & | GetMemberFunctionFactory () |
Private Attributes | |
| bool | m_FindUpperThreshold { true } |
| double | m_IsolatedValue { 0.0 } |
| double | m_IsolatedValueTolerance { 1.0 } |
| double | m_Lower { 0 } |
| 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. | |
| static void | SetGlobalDefaultCoordinateTolerance (double) |
| Access the global tolerance to determine congruent spaces. | |
| static double | GetGlobalDefaultDirectionTolerance () |
| Access the global tolerance to determine congruent spaces. | |
| static void | SetGlobalDefaultDirectionTolerance (double) |
| Access the global tolerance to determine congruent spaces. | |
| static bool | SetGlobalDefaultThreader (const std::string &threader) |
| Set/Get the default threader used for process objects. | |
| static std::string | GetGlobalDefaultThreader () |
| Set/Get the default threader used for process objects. | |
| static void | SetGlobalDefaultNumberOfThreads (unsigned int n) |
| static unsigned int | GetGlobalDefaultNumberOfThreads () |
| Set/Get the default threader used for process objects. | |
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 216 of file sitkIsolatedConnectedImageFilter.h.
Define the pixels types supported by this filter
Definition at line 78 of file sitkIsolatedConnectedImageFilter.h.
Definition at line 68 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 |
Referenced by detail::MemberFunctionAddressor< MemberFunctionType >.
|
inline |
Definition at line 178 of file sitkIsolatedConnectedImageFilter.h.
References SetFindUpperThreshold().
|
inline |
Set the value of FindUpperThreshold to true or false respectfully.
Definition at line 176 of file sitkIsolatedConnectedImageFilter.h.
References SetFindUpperThreshold().
|
inline |
Set/Get whether to find an upper threshold (separating two dark regions) or a lower threshold (separating two bright regions).
Definition at line 184 of file sitkIsolatedConnectedImageFilter.h.
References m_FindUpperThreshold.
|
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 201 of file sitkIsolatedConnectedImageFilter.h.
References m_IsolatedValue.
|
inline |
Set/Get the precision required for the intensity threshold value. The default is 1.
Definition at line 163 of file sitkIsolatedConnectedImageFilter.h.
References m_IsolatedValueTolerance.
|
inline |
Set/Get the limit on the lower threshold value. The default is the NonpositiveMin() for the InputPixelType.
Definition at line 122 of file sitkIsolatedConnectedImageFilter.h.
References m_Lower.
|
staticprivate |
|
inlinevirtual |
Name of this class
Implements itk::simple::ProcessObject.
Definition at line 204 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 150 of file sitkIsolatedConnectedImageFilter.h.
References m_ReplaceValue.
|
inline |
Definition at line 95 of file sitkIsolatedConnectedImageFilter.h.
References m_Seed1.
|
inline |
Definition at line 109 of file sitkIsolatedConnectedImageFilter.h.
References m_Seed2.
|
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 193 of file sitkIsolatedConnectedImageFilter.h.
References m_ThresholdingFailed.
|
inline |
Set/Get the limit on the upper threshold value. The default is the max() for the InputPixelType.
Definition at line 135 of file sitkIsolatedConnectedImageFilter.h.
References m_Upper.
|
inline |
Set/Get whether to find an upper threshold (separating two dark regions) or a lower threshold (separating two bright regions).
Definition at line 171 of file sitkIsolatedConnectedImageFilter.h.
References m_FindUpperThreshold.
Referenced by FindUpperThresholdOff(), and FindUpperThresholdOn().
|
inline |
Set/Get the precision required for the intensity threshold value. The default is 1.
Definition at line 157 of file sitkIsolatedConnectedImageFilter.h.
References m_IsolatedValueTolerance.
|
inline |
Set/Get the limit on the lower threshold value. The default is the NonpositiveMin() for the InputPixelType.
Definition at line 116 of file sitkIsolatedConnectedImageFilter.h.
References m_Lower.
|
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 143 of file sitkIsolatedConnectedImageFilter.h.
References m_ReplaceValue.
|
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 90 of file sitkIsolatedConnectedImageFilter.h.
References m_Seed1.
|
inline |
Set a single seed point 2.
This seed will be isolated from Seed1 (if possible).
Definition at line 104 of file sitkIsolatedConnectedImageFilter.h.
References m_Seed2.
|
inline |
Set/Get the limit on the upper threshold value. The default is the max() for the InputPixelType.
Definition at line 129 of file sitkIsolatedConnectedImageFilter.h.
References m_Upper.
|
virtual |
Print ourselves out
Reimplemented from itk::simple::ProcessObject.
|
friend |
Definition at line 217 of file sitkIsolatedConnectedImageFilter.h.
References ExecuteInternal().
|
private |
Definition at line 234 of file sitkIsolatedConnectedImageFilter.h.
Referenced by GetFindUpperThreshold(), and SetFindUpperThreshold().
|
private |
Definition at line 239 of file sitkIsolatedConnectedImageFilter.h.
Referenced by GetIsolatedValue().
|
private |
Definition at line 232 of file sitkIsolatedConnectedImageFilter.h.
Referenced by GetIsolatedValueTolerance(), and SetIsolatedValueTolerance().
|
private |
Definition at line 226 of file sitkIsolatedConnectedImageFilter.h.
Referenced by GetLower(), and SetLower().
|
private |
Definition at line 230 of file sitkIsolatedConnectedImageFilter.h.
Referenced by GetReplaceValue(), and SetReplaceValue().
|
private |
Definition at line 222 of file sitkIsolatedConnectedImageFilter.h.
Referenced by GetSeed1(), and SetSeed1().
|
private |
Definition at line 224 of file sitkIsolatedConnectedImageFilter.h.
Referenced by GetSeed2(), and SetSeed2().
|
private |
Definition at line 238 of file sitkIsolatedConnectedImageFilter.h.
Referenced by GetThresholdingFailed().
|
private |
Definition at line 228 of file sitkIsolatedConnectedImageFilter.h.
Referenced by GetUpper(), and SetUpper().
1.13.2 |
Privacy Policy