![]() |
open_iA 2021.08
A tool for the visual analysis and processing of volumetric datasets, with a focus on industrial computed tomography.
|
Performs Fuzzy C-Means (FCM) Classification on an image. More...
#include <itkFCMClassifierInitializationImageFilter.h>
Public Types | |
| typedef Superclass::CentroidArrayType | CentroidArrayType |
| typedef NumericTraits< CentroidType > | CentroidNumericTraitsType |
| Other centroid typedefs. More... | |
| typedef Superclass::CentroidType | CentroidType |
| Centroid typedefs (types inherited from the superclass). More... | |
| typedef NumericTraits< CentroidValueType > | CentroidValueNumericTraitsType |
| typedef Superclass::CentroidValueType | CentroidValueType |
| typedef SmartPointer< const Self > | ConstPointer |
| typedef DistanceMetricType::Pointer | DistanceMetricPointer |
| typedef Statistics::EuclideanDistanceMetric< CentroidType > | DistanceMetricType |
| Distance metric measure typdefs. More... | |
| typedef Superclass::InputImagePixelType | InputImagePixelType |
| typedef Superclass::InputImageRegionType | InputImageRegionType |
| typedef Superclass::InputImageType | InputImageType |
| Input image typedef support (types inherited from the superclass). More... | |
| typedef Superclass::InternalImageConstIterator | InternalImageConstIterator |
| typedef Superclass::InternalImageConstPointer | InternalImageConstPointer |
| typedef Superclass::InternalImagePointer | InternalImagePointer |
| typedef Superclass::InternalImageType | InternalImageType |
| Internal image typedef support (types inherited from the superclass). More... | |
| typedef Superclass::MembershipImageIterator | MembershipImageIterator |
| typedef Superclass::MembershipImagePixelType | MembershipImagePixelType |
| typedef Superclass::MembershipImagePointer | MembershipImagePointer |
| typedef Superclass::MembershipImageType | MembershipImageType |
| Membership matrix typedef support (types inherited from the superclass). More... | |
| typedef NumericTraits< MembershipValueType > | MembershipValueNumericTraitsType |
| typedef Superclass::MembershipValueType | MembershipValueType |
| typedef FastMutexLock | MutexLockType |
| Type definitions for mutex lock. More... | |
| typedef MembershipImageType::RegionType | OutputImageRegionType |
| Other membership typedefs. More... | |
| typedef SmartPointer< Self > | Pointer |
| typedef FCMClassifierInitializationImageFilter | Self |
| Standard class typedefs. More... | |
| typedef FuzzyClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision > | Superclass |
Public Types inherited from itk::FuzzyClassifierInitializationImageFilter< TInputImage, double, double > | |
| typedef std::vector< CentroidType > | CentroidArrayType |
| Typdef for the array of centroids. More... | |
| typedef itk::Vector< CentroidValueType, InputImagePixelDimension > | CentroidType |
| Centroid typedef. More... | |
| typedef NumericTraits< CentroidValueType > | CentroidValueNumericTraitsType |
| Other centroid typedefs. More... | |
| typedef double | CentroidValueType |
| typedef SmartPointer< const Self > | ConstPointer |
| typedef ImageRegionConstIterator< InputImageType > | InputImageConstIterator |
| typedef Superclass::InputImageConstPointer | InputImageConstPointer |
| typedef InputImageType::IndexType | InputImageIndexType |
| typedef NumericTraits< InputImagePixelType > | InputImagePixelNumericTraitsType |
| Input image pixel typedefs. More... | |
| typedef PixelTraits< InputImagePixelType > | InputImagePixelTraitsType |
| typedef Superclass::InputImagePixelType | InputImagePixelType |
| typedef InputImagePixelTraitsType::ValueType | InputImagePixelValueType |
| typedef Superclass::InputImagePointer | InputImagePointer |
| Input image typedef support (types inherited from the superclass). More... | |
| typedef Superclass::InputImageRegionType | InputImageRegionType |
| typedef InputImageType::SizeType | InputImageSizeType |
| Other input image typedefs. More... | |
| typedef TInputImage | InputImageType |
| Convenient typedefs for simplifying declarations. More... | |
| typedef ImageRegionConstIterator< InternalImageType > | InternalImageConstIterator |
| typedef InternalImageType::ConstPointer | InternalImageConstPointer |
| typedef ImageRegionIterator< InternalImageType > | InternalImageIterator |
| Other internal image typedefs. More... | |
| typedef InternalImageType::Pointer | InternalImagePointer |
| typedef Image< CentroidType, itkGetStaticConstMacro(InputImageDimension) > | InternalImageType |
| Internal image typedef support. More... | |
| typedef ImageRegionIterator< MembershipImageType > | MembershipImageIterator |
| typedef MembershipImageType::PixelType | MembershipImagePixelType |
| typedef MembershipImageType::Pointer | MembershipImagePointer |
| typedef OutputImageType | MembershipImageType |
| Membership image typedef support. More... | |
| typedef double | MembershipValueType |
| typedef VectorImage< MembershipValueType, itkGetStaticConstMacro(InputImageDimension) > | OutputImageType |
| Convenient typedefs for simplifying declarations. More... | |
| typedef SmartPointer< Self > | Pointer |
| typedef FuzzyClassifierInitializationImageFilter | Self |
| Standard class typedefs. More... | |
| typedef ImageToImageFilter< InputImageType, OutputImageType > | Superclass |
| Standard class typedefs. More... | |
Public Member Functions | |
| itkNewMacro (Self) | |
| Method for creation through the object factory. More... | |
| itkTypeMacro (FCMClassifierInitializationImageFilter, FuzzyClassifierInitializationImageFilter) | |
| Run-time type information (and related methods). More... | |
| void | SetNumberOfClasses (const unsigned int &numOfClasses) override |
| Set number of classes. More... | |
Public Member Functions inherited from itk::FuzzyClassifierInitializationImageFilter< TInputImage, double, double > | |
| virtual double | ComputeDifference (const CentroidArrayType &arrayOfCentroids) |
| Computes the mean square error between centroids and the centroid array passed as parameter. More... | |
| virtual CentroidArrayType | GetCentroids () const |
| Get cluster centroids. More... | |
| itkBooleanMacro (IgnoreBackgroundPixels) | |
| Turn on and off the IgnoreBackgroundPixels flag. More... | |
| itkGetConstMacro (BackgroundPixel, InputImagePixelType) | |
| Get the pixel used as background value in the input image. More... | |
| itkGetConstMacro (Error, double) | |
| Get error between the new class centroids and their values from the previous iteration. More... | |
| itkGetConstMacro (IgnoreBackgroundPixels, bool) | |
| Get true/false depending on whether the algorithm ignores the background pixels or not. More... | |
| itkGetConstMacro (M, double) | |
| Get m fuzziness degree value. More... | |
| itkGetConstMacro (MaximumError, double) | |
| Get maximum error used to stop the algorithm. More... | |
| itkGetConstMacro (MaximumNumberOfIterations, unsigned int) | |
| Get maximum number of iterations. More... | |
| itkGetConstMacro (NumberOfClasses, unsigned int) | |
| Get the number of classes. More... | |
| itkGetConstMacro (NumberOfIterations, unsigned int) | |
| Get number of iterations performed. More... | |
| itkSetClampMacro (M, double, 1.0, NumericTraits< double >::max()) | |
| Set m fuzziness degree value. More... | |
| itkSetClampMacro (MaximumError, double, 0.0, NumericTraits< double >::max()) | |
| Set maximum error used to stop the algorithm. More... | |
| itkSetClampMacro (MaximumNumberOfIterations, unsigned int, 1, NumericTraits< unsigned int >::max()) | |
| Set maximum number of iterations. More... | |
| itkSetMacro (BackgroundPixel, InputImagePixelType) | |
| Set the pixel used as background value in the input image. More... | |
| itkSetMacro (IgnoreBackgroundPixels, bool) | |
| Set true/false depending on whether the algorithm ignores the background pixels or not. More... | |
| itkStaticConstMacro (InputImageDimension, unsigned int, InputImageType::ImageDimension) | |
| Extract dimension from input image. More... | |
| itkStaticConstMacro (InputImagePixelDimension, unsigned int, InputImagePixelTraitsType::Dimension) | |
| Extract dimension from the pixel of the input image. More... | |
| itkTypeMacro (FuzzyClassifierInitializationImageFilter, ImageToImageFilter) | |
| Run-time type information (and related methods). More... | |
| virtual void | SetCentroids (const CentroidArrayType newCentroids) |
| Set class centroids. More... | |
Protected Member Functions | |
| FCMClassifierInitializationImageFilter () | |
| Constructor. More... | |
| virtual | ~FCMClassifierInitializationImageFilter () |
| Destructor. More... | |
| void | AfterThreadedGenerateData () override |
| FCMClassifierInitializationImageFilter is implemented as a multithreaded filter and needs to perform processing after all processing threads have completed. More... | |
| void | BeforeThreadedGenerateData () override |
| FCMClassifierInitializationImageFilter is implemented as a multithreaded filter and needs to perform processing after the output image has been allocated but before threads are spawned. More... | |
| void | PrintSelf (std::ostream &os, Indent indent) const override |
| Write the name-value pairs of the class data members to the supplied output stream. More... | |
| void | ThreadedGenerateData (const OutputImageRegionType &outputRegionForThread, ThreadIdType threadId) override |
| FCMClassifierInitializationImageFilter is implemented as a multithreaded filter. More... | |
Protected Member Functions inherited from itk::FuzzyClassifierInitializationImageFilter< TInputImage, double, double > | |
| FuzzyClassifierInitializationImageFilter () | |
| Constructor. More... | |
| virtual | ~FuzzyClassifierInitializationImageFilter () |
| Destructor. More... | |
| void | ComputeImageToProcess (InternalImageType *imageToProcess) |
| Get the internal image to process. More... | |
| void | ComputePixelAsCentroid (const InputImagePixelType &pixel, CentroidType &pixelAsCentroid) |
| Transforms a given pixel of the input image to the equivalent pixel of centroid type. More... | |
| void | GenerateData () override |
| A version of GenerateData() specific for fuzzy classifiers. More... | |
| void | GenerateOutputInformation () override |
| Generate the information describing the output data. More... | |
| virtual void | Initialize () |
| If a subclass of FuzzyClassifierInitializationImageFilter needs to initialize some data or perform some calculations before to start the first iteration, it should provide an implementation of Initialize(). More... | |
| void | PrintSelf (std::ostream &os, Indent indent) const override |
| Write the name-value pairs of the filter data members to the supplied output stream. More... | |
Protected Attributes | |
| MutexLockType::Pointer | m_CentroidsModificationAttributesLock |
| Mutex lock used to protect the modification of attributes wich are accessed through different threads. More... | |
| DistanceMetricPointer | m_DistanceMetric |
| Pointer to the distance metric to be used. More... | |
Protected Attributes inherited from itk::FuzzyClassifierInitializationImageFilter< TInputImage, double, double > | |
| InputImagePixelType | m_BackgroundPixel |
| Pixel of the input image used as background value. More... | |
| CentroidArrayType | m_Centroids |
| Array of class centroids. More... | |
| double | m_Error |
| Error obtained between the new class centroids and the old values of the centroids (i.e. More... | |
| bool | m_IgnoreBackgroundPixels |
| Flag indicating whether to ignore the background pixels. More... | |
| InternalImagePointer | m_ImageToProcess |
| Pointer to the image to be used internally by the algorithm. More... | |
| double | m_M |
| Fuzzification parameter (m) in the range [1, n], which determines the degree of fuzziness in the clusters. More... | |
| double | m_MaximumError |
| Error threshold used to stop the algorithm. More... | |
| unsigned int | m_MaximumNumberOfIterations |
| Maximum number of iterations allowed. More... | |
| unsigned int | m_NumberOfClasses |
| Number of fuzzy clusters used to classify the image. More... | |
| unsigned int | m_NumberOfIterations |
| Number of iterations performed. More... | |
Performs Fuzzy C-Means (FCM) Classification on an image.
This implementation is based on Bezdek et al.'s paper "FCM: The fuzzy c-means clustering algorithm" (Computers & Geosciences, 10 (2), 191-203., 1984).
FCMClassifierInitializationImageFilter is implemented as a multithreaded filter. This implementation provides BeforeThreadedGenerateData(), ThreadedGenerateData() and AfterThreadedGenerateData() methods. Documentation of the superclass (FuzzyClassifierInitializationImageFilter) explains multhithreaded support in fuzzy classifiers.
| typedef Superclass::CentroidArrayType itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::CentroidArrayType |
| typedef NumericTraits< CentroidType > itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::CentroidNumericTraitsType |
Other centroid typedefs.
| typedef Superclass::CentroidType itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::CentroidType |
Centroid typedefs (types inherited from the superclass).
| typedef NumericTraits< CentroidValueType > itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::CentroidValueNumericTraitsType |
| typedef Superclass::CentroidValueType itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::CentroidValueType |
| typedef SmartPointer< const Self > itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::ConstPointer |
| typedef DistanceMetricType::Pointer itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::DistanceMetricPointer |
| typedef Statistics::EuclideanDistanceMetric< CentroidType > itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::DistanceMetricType |
Distance metric measure typdefs.
| typedef Superclass::InputImagePixelType itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::InputImagePixelType |
| typedef Superclass::InputImageRegionType itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::InputImageRegionType |
| typedef Superclass::InputImageType itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::InputImageType |
Input image typedef support (types inherited from the superclass).
| typedef Superclass::InternalImageConstIterator itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::InternalImageConstIterator |
| typedef Superclass::InternalImageConstPointer itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::InternalImageConstPointer |
| typedef Superclass::InternalImagePointer itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::InternalImagePointer |
| typedef Superclass::InternalImageType itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::InternalImageType |
Internal image typedef support (types inherited from the superclass).
This image is used for internal processing.
| typedef Superclass::MembershipImageIterator itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::MembershipImageIterator |
| typedef Superclass::MembershipImagePixelType itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::MembershipImagePixelType |
| typedef Superclass::MembershipImagePointer itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::MembershipImagePointer |
| typedef Superclass::MembershipImageType itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::MembershipImageType |
Membership matrix typedef support (types inherited from the superclass).
| typedef NumericTraits< MembershipValueType > itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::MembershipValueNumericTraitsType |
| typedef Superclass::MembershipValueType itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::MembershipValueType |
| typedef FastMutexLock itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::MutexLockType |
Type definitions for mutex lock.
Mutex lock allows the locking of variables which are accessed through different threads.
| typedef MembershipImageType::RegionType itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::OutputImageRegionType |
Other membership typedefs.
| typedef SmartPointer< Self > itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::Pointer |
| typedef FCMClassifierInitializationImageFilter itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::Self |
Standard class typedefs.
| typedef FuzzyClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision > itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::Superclass |
|
protected |
Constructor.
|
inlineprotectedvirtual |
Destructor.
|
overrideprotected |
FCMClassifierInitializationImageFilter is implemented as a multithreaded filter and needs to perform processing after all processing threads have completed.
Therefore, this implementation provides an AfterThreadedGenerateData() method. This method is executed once per iteration of the FCM algorithm and will update the centroids and calculate the error.
|
overrideprotected |
FCMClassifierInitializationImageFilter is implemented as a multithreaded filter and needs to perform processing after the output image has been allocated but before threads are spawned.
Therefore, this implementation provides a BeforeThreadedGenerateData() method. This method is executed once per iteration of the FCM algorithm and will store the old values of the centroids and initialize some variables used internally.
| itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::itkNewMacro | ( | Self | ) |
Method for creation through the object factory.
| itk::FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision >::itkTypeMacro | ( | FCMClassifierInitializationImageFilter< TInputImage, TProbabilityPrecision, TCentroidValuePrecision > | , |
| FuzzyClassifierInitializationImageFilter | |||
| ) |
Run-time type information (and related methods).
|
overrideprotected |
Write the name-value pairs of the class data members to the supplied output stream.
|
overridevirtual |
Set number of classes.
This method calls Superclass::SetNumberOfClasses(numOfClasses) and creates some variables used for centroids calculations. This method also sets the size of the vector of old centroids.
Reimplemented from itk::FuzzyClassifierInitializationImageFilter< TInputImage, double, double >.
|
overrideprotected |
FCMClassifierInitializationImageFilter is implemented as a multithreaded filter.
Therefore, this implementation provides a ThreadedGenerateData() method which is called for each processing thread. The output image data is allocated automatically by the supercalss prior to calling ThreadedGenerateData(). ThreadedGenerateData() can only write to the portion of the output membership image specified by the parameter "outputRegionForThread". This method is executed once per iteration of the FCM algorithm and will set that portion of the membership image and perform some calulations used later to update the centroids.
|
protected |
Mutex lock used to protect the modification of attributes wich are accessed through different threads.
|
protected |
Pointer to the distance metric to be used.