public class DefaultLUTService extends AbstractService implements LUTService
ColorTables from files (hosted locally or
externally).| Constructor and Description |
|---|
DefaultLUTService() |
| Modifier and Type | Method and Description |
|---|---|
void |
applyLUT(ColorTable colorTable,
ImageDisplay display)
Applies the given
ColorTable to the active view of the specified
ImageDisplay. |
Dataset |
createDataset(String title,
ColorTable colorTable)
Creates a new dataset showing the given
ColorTable as a ramp. |
Map<String,URL> |
findLUTs()
Finds the
URLs of the LUT files known to ImageJ. |
void |
initialize() |
boolean |
isLUT(File file)
Gets whether the given file can be parsed as a color table by
LUTService.loadLUT(File). |
ColorTable |
loadLUT(File file)
Loads a
ColorTable from a File. |
ColorTable |
loadLUT(InputStream is)
Loads a
ColorTable from an input stream. |
ColorTable |
loadLUT(InputStream is,
int length)
Loads a
ColorTable from an input stream with the given expected
length. |
ColorTable |
loadLUT(URL url)
Loads a
ColorTable from a URL. |
getContext, setContext, toStringgetInfo, getPriority, setInfo, setPrioritycontextclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitregisterEventHandlersgetIdentifier, logcontext, getContext, setContextcompareTo, getPriority, setPrioritygetInfo, setInfogetLocationgetVersiondisposepublic Map<String,URL> findLUTs()
LUTServiceURLs of the LUT files known to ImageJ. LUT files can
reside within a JAR file on the classpath, or in the luts
subdirectory of the application.findLUTs in interface LUTServicepublic boolean isLUT(File file)
LUTServiceLUTService.loadLUT(File).
This method is heuristic in nature, and does not offer a guarantee that
calling LUTService.loadLUT(File) will be successful. However, if it returns
false, it is highly likely that the file is not parsable as a
ColorTable.
isLUT in interface LUTServicepublic ColorTable loadLUT(File file) throws IOException
LUTServiceColorTable from a File.loadLUT in interface LUTServicefile - The file from which the color table data will be read.IOException - if there is a problem reading the color tablepublic ColorTable loadLUT(URL url) throws IOException
LUTServiceColorTable from a URL.loadLUT in interface LUTServiceurl - The URL from which the color table data will be read.IOException - if there is a problem reading the color tablepublic ColorTable loadLUT(InputStream is) throws IOException
LUTServiceColorTable from an input stream.
Does not close the input stream after reading the color table.
loadLUT in interface LUTServiceis - The stream from which the color table data will be read.IOException - if there is a problem reading the color tablepublic ColorTable loadLUT(InputStream is, int length) throws IOException
LUTServiceColorTable from an input stream with the given expected
length.loadLUT in interface LUTServiceis - The stream from which the color table data will be read.length - The expected length of the input stream.IOException - if there is a problem reading the color tablepublic Dataset createDataset(String title, ColorTable colorTable)
LUTServiceColorTable as a ramp.createDataset in interface LUTServicetitle - The title of the new dataset.colorTable - The color table to use.public void applyLUT(ColorTable colorTable, ImageDisplay display)
LUTServiceColorTable to the active view of the specified
ImageDisplay.applyLUT in interface LUTServicepublic void initialize()
initialize in interface Initializableinitialize in interface ServiceCopyright © 2014–2022 ImageJ. All rights reserved.