public class LUTData extends Object implements JIPipeData
Modifier and Type | Method and Description |
---|---|
void |
addStop(float position,
Color color) |
void |
display(String displayName,
JIPipeWorkbench workbench,
JIPipeDataSource source)
This function should display the data in the GUI.
|
JIPipeData |
duplicate(JIPipeProgressInfo progressInfo)
Duplicates the data
|
void |
exportData(JIPipeWriteDataStorage storage,
String name,
boolean forceName,
JIPipeProgressInfo progressInfo)
Saves the data to a folder
|
static LUTData |
fromImage(ij.ImagePlus img,
boolean simplify)
Creates a
LUTData object from an image. |
static LUTData |
fromLUT(ij.process.LUT lut,
boolean simplify)
Imports an ImageJ LUT into a
LUTData object. |
ColorUtils.GradientStop |
get(int index) |
List<ColorUtils.GradientStop> |
getGradientStops() |
static LUTData |
importData(JIPipeReadDataStorage storage,
JIPipeProgressInfo progressInfo) |
Component |
preview(int width,
int height)
This function generates a preview component for usage within the GUI
Can return null
|
void |
setGradientStops(List<ColorUtils.GradientStop> gradientStops) |
int |
size() |
ij.ImagePlus |
toImage(int width,
int height)
Renders the
LUTData into an RGB Image |
ij.process.LUT |
toLUT()
Converts the
LUTData into an ImageJ LUT |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, exportThumbnails, getDescriptionOf, getMenuPathOf, getNameOf, getSortedList, getStorageDocumentation, getStorageSchema, groupByMenuPath, isCommon, isHeavy, isHidden, toDetailedString
public LUTData()
public LUTData(LUTData other)
public static LUTData fromImage(ij.ImagePlus img, boolean simplify)
LUTData
object from an image. The image must RGB color and
contain the value mappings in the first row. LUTs always have 256 colors, but other
number of columns are supported (in such case, the image will be stretched)img
- the LUT imagepublic static LUTData fromLUT(ij.process.LUT lut, boolean simplify)
LUTData
object.
Please note, that ImageJ represents LUTs as array of colors, while LUTData
represents LUTs
as set of gradient stops. The conversion might not be always 100% perfect.lut
- the LUTsimplify
- attempt to remove spurious gradient stopspublic static LUTData importData(JIPipeReadDataStorage storage, JIPipeProgressInfo progressInfo)
public List<ColorUtils.GradientStop> getGradientStops()
public void setGradientStops(List<ColorUtils.GradientStop> gradientStops)
public void exportData(JIPipeWriteDataStorage storage, String name, boolean forceName, JIPipeProgressInfo progressInfo)
JIPipeData
exportData
in interface JIPipeData
storage
- The storage where the data should be writtenname
- A name reference that can be used to generate filename(s)forceName
- If enabled, the data is saved potentially destructively. Generated files must always contain the name parameter. This is used to collect results for humans or other algorithms.progressInfo
- the progresspublic JIPipeData duplicate(JIPipeProgressInfo progressInfo)
JIPipeData
duplicate
in interface JIPipeData
progressInfo
- the progress of duplicating the datapublic void display(String displayName, JIPipeWorkbench workbench, JIPipeDataSource source)
JIPipeData
JIPipeDataDisplayOperation
that can be registered separately.
This item will always be shown as "Default" in the list of operations.display
in interface JIPipeData
displayName
- a name that can be usedworkbench
- the workbenchsource
- optional source of the data. Can be null or any kind of data type (e.g. JIPipeDataSlot
)public Component preview(int width, int height)
JIPipeData
preview
in interface JIPipeData
width
- the target widthheight
- the target heightpublic ij.process.LUT toLUT()
LUTData
into an ImageJ LUT
public ij.ImagePlus toImage(int width, int height)
LUTData
into an RGB Imagepublic int size()
public ColorUtils.GradientStop get(int index)
public void addStop(float position, Color color)
Copyright © 2020–2023 Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Institute (HKI). All rights reserved.