Class ScalarImageKmeansImageFilter

java.lang.Object
org.itk.simple.ProcessObject
org.itk.simple.ImageFilter
org.itk.simple.ScalarImageKmeansImageFilter

public class ScalarImageKmeansImageFilter extends ImageFilter
Classifies the intensity values of a scalar image using the K-Means algorithm. Given an input image with scalar values, it uses the K-Means statistical classifier in order to define labels for every pixel in the image. The filter is templated over the type of the input image. The output image is predefined as having the same dimension of the input image and pixel type unsigned char, under the assumption that the classifier will generate less than 256 classes. You may want to look also at the RelabelImageFilter that may be used as a postprocessing stage, in particular if you are interested in ordering the labels by their relative size in number of pixels. See: Image ImageKmeansModelEstimator KdTreeBasedKmeansEstimator, WeightedCentroidKdTreeGenerator, KdTree RelabelImageFilter itk::simple::ScalarImageKmeans for the procedural interface itk::ScalarImageKmeansImageFilter for the Doxygen on the original ITK class. C++ includes: sitkScalarImageKmeansImageFilter.h
  • Constructor Details

    • ScalarImageKmeansImageFilter

      protected ScalarImageKmeansImageFilter(long cPtr, boolean cMemoryOwn)
    • ScalarImageKmeansImageFilter

      public ScalarImageKmeansImageFilter()
      itk::simple::ScalarImageKmeansImageFilter::ScalarImageKmeansImageFilter() Default Constructor that takes no arguments and initializes default parameters
  • Method Details

    • getCPtr

      protected static long getCPtr(ScalarImageKmeansImageFilter obj)
    • swigRelease

      protected static long swigRelease(ScalarImageKmeansImageFilter obj)
    • finalize

      protected void finalize()
      Overrides:
      finalize in class ImageFilter
    • delete

      public void delete()
      virtual itk::simple::ScalarImageKmeansImageFilter::~ScalarImageKmeansImageFilter() Destructor
      Overrides:
      delete in class ImageFilter
    • setClassWithInitialMean

      public void setClassWithInitialMean(VectorDouble ClassWithInitialMean)
      Self& itk::simple::ScalarImageKmeansImageFilter::SetClassWithInitialMean(std::vector< double > ClassWithInitialMean)
    • getClassWithInitialMean

      public VectorDouble getClassWithInitialMean()
      std::vector<double> itk::simple::ScalarImageKmeansImageFilter::GetClassWithInitialMean() const
    • setUseNonContiguousLabels

      public void setUseNonContiguousLabels(boolean UseNonContiguousLabels)
      Self& itk::simple::ScalarImageKmeansImageFilter::SetUseNonContiguousLabels(bool UseNonContiguousLabels) Set/Get the UseNonContiguousLabels flag. When this is set to false the labels are numbered contiguously, like in {0,1,3..N}. When the flag is set to true, the labels are selected in order to span the dynamic range of the output image. This last option is useful when the output image is intended only for display. The default value is false.
    • useNonContiguousLabelsOn

      public void useNonContiguousLabelsOn()
      Self& itk::simple::ScalarImageKmeansImageFilter::UseNonContiguousLabelsOn() Set the value of UseNonContiguousLabels to true or false respectfully.
    • useNonContiguousLabelsOff

      public void useNonContiguousLabelsOff()
      Self& itk::simple::ScalarImageKmeansImageFilter::UseNonContiguousLabelsOff()
    • getUseNonContiguousLabels

      public boolean getUseNonContiguousLabels()
      bool itk::simple::ScalarImageKmeansImageFilter::GetUseNonContiguousLabels() const Set/Get the UseNonContiguousLabels flag. When this is set to false the labels are numbered contiguously, like in {0,1,3..N}. When the flag is set to true, the labels are selected in order to span the dynamic range of the output image. This last option is useful when the output image is intended only for display. The default value is false.
    • getFinalMeans

      public VectorDouble getFinalMeans()
      std::vector<double> itk::simple::ScalarImageKmeansImageFilter::GetFinalMeans() const Return the array of Means found after the classification. This is a measurement. Its value is updated in the Execute methods, so the value will only be valid after an execution.
    • getName

      public String getName()
      std::string itk::simple::ScalarImageKmeansImageFilter::GetName() const Name of this class
      Overrides:
      getName in class ProcessObject
    • toString

      public String toString()
      std::string itk::simple::ScalarImageKmeansImageFilter::ToString() const Print ourselves out
      Overrides:
      toString in class ProcessObject
    • execute

      public Image execute(Image image1)
      Image itk::simple::ScalarImageKmeansImageFilter::Execute(const Image &image1) Execute the filter on the input image