public class ColorClustering extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ColorClustering.Channel
Names of all channels (features) that can be used.
|
Constructor and Description |
---|
ColorClustering(ij.ImagePlus image)
Constructor using only image, features and clusterer will be set as null
|
ColorClustering(ij.ImagePlus image,
int numSamples,
ArrayList<ColorClustering.Channel> selectedChannels)
Creates color clustering object based on image, number of samples and selected channels.
|
Modifier and Type | Method and Description |
---|---|
ij.ImagePlus |
createClusteredImage(FeatureStackArray featureStackArray)
Creates clustered image based on provided FeatureStackArray and using private clusterer, returns as ImagePlus
|
AbstractClusterer |
createClusterer(AbstractClusterer selectedClusterer)
Build clusterer using the current features and the provided number of clusters.
|
void |
createFeatures()
Generate the features based on the selected color space channels.
|
boolean |
createFile(String path,
Instances theInstances)
Create ARFF file of features with provided name.
|
FeatureStackArray |
createFSArray(ij.ImagePlus image)
Create FeatureStackArray based on provided image and selected channels (private variable)
|
ij.ImagePlus |
createProbabilityMaps(FeatureStackArray featureStackArray)
Create probability map based on provided features and current cluster.
|
Instances |
getFeaturesInstances()
Get features instances that are being used
|
FeatureStackArray |
getFeatureStackArray()
Get FeatureStackArray that is being used
|
ij.ImagePlus |
getImage()
Get image that is being used
|
int |
getNumSamples()
Get number of samples that is being used
|
AbstractClusterer |
getTheClusterer()
Get abstract clusterer that has been created
|
boolean |
loadClusterer(String path)
Load clusterer from path
|
boolean |
saveClusterer(String filename)
Save clusterer to a file
|
void |
setChannels(ArrayList<ColorClustering.Channel> selectedChannels)
Set channels to use
|
void |
setFeaturesInstances(Instances featuresInstances)
Set features instances that are to be used
|
void |
setFeatureStackArray(FeatureStackArray featureStackArray)
Set FeatureStackArray that is to be used
|
void |
setImage(ij.ImagePlus image)
Set image that is to be used
|
void |
setNumSamples(int numSamples)
Set number of samples that is to be used
|
void |
setTheClusterer(AbstractClusterer theClusterer)
Set abstract clusterer to be used
|
public ColorClustering(ij.ImagePlus image)
image
- input color image to clusterizepublic ColorClustering(ij.ImagePlus image, int numSamples, ArrayList<ColorClustering.Channel> selectedChannels)
image
- input color imagenumSamples
- number of samples to useselectedChannels
- list of color space channels (features) to usepublic AbstractClusterer createClusterer(AbstractClusterer selectedClusterer)
selectedClusterer
- clustering Weka model to buildpublic void createFeatures()
public FeatureStackArray createFSArray(ij.ImagePlus image)
image
- input color imagepublic ij.ImagePlus createProbabilityMaps(FeatureStackArray featureStackArray)
featureStackArray
- input array of feature stackspublic ij.ImagePlus createClusteredImage(FeatureStackArray featureStackArray)
featureStackArray
- input array of feature stackspublic boolean createFile(String path, Instances theInstances)
path
- complete path to output ARFF filetheInstances
- dataset of instances to saved to filepublic boolean saveClusterer(String filename)
filename
- path to file to be savedpublic boolean loadClusterer(String path)
path
- Path of file to be loadedpublic int getNumSamples()
public void setNumSamples(int numSamples)
numSamples
- number of samples that is to be usedpublic ij.ImagePlus getImage()
public void setImage(ij.ImagePlus image)
image
- color image to be clusterizedpublic FeatureStackArray getFeatureStackArray()
public void setFeatureStackArray(FeatureStackArray featureStackArray)
featureStackArray
- array of feature stacks to use in clusteringpublic Instances getFeaturesInstances()
public void setFeaturesInstances(Instances featuresInstances)
featuresInstances
- set of instances to be used to build the clustererpublic AbstractClusterer getTheClusterer()
public void setTheClusterer(AbstractClusterer theClusterer)
theClusterer
- clustering Weka model to usepublic void setChannels(ArrayList<ColorClustering.Channel> selectedChannels)
selectedChannels
- list of selected channelsCopyright © 2015–2021 Fiji. All rights reserved.