public class SpectralTransform extends ImageTransform implements TransformListener
Modifier and Type | Field and Description |
---|---|
protected SpectralWidget |
controls
Controls for this spectral mapping.
|
protected RealType[] |
range
Output range components.
|
protected double[][] |
weights
Spectral channel weights.
|
MICRON, micronHeight, micronStep, micronWidth, xType, yType, zType
Constructor and Description |
---|
SpectralTransform()
Creates an uninitialized spectral mapping.
|
SpectralTransform(DataTransform parent,
String name,
int numRange)
Creates a spectral mapping from the given transform.
|
Modifier and Type | Method and Description |
---|---|
static FlatField |
doWeightedMapping(FlatField field,
RealType[] types,
double[][] weights)
Applies a spectral mapping to the given field based on the given weights
and range types.
|
String |
getCacheId(int[] pos,
boolean global)
Gets a string id uniquely describing this data transform at the given
dimensional position, for the purposes of thumbnail caching.
|
JComponent |
getControls()
Gets associated GUI controls for this transform.
|
Data |
getData(TransformLink link,
int[] pos,
int dim,
DataCache cache)
Retrieves the data corresponding to the given dimensional position, for the
given display dimensionality.
|
int |
getImageHeight()
Gets height of each image.
|
int |
getImageWidth()
Gets width of each image.
|
int |
getRangeCount()
Gets number of range components at each pixel.
|
double[][] |
getWeights()
Gets spectral channel weights.
|
void |
initState(Dynamic dyn)
Modifies this object's state to match that of the given object.
|
boolean |
isCompatible(Dynamic dyn)
Tests whether the given dynamic object can be used as an argument to
initState, for initializing this dynamic object.
|
static boolean |
isParentRequired()
Indicates whether this transform type requires a parent transform.
|
boolean |
isValidDimension(int dim)
Gets whether this transform provides data of the given dimensionality.
|
static boolean |
isValidParent(DataTransform data)
Indicates whether this transform type would accept the given transform as
its parent transform.
|
static DataTransform |
makeTransform(DataManager dm)
Creates a new spectral mapping, with user interaction.
|
boolean |
matches(Dynamic dyn)
Tests whether two dynamic objects are equivalent.
|
void |
restoreState(Element el)
Restores the current state from the given DOM element ("SpectralMapping").
|
void |
saveState(Element el)
Writes the current state to the given DOM element ("DataTransforms").
|
void |
setParameters(double[][] weights)
Assigns the parameters for this spectral mapping.
|
void |
transformChanged(TransformEvent e)
Called when parent data transform's parameters are updated.
|
canDisplay3D, getHTMLDescription, getImage, getImageUnits, getMicronHeight, getMicronStep, getMicronStep, getMicronWidth, getRangeTypes, getSuggestedMaps, getType, getXType, getYType, getZType, getZUnit, isImmediate
addTransformListener, canDisplay2D, discard, displayChanged, getDimTypes, getFont, getLabels, getLengths, getName, getParent, getThumbHandler, getTransformId, getUnitDescription, makeLabels, notifyListeners, removeTransformListener, setFont, toString
protected RealType[] range
protected double[][] weights
protected SpectralWidget controls
public SpectralTransform()
public SpectralTransform(DataTransform parent, String name, int numRange)
public void setParameters(double[][] weights)
public double[][] getWeights()
public int getImageWidth()
getImageWidth
in class ImageTransform
public int getImageHeight()
getImageHeight
in class ImageTransform
public int getRangeCount()
getRangeCount
in class ImageTransform
public static DataTransform makeTransform(DataManager dm)
public static boolean isValidParent(DataTransform data)
public static boolean isParentRequired()
public Data getData(TransformLink link, int[] pos, int dim, DataCache cache)
getData
in class ImageTransform
public boolean isValidDimension(int dim)
isValidDimension
in class DataTransform
public String getCacheId(int[] pos, boolean global)
getCacheId
in class DataTransform
public JComponent getControls()
getControls
in class DataTransform
public boolean matches(Dynamic dyn)
matches
in interface Dynamic
matches
in class DataTransform
public boolean isCompatible(Dynamic dyn)
isCompatible
in interface Dynamic
isCompatible
in class DataTransform
public void initState(Dynamic dyn)
initState
in interface Dynamic
initState
in class DataTransform
public void saveState(Element el) throws SaveException
saveState
in interface Saveable
saveState
in class ImageTransform
SaveException
public void restoreState(Element el) throws SaveException
restoreState
in interface Saveable
restoreState
in class ImageTransform
SaveException
public void transformChanged(TransformEvent e)
transformChanged
in interface TransformListener
Copyright © 2015–2022 SciJava. All rights reserved.