Class ImageServiceBean

java.lang.Object
org.eclipse.dawnsci.plotting.api.histogram.ImageServiceBean

public class ImageServiceBean extends Object
As histogramming has become more complex and gained more options, this class has become more complex. As much optional information as possible has been defaulted to reduce the values which must be set. See ImageTrace for how to use the bean. For some calls, only
  • Constructor Details

    • ImageServiceBean

      public ImageServiceBean()
    • ImageServiceBean

      public ImageServiceBean(org.eclipse.january.dataset.IDataset slice, ImageServiceBean.HistoType histoType)
  • Method Details

    • clone

      public ImageServiceBean clone()
      Clones everything apart from the data, mask and palette.
      Overrides:
      clone in class Object
    • dispose

      public void dispose()
      Removes all references
    • getImage

      public org.eclipse.january.dataset.IDataset getImage()
      Returns:
      the original downsampled data. If log scale the image will be shifted.
    • setImage

      public void setImage(org.eclipse.january.dataset.IDataset image)
    • getImageValue

      public org.eclipse.january.dataset.IDataset getImageValue()
      Returns:
      values to use in colour mapping. Can be null
    • setImageValue

      public void setImageValue(org.eclipse.january.dataset.IDataset value)
      Set values to use in colour mapping
      Parameters:
      value -
    • getPalette

      public org.eclipse.swt.graphics.PaletteData getPalette()
    • setPalette

      public void setPalette(org.eclipse.swt.graphics.PaletteData palette)
      *IMPORTANT* - remember to give the bean a copy of a palette which you do not mind it changing. This potentially dangerous way the bean works (rather than always making a copy for instance) is for efficiency reasons.
      Parameters:
      palette -
    • getOrigin

      public ImageServiceBean.ImageOrigin getOrigin()
    • setOrigin

      public void setOrigin(ImageServiceBean.ImageOrigin origin)
    • isTransposed

      public boolean isTransposed()
      Returns:
      true if the image is transposed
    • setTransposed

      public void setTransposed(boolean transposed)
      Set whether the image should be transposed
      Parameters:
      transposed -
    • getMin

      public Number getMin()
      The max valid value for the
      Returns:
    • setMin

      public void setMin(Number min)
    • getMax

      public Number getMax()
    • setMax

      public void setMax(Number max)
    • setMonitor

      public void setMonitor(org.eclipse.core.runtime.IProgressMonitor monitor)
    • isCancelled

      public boolean isCancelled()
    • getMonitor

      public org.eclipse.core.runtime.IProgressMonitor getMonitor()
    • getMaximumCutBound

      public HistogramBound getMaximumCutBound()
      Default colour for positive infinity with blue
      Returns:
    • setMaximumCutBound

      public void setMaximumCutBound(HistogramBound maximumBound)
    • getMaximumCutValue

      public double getMaximumCutValue()
      Returns:
      value of maximum cut
    • getMinimumCutBound

      public HistogramBound getMinimumCutBound()
      Default colour for negative infinity with red
      Returns:
    • setMinimumCutBound

      public void setMinimumCutBound(HistogramBound minimumBound)
    • getMinimumCutValue

      public double getMinimumCutValue()
      Returns:
      value of minimum cut
    • getNanBound

      public HistogramBound getNanBound()
      Default colour for NaN with green
      Returns:
    • setNanBound

      public void setNanBound(HistogramBound nanBound)
    • getHistogramType

      public ImageServiceBean.HistoType getHistogramType()
    • setHistogramType

      public void setHistogramType(ImageServiceBean.HistoType histogramType)
    • getDepth

      public int getDepth()
    • setDepth

      public void setDepth(int colorDepth)
      NOTE PaletteData with RGB[] only works with 8-bit or below For 16-bit and above you must use a direct ImagePalette using the constructor ImagePalette(int,int,int)
      Parameters:
      colorDepth -
    • getFunctionObject

      public Object getFunctionObject()
      Normally null or may be a FunctionContainer which defines the functions to use.
      Returns:
    • setFunctionObject

      public void setFunctionObject(Object userObject)
      Normally null or you may set to a FunctionContainer which defines the functions to use.
    • isInBounds

      public boolean isInBounds(double dv)
    • isInsideMinCut

      public boolean isInsideMinCut(double dv)
    • isInsideMaxCut

      public boolean isInsideMaxCut(double dv)
    • isValidNumber

      public boolean isValidNumber(double dv)
    • getMask

      public org.eclipse.january.dataset.IDataset getMask()
      The mask is false to mask and true to do nothing
      Returns:
    • setMask

      public void setMask(org.eclipse.january.dataset.IDataset mask)
      The mask is false to mask and true to do nothing
    • isLogColorScale

      public boolean isLogColorScale()
    • setLogColorScale

      public void setLogColorScale(boolean logColorScale)
    • decode

      public void decode(String histo)
      Decodes the histo string and sets the values into this bean. Example: "MEAN", "OUTLIER_VALUES:5-95"
      Parameters:
      histo -
    • encode

      public String encode()
      Encodes this bean to a String Currently only the histo type, hi and lo are supported Example: "MEAN", "OUTLIER_VALUES:5-95"
      Returns:
    • getLo

      public double getLo()
    • setLo

      public void setLo(double lo)
    • getHi

      public double getHi()
    • setHi

      public void setHi(double hi)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getLogOffset

      public double getLogOffset()
    • getAlpha

      public int getAlpha()
    • setAlpha

      public void setAlpha(int alpha)