Package org.itk.simple
Class ScalarImageKmeansImageFilter
java.lang.Object
org.itk.simple.ProcessObject
org.itk.simple.ImageFilter
org.itk.simple.ScalarImageKmeansImageFilter
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
-
Field Summary
Fields inherited from class org.itk.simple.ProcessObject
swigCMemOwn
-
Constructor Summary
ConstructorsModifierConstructorDescriptionitk::simple::ScalarImageKmeansImageFilter::ScalarImageKmeansImageFilter() Default Constructor that takes no arguments and initializes default parametersprotected
ScalarImageKmeansImageFilter
(long cPtr, boolean cMemoryOwn) -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete()
virtual itk::simple::ScalarImageKmeansImageFilter::~ScalarImageKmeansImageFilter() DestructorImage itk::simple::ScalarImageKmeansImageFilter::Execute(const Image &image1) Execute the filter on the input imageprotected void
finalize()
std::vector<double> itk::simple::ScalarImageKmeansImageFilter::GetClassWithInitialMean() constprotected static long
std::vector<double> itk::simple::ScalarImageKmeansImageFilter::GetFinalMeans() const Return the array of Means found after the classification.getName()
std::string itk::simple::ScalarImageKmeansImageFilter::GetName() const Name of this classboolean
bool itk::simple::ScalarImageKmeansImageFilter::GetUseNonContiguousLabels() const Set/Get the UseNonContiguousLabels flag.void
setClassWithInitialMean
(VectorDouble ClassWithInitialMean) Self& itk::simple::ScalarImageKmeansImageFilter::SetClassWithInitialMean(std::vector< double > ClassWithInitialMean)void
setUseNonContiguousLabels
(boolean UseNonContiguousLabels) Self& itk::simple::ScalarImageKmeansImageFilter::SetUseNonContiguousLabels(bool UseNonContiguousLabels) Set/Get the UseNonContiguousLabels flag.protected static long
toString()
std::string itk::simple::ScalarImageKmeansImageFilter::ToString() const Print ourselves outvoid
Self& itk::simple::ScalarImageKmeansImageFilter::UseNonContiguousLabelsOff()void
Self& itk::simple::ScalarImageKmeansImageFilter::UseNonContiguousLabelsOn() Set the value of UseNonContiguousLabels to true or false respectfully.Methods inherited from class org.itk.simple.ImageFilter
getCPtr, swigRelease
Methods inherited from class org.itk.simple.ProcessObject
abort, addCommand, debugOff, debugOn, getCPtr, getDebug, getGlobalDefaultCoordinateTolerance, getGlobalDefaultDebug, getGlobalDefaultDirectionTolerance, getGlobalDefaultNumberOfThreads, getGlobalDefaultThreader, getGlobalWarningDisplay, getNumberOfThreads, getNumberOfWorkUnits, getProgress, globalDefaultDebugOff, globalDefaultDebugOn, globalWarningDisplayOff, globalWarningDisplayOn, hasCommand, removeAllCommands, setDebug, setGlobalDefaultCoordinateTolerance, setGlobalDefaultDebug, setGlobalDefaultDirectionTolerance, setGlobalDefaultNumberOfThreads, setGlobalDefaultThreader, setGlobalWarningDisplay, setNumberOfThreads, setNumberOfWorkUnits, swigRelease
-
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
-
swigRelease
-
finalize
protected void finalize()- Overrides:
finalize
in classImageFilter
-
delete
public void delete()virtual itk::simple::ScalarImageKmeansImageFilter::~ScalarImageKmeansImageFilter() Destructor- Overrides:
delete
in classImageFilter
-
setClassWithInitialMean
Self& itk::simple::ScalarImageKmeansImageFilter::SetClassWithInitialMean(std::vector< double > ClassWithInitialMean) -
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
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
std::string itk::simple::ScalarImageKmeansImageFilter::GetName() const Name of this class- Overrides:
getName
in classProcessObject
-
toString
std::string itk::simple::ScalarImageKmeansImageFilter::ToString() const Print ourselves out- Overrides:
toString
in classProcessObject
-
execute
Image itk::simple::ScalarImageKmeansImageFilter::Execute(const Image &image1) Execute the filter on the input image
-