Class ImageTrace

java.lang.Object
org.eclipse.draw2d.Figure
org.dawnsci.plotting.draw2d.swtxy.ImageTrace
All Implemented Interfaces:
EventListener, IAxesTrace, ICoordinateSystemTrace, IDownsampledTrace, IImageTrace, IPaletteTrace, ITrace, ITraceContainer, org.eclipse.draw2d.IFigure, org.eclipse.january.dataset.IDataListener, org.eclipse.january.INameable, org.eclipse.nebula.visualization.xygraph.figures.IAxisListener
Direct Known Subclasses:
ImageStackTrace

public class ImageTrace extends org.eclipse.draw2d.Figure implements IImageTrace, org.eclipse.nebula.visualization.xygraph.figures.IAxisListener, ITraceContainer, org.eclipse.january.dataset.IDataListener
A trace which draws an image to the plot.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.eclipse.draw2d.Figure

    org.eclipse.draw2d.Figure.FigureIterator, org.eclipse.draw2d.Figure.IdentitySearch

    Nested classes/interfaces inherited from interface org.eclipse.draw2d.IFigure

    org.eclipse.draw2d.IFigure.NoInsets

    Nested classes/interfaces inherited from interface org.eclipse.dawnsci.plotting.api.trace.IImageTrace

    IImageTrace.DownsampleType
  • Field Summary

    Fields inherited from class org.eclipse.draw2d.Figure

    bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTip

    Fields inherited from interface org.eclipse.draw2d.IFigure

    MAX_DIMENSION, MIN_DIMENSION, NO_INSETS
  • Constructor Summary

    Constructors
    Constructor
    Description
    ImageTrace(String name, org.eclipse.nebula.visualization.widgets.figureparts.ColorMapRamp intensityScale)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Add listener to be notifed if the dawnsampling changes.
    void
    Call to add a palette listener
    void
    axisAutoScaleChanged(org.eclipse.nebula.visualization.xygraph.figures.Axis axis, boolean oldAutoScale, boolean newAutoScale)
     
    void
    axisForegroundColorChanged(org.eclipse.nebula.visualization.xygraph.figures.Axis axis, org.eclipse.swt.graphics.Color oldColor, org.eclipse.swt.graphics.Color newColor)
     
    void
    axisLogScaleChanged(org.eclipse.nebula.visualization.xygraph.figures.Axis axis, boolean old, boolean logScale)
     
    void
    axisRangeChanged(org.eclipse.nebula.visualization.xygraph.figures.Axis axis, org.eclipse.nebula.visualization.xygraph.linearscale.Range oldRange, org.eclipse.nebula.visualization.xygraph.linearscale.Range newRange)
     
    void
    axisRevalidated(org.eclipse.nebula.visualization.xygraph.figures.Axis axis)
    We do a bit here to ensure that not too many calls to createScaledImage(...) are made.
    void
    axisTitleChanged(org.eclipse.nebula.visualization.xygraph.figures.Axis axis, String oldTitle, String newTitle)
     
    protected boolean
    createScaledImage(org.dawnsci.plotting.draw2d.swtxy.ImageTrace.ImageScaleType rescaleType, org.eclipse.core.runtime.IProgressMonitor monitor)
    When this is called an SWT image is created and saved in the scaledData field.
    void
    dataChangePerformed(org.eclipse.january.dataset.DataEvent evt)
    Called when the internal data of image has changed.
    void
    Called to release system resources.
    protected void
     
    int
    Return the transparency value of the image.
    List<org.eclipse.january.dataset.IDataset>
    The set of axes, either a list of size 2 for a 2D trace or a list of size 3 for a 3D one.
    Labels for the axes.
    int
    Provides the square bin used for the downsample
    org.eclipse.january.dataset.Dataset
    Call this method to return a plotted data set by this trace.
    The name of the original data that this trace was plotted from or null
    int
    Returns the bin for downsampling, either 1,2,4 or 8 currently.
    org.eclipse.january.dataset.IDataset
     
    org.eclipse.january.dataset.IDataset
     
     
    double[]
    Get a global axis range associated with the image.
    return the HistoType being used
    org.eclipse.swt.graphics.Image
    Get Image object.
    Default is TOP_LEFT unlike normal plotting
    Returns the last image service bean sent to the service for getting the image.
    org.eclipse.january.dataset.Dataset
    The masking dataset of there is one, normally null.
    The max intensity for generating the image
    Gets the max cut, a RGB and a bound.
    The min intensity for generating the image
    Gets the min cut, a RGB and a bound.
     
    Gets the Nan cut
    org.eclipse.swt.graphics.PaletteData
    PaletteData for creating the image/surface from the Dataset
    PaletteName for creating the image/surface from the Dataset
     
    double[]
    getPointInAxisCoordinates(double[] point)
    If the axis data set has been set, this method will return a point in the coordinates of the axes labels rather than the indices.
    double[]
    getPointInImageCoordinates(double[] axisLocation)
    For regions over images: if the axis data set has been set, this method will return a point in the coordinates of the image indices rather than the axes.
    int
    The rank of data plotted, 1 for XY, 2 for Image and surfaces, 3 for volumes.
    If the axis data set has been set, this method will return a selection region in the coordinates of the axes labels rather than the indices.
    org.eclipse.january.dataset.IDataset
    If the original data was RGB data, the trace may sum this and ignore the RGB values.
    protected org.dawnsci.plotting.draw2d.swtxy.ScaledImageData
    Get the current image which can be used by the composite trace.
     
    An object which may be set by API users to record information about the plot.
     
     
    boolean
    If true the image is plotted against a true linear axis rather than indicies.
    void
    initialize(IAxis... axes)
    Initialize with given axes
    boolean
     
    boolean
     
    boolean
     
    boolean
    Is the imagetrace set to rescale the histogram when a new image update occurs
    boolean
    True if user trace (normally is)
    protected void
    paintFigure(org.eclipse.draw2d.Graphics graphics)
     
    void
     
    void
     
    void
     
    void
     
    void
    Remove listener so that it is not notified.
    void
    Call to remove a palette listener
    void
    Reset axes back to not keep aspect ratio and original ticks settings
    void
    setAlpha(int alpha)
    Set the transparency setting The alpha value must be between 0 (transparent) and 255 (opaque).
    void
    setAxes(List<? extends org.eclipse.january.dataset.IDataset> axes, boolean performAuto)
    Change the axes without changing the underlying data.
    boolean
    setData(org.eclipse.january.dataset.ILazyDataset im, List<? extends org.eclipse.january.dataset.IDataset> axes, boolean performAuto)
    Call to set image data
    void
    setDataName(String dataName)
    The name of the original data that this trace was plotted from or null
    void
    Change the down-sample type, will also refresh the UI.
    void
    setDynamicData(org.eclipse.january.dataset.IDynamicShape dynamic)
    Set image as a changeable one
    void
    setGlobalRange(double[] globalRange)
    Set a global axis range associated with the image.
    boolean
    Sets the histo type.
    void
    Rotates the image so that its origin is in given corner
    void
    setImageTransposed(boolean imageTransposed)
     
    void
    setImageUpdateActive(boolean active)
    You may set the image not to redraw images during updating a number of settings for efficiency reasons.
    void
    setMask(org.eclipse.january.dataset.IDataset mask)
    Set mask
    void
    The max intensity for generating the image/surface trace
    void
    Sets the min cut, a RGB and a bound.
    void
    The min intensity for generating the image/surface trace
    void
    Sets the min cut, a RGB and a bound.
    void
    setName(String newName)
     
    void
    Sets the Nan cut
    void
    setPalette(String paletteName)
    Setting palette name and looks up this palette in the IPaletteService and applies the palette data for it to the trace as well.
    void
    setPaletteData(org.eclipse.swt.graphics.PaletteData paletteData)
    Setting palette data causes the image to redraw with the new palette.
    void
    setPaletteName(String paletteName)
    Setting palette name
    void
     
    void
    setRescaleHistogram(boolean rescaleHistogram)
    Set wheter an update to the image trace triggers a rehistogram
    void
    This method may do nothing if the trace cannot be changed.
    void
    setUserObject(Object userObject)
    An object which may be set by API users to record information about the plot.
    void
    setUserTrace(boolean isUserTrace)
    True if visible
    void
    setXAxis(org.eclipse.nebula.visualization.xygraph.figures.Axis xAxis)
     
    void
    setYAxis(org.eclipse.nebula.visualization.xygraph.figures.Axis yAxis)
     
    void
    Can be used to clear memory used by the image if the plotting system is no longer active.

    Methods inherited from class org.eclipse.draw2d.Figure

    add, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireCoordinateSystemChanged, fireFigureMoved, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getClippingStrategy, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getLocalBackgroundColor, getLocalFont, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isMouseEventTarget, isOpaque, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, layout, paint, paintBorder, paintChildren, paintClientArea, primTranslate, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setBounds, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setClippingStrategy, setConstraint, setCursor, setEnabled, setFlag, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, useLocalCoordinates, validate

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.eclipse.dawnsci.plotting.api.trace.IImageTrace

    repaint

    Methods inherited from interface org.eclipse.dawnsci.plotting.api.trace.ITrace

    isVisible, setVisible
  • Constructor Details

    • ImageTrace

      public ImageTrace(String name, org.eclipse.nebula.visualization.widgets.figureparts.ColorMapRamp intensityScale)
  • Method Details

    • initialize

      public void initialize(IAxis... axes)
      Description copied from interface: ITrace
      Initialize with given axes
      Specified by:
      initialize in interface ITrace
      Parameters:
      axes -
    • getName

      public String getName()
      Specified by:
      getName in interface org.eclipse.january.INameable
    • setName

      public void setName(String newName)
      Specified by:
      setName in interface org.eclipse.january.INameable
    • getXAxis

      public AspectAxis getXAxis()
    • setXAxis

      public void setXAxis(org.eclipse.nebula.visualization.xygraph.figures.Axis xAxis)
    • getYAxis

      public AspectAxis getYAxis()
    • setYAxis

      public void setYAxis(org.eclipse.nebula.visualization.xygraph.figures.Axis yAxis)
    • getImage

      public org.eclipse.swt.graphics.Image getImage()
      Description copied from interface: IImageTrace
      Get Image object.
      Specified by:
      getImage in interface IImageTrace
      Returns:
      Image or null(default)
    • getPaletteData

      public org.eclipse.swt.graphics.PaletteData getPaletteData()
      Description copied from interface: IPaletteTrace
      PaletteData for creating the image/surface from the Dataset
      Specified by:
      getPaletteData in interface IPaletteTrace
      Returns:
    • setPaletteData

      public void setPaletteData(org.eclipse.swt.graphics.PaletteData paletteData)
      Description copied from interface: IPaletteTrace
      Setting palette data causes the image to redraw with the new palette.
      Specified by:
      setPaletteData in interface IPaletteTrace
      Parameters:
      paletteData -
    • getPaletteName

      public String getPaletteName()
      Description copied from interface: IPaletteTrace
      PaletteName for creating the image/surface from the Dataset
      Specified by:
      getPaletteName in interface IPaletteTrace
      Returns:
    • setPaletteName

      public void setPaletteName(String paletteName)
      Description copied from interface: IPaletteTrace
      Setting palette name
      Specified by:
      setPaletteName in interface IPaletteTrace
      Parameters:
      paletteName -
    • setPalette

      public void setPalette(String paletteName)
      Description copied from interface: IPaletteTrace
      Setting palette name and looks up this palette in the IPaletteService and applies the palette data for it to the trace as well.
      Specified by:
      setPalette in interface IPaletteTrace
      Parameters:
      paletteName -
    • getScaledImageData

      protected org.dawnsci.plotting.draw2d.swtxy.ScaledImageData getScaledImageData()
      Get the current image which can be used by the composite trace.
      Returns:
      Throws:
      Exception
    • createScaledImage

      protected boolean createScaledImage(org.dawnsci.plotting.draw2d.swtxy.ImageTrace.ImageScaleType rescaleType, org.eclipse.core.runtime.IProgressMonitor monitor)
      When this is called an SWT image is created and saved in the scaledData field. The image is downsampled. If rescaleAllowed is set to false, the current bin is not checked and the last scaled image is always used. Do not synchronized this method - it can cause a race condition on linux only.
      Returns:
      true if scaledImage created.
    • setGlobalRange

      public void setGlobalRange(double[] globalRange)
      Description copied from interface: IImageTrace
      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
      Specified by:
      setGlobalRange in interface IImageTrace
      Parameters:
      globalRange -
    • getGlobalRange

      public double[] getGlobalRange()
      Description copied from interface: IImageTrace
      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
      Specified by:
      getGlobalRange in interface IImageTrace
    • fireDownsampleListeners

      protected void fireDownsampleListeners(DownSampleEvent evt)
    • getBin

      public int getBin()
      Description copied from interface: IDownsampledTrace
      Provides the square bin used for the downsample
      Specified by:
      getBin in interface IDownsampledTrace
      Returns:
    • addDownsampleListener

      public void addDownsampleListener(IDownSampleListener l)
      Add listener to be notifed if the dawnsampling changes.
      Specified by:
      addDownsampleListener in interface IDownsampledTrace
      Parameters:
      l -
    • removeDownsampleListener

      public void removeDownsampleListener(IDownSampleListener l)
      Remove listener so that it is not notified.
      Specified by:
      removeDownsampleListener in interface IDownsampledTrace
      Parameters:
      l -
    • getDownsampled

      public org.eclipse.january.dataset.IDataset getDownsampled()
      Specified by:
      getDownsampled in interface IImageTrace
      Returns:
      the current downsampled Dataset being used to draw the image.
    • getDownsampledMask

      public org.eclipse.january.dataset.IDataset getDownsampledMask()
      Specified by:
      getDownsampledMask in interface IImageTrace
      Returns:
      the current downsampled mask or null if there is no mask.
    • getDownsampleBin

      public int getDownsampleBin()
      Returns the bin for downsampling, either 1,2,4 or 8 currently. This gives a pixel count of 1,4,16 or 64 for the bin. If 1 no binning at all is done and no downsampling is being done, getDownsampled() will return the Dataset ok even if bin is one (no downsampling).
      Specified by:
      getDownsampleBin in interface IImageTrace
      Parameters:
      slice -
      bounds -
      Returns:
    • paintFigure

      protected void paintFigure(org.eclipse.draw2d.Graphics graphics)
      Overrides:
      paintFigure in class org.eclipse.draw2d.Figure
    • sleep

      public void sleep()
      Description copied from interface: IImageTrace
      Can be used to clear memory used by the image if the plotting system is no longer active.
      Specified by:
      sleep in interface IImageTrace
    • remove

      public void remove()
    • dispose

      public void dispose()
      Description copied from interface: ITrace
      Called to release system resources.
      Specified by:
      dispose in interface ITrace
    • getData

      public org.eclipse.january.dataset.Dataset getData()
      Description copied from interface: ITrace
      Call this method to return a plotted data set by this trace. Different trace types will return different ranks from getData(). For ILineTrace it is 1D line data For IImageTrace it is a 2D image etc.
      Specified by:
      getData in interface ITrace
    • getRGBData

      public org.eclipse.january.dataset.IDataset getRGBData()
      Description copied from interface: IImageTrace
      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.
      Specified by:
      getRGBData in interface IImageTrace
      Returns:
    • axisRangeChanged

      public void axisRangeChanged(org.eclipse.nebula.visualization.xygraph.figures.Axis axis, org.eclipse.nebula.visualization.xygraph.linearscale.Range oldRange, org.eclipse.nebula.visualization.xygraph.linearscale.Range newRange)
      Specified by:
      axisRangeChanged in interface org.eclipse.nebula.visualization.xygraph.figures.IAxisListener
    • axisRevalidated

      public void axisRevalidated(org.eclipse.nebula.visualization.xygraph.figures.Axis axis)
      We do a bit here to ensure that not too many calls to createScaledImage(...) are made.
      Specified by:
      axisRevalidated in interface org.eclipse.nebula.visualization.xygraph.figures.IAxisListener
    • performAutoscale

      public void performAutoscale()
    • setImageOrigin

      public void setImageOrigin(ImageServiceBean.ImageOrigin imageOrigin)
      Rotates the image so that its origin is in given corner
      Specified by:
      setImageOrigin in interface IImageTrace
      Parameters:
      imageOrigin -
    • getImageOrigin

      public ImageServiceBean.ImageOrigin getImageOrigin()
      Description copied from interface: IImageTrace
      Default is TOP_LEFT unlike normal plotting
      Specified by:
      getImageOrigin in interface IImageTrace
      Returns:
    • setImageTransposed

      public void setImageTransposed(boolean imageTransposed)
    • isRescaleHistogram

      public boolean isRescaleHistogram()
      Description copied from interface: IPaletteTrace
      Is the imagetrace set to rescale the histogram when a new image update occurs
      Specified by:
      isRescaleHistogram in interface IPaletteTrace
      Returns:
      the current state.
    • setRescaleHistogram

      public void setRescaleHistogram(boolean rescaleHistogram)
      Description copied from interface: IPaletteTrace
      Set wheter an update to the image trace triggers a rehistogram
      Specified by:
      setRescaleHistogram in interface IPaletteTrace
      Parameters:
      rescaleHistogram -
    • setData

      public boolean setData(org.eclipse.january.dataset.ILazyDataset im, List<? extends org.eclipse.january.dataset.IDataset> axes, boolean performAuto)
      Description copied from interface: IImageTrace
      Call to set image data
      Specified by:
      setData in interface IImageTrace
      Parameters:
      im -
      axes - - may be null
      performAuto - - true to rescale to new selection, otherwise keeps last axis position.
      Returns:
      false if could not set data
    • setDynamicData

      public void setDynamicData(org.eclipse.january.dataset.IDynamicShape dynamic)
      Description copied from interface: IImageTrace
      Set image as a changeable one
      Specified by:
      setDynamicData in interface IImageTrace
      Parameters:
      dynamic -
    • dataChangePerformed

      public void dataChangePerformed(org.eclipse.january.dataset.DataEvent evt)
      Called when the internal data of image has changed.
      Specified by:
      dataChangePerformed in interface org.eclipse.january.dataset.IDataListener
    • setAxes

      public void setAxes(List<? extends org.eclipse.january.dataset.IDataset> axes, boolean performAuto)
      Description copied from interface: IImageTrace
      Change the axes without changing the underlying data.
      Specified by:
      setAxes in interface IImageTrace
      Parameters:
      axes -
      performAuto -
    • getMin

      public Number getMin()
      Description copied from interface: IPaletteTrace
      The min intensity for generating the image
      Specified by:
      getMin in interface IPaletteTrace
      Returns:
    • setMin

      public void setMin(Number min)
      Description copied from interface: IPaletteTrace
      The min intensity for generating the image/surface trace
      Specified by:
      setMin in interface IPaletteTrace
    • getMax

      public Number getMax()
      Description copied from interface: IPaletteTrace
      The max intensity for generating the image
      Specified by:
      getMax in interface IPaletteTrace
      Returns:
    • setMax

      public void setMax(Number max)
      Description copied from interface: IPaletteTrace
      The max intensity for generating the image/surface trace
      Specified by:
      setMax in interface IPaletteTrace
    • getImageServiceBean

      public ImageServiceBean getImageServiceBean()
      Description copied from interface: IPaletteTrace
      Returns the last image service bean sent to the service for getting the image.
      Specified by:
      getImageServiceBean in interface IPaletteTrace
      Returns:
    • addPaletteListener

      public void addPaletteListener(IPaletteListener pl)
      Description copied from interface: IPaletteTrace
      Call to add a palette listener
      Specified by:
      addPaletteListener in interface IPaletteTrace
      Parameters:
      pl -
    • removePaletteListener

      public void removePaletteListener(IPaletteListener pl)
      Description copied from interface: IPaletteTrace
      Call to remove a palette listener
      Specified by:
      removePaletteListener in interface IPaletteTrace
      Parameters:
      pl -
    • getDownsampleType

      public IImageTrace.DownsampleType getDownsampleType()
      Specified by:
      getDownsampleType in interface IImageTrace
      Returns:
      the down-sample type being used for plotting less data than received.
    • setDownsampleType

      public void setDownsampleType(IImageTrace.DownsampleType type)
      Description copied from interface: IImageTrace
      Change the down-sample type, will also refresh the UI.
      Specified by:
      setDownsampleType in interface IImageTrace
      Parameters:
      type -
    • rehistogram

      public void rehistogram()
      Specified by:
      rehistogram in interface IImageTrace
    • remask

      public void remask()
    • getAxes

      public List<org.eclipse.january.dataset.IDataset> getAxes()
      Description copied from interface: IAxesTrace
      The set of axes, either a list of size 2 for a 2D trace or a list of size 3 for a 3D one. May contain nulls (z is often null for intensity).
      Specified by:
      getAxes in interface IAxesTrace
      Specified by:
      getAxes in interface ICoordinateSystemTrace
      Returns:
    • getHistoType

      public ImageServiceBean.HistoType getHistoType()
      return the HistoType being used
      Specified by:
      getHistoType in interface IImageTrace
      Returns:
    • setHistoType

      public boolean setHistoType(ImageServiceBean.HistoType type)
      Sets the histo type.
      Specified by:
      setHistoType in interface IImageTrace
    • getTrace

      public ITrace getTrace()
      Specified by:
      getTrace in interface ITraceContainer
      Returns:
      the trace which
    • setTrace

      public void setTrace(ITrace trace)
      Description copied from interface: ITraceContainer
      This method may do nothing if the trace cannot be changed.
      Specified by:
      setTrace in interface ITraceContainer
      Parameters:
      trace -
    • setImageUpdateActive

      public void setImageUpdateActive(boolean active)
      Description copied from interface: IImageTrace
      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.
      Specified by:
      setImageUpdateActive in interface IImageTrace
      Parameters:
      active -
    • getMinCut

      public HistogramBound getMinCut()
      Description copied from interface: IPaletteTrace
      Gets the min cut, a RGB and a bound.
      Specified by:
      getMinCut in interface IPaletteTrace
      Returns:
    • setMinCut

      public void setMinCut(HistogramBound bound)
      Description copied from interface: IPaletteTrace
      Sets the min cut, a RGB and a bound.
      Specified by:
      setMinCut in interface IPaletteTrace
    • getMaxCut

      public HistogramBound getMaxCut()
      Description copied from interface: IPaletteTrace
      Gets the max cut, a RGB and a bound.
      Specified by:
      getMaxCut in interface IPaletteTrace
      Returns:
    • setMaxCut

      public void setMaxCut(HistogramBound bound)
      Description copied from interface: IPaletteTrace
      Sets the min cut, a RGB and a bound.
      Specified by:
      setMaxCut in interface IPaletteTrace
    • getNanBound

      public HistogramBound getNanBound()
      Description copied from interface: IPaletteTrace
      Gets the Nan cut
      Specified by:
      getNanBound in interface IPaletteTrace
      Returns:
    • setNanBound

      public void setNanBound(HistogramBound bound)
      Description copied from interface: IPaletteTrace
      Sets the Nan cut
      Specified by:
      setNanBound in interface IPaletteTrace
    • getMask

      public org.eclipse.january.dataset.Dataset getMask()
      The masking dataset of there is one, normally null.
      Specified by:
      getMask in interface IImageTrace
      Returns:
    • setMask

      public void setMask(org.eclipse.january.dataset.IDataset mask)
      Set mask
      Specified by:
      setMask in interface IImageTrace
      Parameters:
      mask -
    • isUserTrace

      public boolean isUserTrace()
      Description copied from interface: ITrace
      True if user trace (normally is)
      Specified by:
      isUserTrace in interface ITrace
      Returns:
    • setUserTrace

      public void setUserTrace(boolean isUserTrace)
      Description copied from interface: ITrace
      True if visible
      Specified by:
      setUserTrace in interface ITrace
    • isMaximumZoom

      public boolean isMaximumZoom()
    • getUserObject

      public Object getUserObject()
      Description copied from interface: ITrace
      An object which may be set by API users to record information about the plot. Ideally avoid objects containing large data in this method.
      Specified by:
      getUserObject in interface ITrace
      Returns:
    • setUserObject

      public void setUserObject(Object userObject)
      Description copied from interface: ITrace
      An object which may be set by API users to record information about the plot. Ideally avoid objects containing large data in this method.
      Specified by:
      setUserObject in interface ITrace
    • getRegionInAxisCoordinates

      public IROI getRegionInAxisCoordinates(IROI roi) throws Exception
      If the axis data set has been set, this method will return a selection region in the coordinates of the axes labels rather than the indices. Ellipse and Sector rois are not currently supported.
      Specified by:
      getRegionInAxisCoordinates in interface ICoordinateSystemTrace
      Returns:
      ROI in label coordinates. This roi is not that useful after it is created. The data processing needs rois with indices.
      Throws:
      Exception - if the roi could not be transformed or the roi type is unknown.
    • getPointInAxisCoordinates

      public double[] getPointInAxisCoordinates(double[] point) throws Exception
      Description copied from interface: ICoordinateSystemTrace
      If the axis data set has been set, this method will return a point in the coordinates of the axes labels rather than the indices. If no axes are set, then the original point is returned. NOTE the double[] passed in is not the pixel coordinates point from events like a mouse click (int[]). It is the data point (indices of real data the case of the image). The return value is the data point looked up in the image custom axes. If no custom axes are set (via the setAxes(..) method) then you will simply get the same double passed back.
      Specified by:
      getPointInAxisCoordinates in interface ICoordinateSystemTrace
      Parameters:
      point - in index of dataset coordinates (same as ROIs on images use).
      Returns:
      point in label coordinates.
      Throws:
      Exception - if the point could not be transformed or the point type is unknown.
      See Also:
      • invalid reference
        ICoordinateSystem
    • getPointInImageCoordinates

      public double[] getPointInImageCoordinates(double[] axisLocation) throws Exception
      Description copied from interface: ICoordinateSystemTrace
      For regions over images: if the axis data set has been set, this method will return a point in the coordinates of the image indices rather than the axes. If no axes are set, then the original point is returned. If the plot is 1D then the original values are returned.
      Specified by:
      getPointInImageCoordinates in interface ICoordinateSystemTrace
      Returns:
      point in index of dataset coordinates (same as ROIs on images use).
      Throws:
      Exception - if the point could not be transformed or the point type is unknown.
      See Also:
      • invalid reference
        ICoordinateSystem
    • getPlottingSystem

      public IPlottingSystem<?> getPlottingSystem()
    • setPlottingSystem

      public void setPlottingSystem(IPlottingSystem<?> plottingSystem)
    • isActive

      public boolean isActive()
      Specified by:
      isActive in interface IAxesTrace
      Returns:
      true if plot is currently plotting.
    • getAxesNames

      public List<String> getAxesNames()
      Description copied from interface: IAxesTrace
      Labels for the axes. The data set name of the axis used if not set. Should be size 3 but may have nulls.
      Specified by:
      getAxesNames in interface IAxesTrace
      Returns:
    • is3DTrace

      public boolean is3DTrace()
      Specified by:
      is3DTrace in interface ITrace
      Returns:
      true if trace is plotted using a 3D viewer.
    • getRank

      public int getRank()
      Description copied from interface: ITrace
      The rank of data plotted, 1 for XY, 2 for Image and surfaces, 3 for volumes.
      Specified by:
      getRank in interface ITrace
      Returns:
    • getDataName

      public String getDataName()
      Description copied from interface: ITrace
      The name of the original data that this trace was plotted from or null
      Specified by:
      getDataName in interface ITrace
      Returns:
    • setDataName

      public void setDataName(String dataName)
      Description copied from interface: ITrace
      The name of the original data that this trace was plotted from or null
      Specified by:
      setDataName in interface ITrace
    • getAlpha

      public int getAlpha()
      Description copied from interface: IImageTrace
      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.
      Specified by:
      getAlpha in interface IImageTrace
    • setAlpha

      public void setAlpha(int alpha)
      Description copied from interface: IImageTrace
      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.
      Specified by:
      setAlpha in interface IImageTrace
      Parameters:
      alpha -
    • hasTrueAxes

      public boolean hasTrueAxes()
      Description copied from interface: IImageTrace
      If true the image is plotted against a true linear axis rather than indicies. Only true if a global range is set.
      Specified by:
      hasTrueAxes in interface IImageTrace
      Returns:
      trueAxes
    • axisForegroundColorChanged

      public void axisForegroundColorChanged(org.eclipse.nebula.visualization.xygraph.figures.Axis axis, org.eclipse.swt.graphics.Color oldColor, org.eclipse.swt.graphics.Color newColor)
      Specified by:
      axisForegroundColorChanged in interface org.eclipse.nebula.visualization.xygraph.figures.IAxisListener
    • axisTitleChanged

      public void axisTitleChanged(org.eclipse.nebula.visualization.xygraph.figures.Axis axis, String oldTitle, String newTitle)
      Specified by:
      axisTitleChanged in interface org.eclipse.nebula.visualization.xygraph.figures.IAxisListener
    • axisAutoScaleChanged

      public void axisAutoScaleChanged(org.eclipse.nebula.visualization.xygraph.figures.Axis axis, boolean oldAutoScale, boolean newAutoScale)
      Specified by:
      axisAutoScaleChanged in interface org.eclipse.nebula.visualization.xygraph.figures.IAxisListener
    • axisLogScaleChanged

      public void axisLogScaleChanged(org.eclipse.nebula.visualization.xygraph.figures.Axis axis, boolean old, boolean logScale)
      Specified by:
      axisLogScaleChanged in interface org.eclipse.nebula.visualization.xygraph.figures.IAxisListener
    • resetAxes

      public void resetAxes()
      Reset axes back to not keep aspect ratio and original ticks settings