Interface IImageTrace
- All Superinterfaces:
IAxesTrace,ICoordinateSystemTrace,IDownsampledTrace,org.eclipse.january.INameable,IPaletteTrace,ITrace
- All Known Subinterfaces:
IImageStackTrace
- All Known Implementing Classes:
ImageStackTrace,ImageTrace
Interface used for the plotting system to plot images.
In the LightWeightPlotter this is called ImageTrace.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionintgetAlpha()Return the transparency value of the image.intorg.eclipse.january.dataset.IDatasetorg.eclipse.january.dataset.IDatasetdouble[]Get a global axis range associated with the image.return the HistoType being useddefault ObjectgetImage()Get Image object.Default is TOP_LEFT unlike normal plottingorg.eclipse.january.dataset.IDatasetgetMask()The masking dataset of there is one, normally null.org.eclipse.january.dataset.IDatasetIf the original data was RGB data, the trace may sum this and ignore the RGB values.booleanIf true the image is plotted against a true linear axis rather than indicies.voidvoidrepaint()Call to redraw the image, normally the same as repaint on Figure.voidsetAlpha(int alpha) Set the transparency setting The alpha value must be between 0 (transparent) and 255 (opaque).voidChange the axes without changing the underlying data.booleansetData(org.eclipse.january.dataset.ILazyDataset image, List<? extends org.eclipse.january.dataset.IDataset> axes, boolean performAutoScale) Call to set image datavoidChange the down-sample type, will also refresh the UI.voidsetDynamicData(org.eclipse.january.dataset.IDynamicShape dynamic) Set image as a changeable onevoidsetGlobalRange(double[] globalRange) Set a global axis range associated with the image.booleanSets the histo type.voidRepaints the axes and the image to the new origin.voidsetImageUpdateActive(boolean b) You may set the image not to redraw images during updating a number of settings for efficiency reasons.voidsetMask(org.eclipse.january.dataset.IDataset bd) The masking dataset of there is one, normally null.voidsleep()Can be used to clear memory used by the image if the plotting system is no longer active.Methods inherited from interface org.eclipse.dawnsci.plotting.api.trace.IAxesTrace
getAxes, getAxesNames, isActiveMethods inherited from interface org.eclipse.dawnsci.plotting.api.trace.ICoordinateSystemTrace
getAxes, getPointInAxisCoordinates, getPointInImageCoordinates, getRegionInAxisCoordinatesMethods inherited from interface org.eclipse.dawnsci.plotting.api.trace.IDownsampledTrace
addDownsampleListener, getBin, removeDownsampleListenerMethods inherited from interface org.eclipse.january.INameable
getName, setNameMethods inherited from interface org.eclipse.dawnsci.plotting.api.trace.IPaletteTrace
addPaletteListener, getImageServiceBean, getMax, getMaxCut, getMin, getMinCut, getNanBound, getPaletteData, getPaletteName, isRescaleHistogram, removePaletteListener, setMax, setMaxCut, setMin, setMinCut, setNanBound, setPalette, setPaletteData, setPaletteName, setRescaleHistogramMethods inherited from interface org.eclipse.dawnsci.plotting.api.trace.ITrace
dispose, getData, getDataName, getRank, getUserObject, initialize, is3DTrace, isUserTrace, isVisible, setDataName, setUserObject, setUserTrace, setVisible
-
Method Details
-
getRGBData
org.eclipse.january.dataset.IDataset getRGBData()If the original data was RGB data, the trace may sum this and ignore the RGB values. In this case the original RGB data as read from disk is available by calling this method.- Returns:
-
getImageOrigin
ImageServiceBean.ImageOrigin getImageOrigin()Default is TOP_LEFT unlike normal plotting- Returns:
-
setImageOrigin
Repaints the axes and the image to the new origin.- Parameters:
origin-
-
setData
boolean setData(org.eclipse.january.dataset.ILazyDataset image, List<? extends org.eclipse.january.dataset.IDataset> axes, boolean performAutoScale) Call to set image data- Parameters:
image-axes- - may be nullperformAutoScale- - true to rescale to new selection, otherwise keeps last axis position.- Returns:
- false if could not set data
-
setDynamicData
void setDynamicData(org.eclipse.january.dataset.IDynamicShape dynamic) Set image as a changeable one- Parameters:
dynamic-
-
setAxes
Change the axes without changing the underlying data.- Parameters:
axes-performAutoScale-
-
getDownsampleType
IImageTrace.DownsampleType getDownsampleType()- Returns:
- the down-sample type being used for plotting less data than received.
-
setDownsampleType
Change the down-sample type, will also refresh the UI.- Parameters:
type-
-
rehistogram
void rehistogram()- Parameters:
rehisto- image when run
-
getHistoType
ImageServiceBean.HistoType getHistoType()return the HistoType being used- Returns:
-
setHistoType
Sets the histo type. -
setImageUpdateActive
void setImageUpdateActive(boolean b) You may set the image not to redraw images during updating a number of settings for efficiency reasons. Do this in a try{} finally{} block to avoid it being left off.- Parameters:
b-
-
repaint
void repaint()Call to redraw the image, normally the same as repaint on Figure. -
getDownsampled
org.eclipse.january.dataset.IDataset getDownsampled()- Returns:
- the current downsampled Dataset being used to draw the image.
-
getDownsampledMask
org.eclipse.january.dataset.IDataset getDownsampledMask()- Returns:
- the current downsampled mask or null if there is no mask.
-
getDownsampleBin
int getDownsampleBin()- Returns:
- the bin side in pixels which will be used when drawing the image. The bin is a square of side = the return value.
-
getMask
org.eclipse.january.dataset.IDataset getMask()The masking dataset of there is one, normally null. false to mask the pixel, true to leave as is.- Returns:
-
setMask
void setMask(org.eclipse.january.dataset.IDataset bd) The masking dataset of there is one, normally null. false to mask the pixel, true to leave as is. If you don't send a BooleanDataset the system may attempt a cast and throw an exception. -
sleep
void sleep()Can be used to clear memory used by the image if the plotting system is no longer active. -
setAlpha
void setAlpha(int alpha) Set the transparency setting The alpha value must be between 0 (transparent) and 255 (opaque). A value of -1 is the default and means that no CPU is used for alpha.- Parameters:
alpha-
-
getAlpha
int getAlpha()Return the transparency value of the image. The alpha value must be between 0 (transparent) and 255 (opaque). A value of -1 is the default and means that no CPU is used for alpha. -
getGlobalRange
double[] getGlobalRange()Get a global axis range associated with the image. This parameter is used to mark an image trace as part of a collection which will be plotted on true linear axes (in the same style as XY data), potentially with multiple other traces -
setGlobalRange
void setGlobalRange(double[] globalRange) Set a global axis range associated with the image. This parameter is used to mark an image trace as part of a collection which will be plotted on true linear axes (in the same style as XY data), potentially with multiple other traces- Parameters:
globalRange-
-
hasTrueAxes
boolean hasTrueAxes()If true the image is plotted against a true linear axis rather than indicies. Only true if a global range is set.- Returns:
- trueAxes
-
getImage
Get Image object.- Returns:
- Image or null(default)
-