SimpleITK
|
The STAPLE filter implements the Simultaneous Truth and Performance Level Estimation algorithm for generating ground truth volumes from a set of binary expert segmentations. More...
#include <sitkSTAPLEImageFilter.h>
The STAPLE filter implements the Simultaneous Truth and Performance Level Estimation algorithm for generating ground truth volumes from a set of binary expert segmentations.
The STAPLE algorithm treats segmentation as a pixelwise classification, which leads to an averaging scheme that accounts for systematic biases in the behavior of experts in order to generate a fuzzy ground truth volume and simultaneous accuracy assessment of each expert. The ground truth volumes produced by this filter are floating point volumes of values between zero and one that indicate probability of each pixel being in the object targeted by the segmentation.
The STAPLE algorithm is described in
S. Warfield, K. Zou, W. Wells, "Validation of image segmentation and expert quality with an expectation-maximization algorithm" in MICCAI 2002: Fifth International Conference on Medical Image Computing and Computer-Assisted Intervention, Springer-Verlag, Heidelberg, Germany, 2002, pp. 298-306
Input volumes must all contain the same size RequestedRegions.
The SetConfidenceWeight parameter is a modifier for the prior probability that any pixel would be classified as inside the target object. This implementation of the STAPLE algorithm automatically calculates prior positive classification probability as the average fraction of the image volume filled by the target object in each input segmentation. The ConfidenceWeight parameter allows for scaling the of this default prior probability: if g_t is the prior probability that a pixel would be classified inside the target object, then g_t is set to g_t * ConfidenceWeight before iterating on the solution. In general ConfidenceWeight should be left to the default of 1.0.
You must provide a foreground value using SetForegroundValue that the STAPLE algorithm will use to identify positively classified pixels in the input images. All other values in the image will be treated as background values. For example, if your input segmentations consist of 1's everywhere inside the segmented region, then use SetForegroundValue(1).
The STAPLE algorithm is an iterative E-M algorithm and will converge on a solution after some number of iterations that cannot be known a priori. After updating the filter, the total elapsed iterations taken to converge on the solution can be queried through GetElapsedIterations() . You may also specify a MaximumNumberOfIterations, after which the algorithm will stop iterating regardless of whether or not it has converged. This implementation of the STAPLE algorithm will find the solution to within seven digits of precision unless it is stopped early.
Once updated, the Sensitivity (true positive fraction, q) and Specificity (true negative fraction, q) for each expert input volume can be queried using GetSensitivity(i) and GetSpecificity(i), where i is the i-th input volume.
Definition at line 76 of file sitkSTAPLEImageFilter.h.
Public Types | |
using | PixelIDTypeList = IntegerPixelIDTypeList |
using | Self = STAPLEImageFilter |
![]() | |
using | Self = ImageFilter |
![]() | |
using | Self = ProcessObject |
Public Member Functions | |
Image | Execute (const Image &image1) |
Image | Execute (const Image &image1, const Image &image2) |
Image | Execute (const Image &image1, const Image &image2, const Image &image3) |
Image | Execute (const Image &image1, const Image &image2, const Image &image3, const Image &image4) |
Image | Execute (const Image &image1, const Image &image2, const Image &image3, const Image &image4, const Image &image5) |
Image | Execute (const std::vector< Image > &images) |
double | GetConfidenceWeight () const |
uint32_t | GetElapsedIterations () const |
double | GetForegroundValue () const |
unsigned int | GetMaximumIterations () const |
std::string | GetName () const |
std::vector< double > | GetSensitivity () const |
std::vector< double > | GetSpecificity () const |
After the filter is updated, this method returns the Specificity (true negative fraction, q) value for the i-th expert input volume. | |
Self & | SetConfidenceWeight (double ConfidenceWeight) |
Self & | SetForegroundValue (double ForegroundValue) |
Self & | SetMaximumIterations (unsigned int MaximumIterations) |
STAPLEImageFilter () | |
std::string | ToString () const |
virtual | ~STAPLEImageFilter () |
![]() | |
ImageFilter () | |
virtual | ~ImageFilter ()=0 |
![]() | |
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 std::vector<Image> & ) |
Private Member Functions | |
template<class TImageType> | |
Image | ExecuteInternal (const std::vector< Image > &images) |
Private Attributes | |
double | m_ConfidenceWeight {1.0} |
uint32_t | m_ElapsedIterations {0} |
double | m_ForegroundValue {1.0} |
unsigned int | m_MaximumIterations {std::numeric_limits<unsigned int>::max()} |
std::unique_ptr< detail::MemberFunctionFactory< MemberFunctionType > > | m_MemberFactory |
std::vector< double > | m_Sensitivity {std::vector<double>()} |
std::vector< double > | m_Specificity {std::vector<double>()} |
Friends | |
struct | detail::MemberFunctionAddressor< MemberFunctionType > |
Additional Inherited Members | |
![]() | |
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. | |
![]() | |
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) |
![]() | |
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) |
![]() | |
NonCopyable ()=default | |
NonCopyable (const NonCopyable &)=delete | |
NonCopyable & | operator= (const NonCopyable &)=delete |
![]() | |
template<class TImageType> | |
static void | FixNonZeroIndex (TImageType *img) |
![]() | |
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 sitkSTAPLEImageFilter.h.
Define the pixels types supported by this filter
Definition at line 91 of file sitkSTAPLEImageFilter.h.
Definition at line 80 of file sitkSTAPLEImageFilter.h.
|
virtual |
Destructor
itk::simple::STAPLEImageFilter::STAPLEImageFilter | ( | ) |
Default Constructor that takes no arguments and initializes default parameters
Image itk::simple::STAPLEImageFilter::Execute | ( | const Image & | image1, |
const Image & | image2, | ||
const Image & | image3 ) |
Image itk::simple::STAPLEImageFilter::Execute | ( | const Image & | image1, |
const Image & | image2, | ||
const Image & | image3, | ||
const Image & | image4 ) |
Image itk::simple::STAPLEImageFilter::Execute | ( | const Image & | image1, |
const Image & | image2, | ||
const Image & | image3, | ||
const Image & | image4, | ||
const Image & | image5 ) |
Execute the filter on the input images
References itk::images.
|
private |
Referenced by detail::MemberFunctionAddressor< MemberFunctionType >.
|
inline |
Scales the estimated prior probability that a pixel will be inside the targeted object of segmentation. The default prior probability g_t is calculated automatically as the average fraction of positively classified pixels to the total size of the volume (across all input volumes). ConfidenceWeight will scale this default value as g_t = g_t * ConfidenceWeight. In general, ConfidenceWeight should be left to the default of 1.0.
Definition at line 104 of file sitkSTAPLEImageFilter.h.
References m_ConfidenceWeight.
|
inline |
Get the number of elapsed iterations of the iterative E-M algorithm.
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 131 of file sitkSTAPLEImageFilter.h.
References m_ElapsedIterations.
|
inline |
Set get the binary ON value of the input image.
Definition at line 114 of file sitkSTAPLEImageFilter.h.
References m_ForegroundValue.
|
inline |
Set/Get the maximum number of iterations after which the STAPLE algorithm will be considered to have converged. In general this SHOULD NOT be set and the algorithm should be allowed to converge on its own.
Definition at line 124 of file sitkSTAPLEImageFilter.h.
References m_MaximumIterations.
|
inlinevirtual |
Name of this class
Implements itk::simple::ProcessObject.
Definition at line 151 of file sitkSTAPLEImageFilter.h.
|
inline |
After the filter is updated, this method returns a std::vector<double> of all Sensitivity (true positive fraction, p) values for the expert input volumes.
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 139 of file sitkSTAPLEImageFilter.h.
References m_Sensitivity.
|
inline |
After the filter is updated, this method returns the Specificity (true negative fraction, q) value for the i-th expert input volume.
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 147 of file sitkSTAPLEImageFilter.h.
References m_Specificity.
|
inline |
Scales the estimated prior probability that a pixel will be inside the targeted object of segmentation. The default prior probability g_t is calculated automatically as the average fraction of positively classified pixels to the total size of the volume (across all input volumes). ConfidenceWeight will scale this default value as g_t = g_t * ConfidenceWeight. In general, ConfidenceWeight should be left to the default of 1.0.
Definition at line 99 of file sitkSTAPLEImageFilter.h.
References m_ConfidenceWeight.
|
inline |
Set get the binary ON value of the input image.
Definition at line 109 of file sitkSTAPLEImageFilter.h.
References m_ForegroundValue.
|
inline |
Set/Get the maximum number of iterations after which the STAPLE algorithm will be considered to have converged. In general this SHOULD NOT be set and the algorithm should be allowed to converge on its own.
Definition at line 119 of file sitkSTAPLEImageFilter.h.
References m_MaximumIterations.
|
virtual |
Print ourselves out
Reimplemented from itk::simple::ProcessObject.
|
friend |
Definition at line 172 of file sitkSTAPLEImageFilter.h.
References ExecuteInternal(), and itk::images.
|
private |
Definition at line 181 of file sitkSTAPLEImageFilter.h.
Referenced by GetConfidenceWeight(), and SetConfidenceWeight().
|
private |
Definition at line 188 of file sitkSTAPLEImageFilter.h.
Referenced by GetElapsedIterations().
|
private |
Definition at line 183 of file sitkSTAPLEImageFilter.h.
Referenced by GetForegroundValue(), and SetForegroundValue().
|
private |
Definition at line 185 of file sitkSTAPLEImageFilter.h.
Referenced by GetMaximumIterations(), and SetMaximumIterations().
|
private |
Definition at line 178 of file sitkSTAPLEImageFilter.h.
|
private |
Definition at line 190 of file sitkSTAPLEImageFilter.h.
Referenced by GetSensitivity().
|
private |
Definition at line 192 of file sitkSTAPLEImageFilter.h.
Referenced by GetSpecificity().