Class ImageServiceBean
java.lang.Object
org.eclipse.dawnsci.plotting.api.histogram.ImageServiceBean
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumEnumeration of image origin in anti-clockwise order. -
Constructor Summary
ConstructorsConstructorDescriptionImageServiceBean(org.eclipse.january.dataset.IDataset slice, ImageServiceBean.HistoType histoType) -
Method Summary
Modifier and TypeMethodDescriptionclone()Clones everything apart from the data, mask and palette.voidDecodes the histo string and sets the values into this bean.voiddispose()Removes all referencesencode()Encodes this bean to a String Currently only the histo type, hi and lo are supported Example: "MEAN", "OUTLIER_VALUES:5-95"booleanintgetAlpha()intgetDepth()Normally null or may be a FunctionContainer which defines the functions to use.doublegetHi()org.eclipse.january.dataset.IDatasetgetImage()org.eclipse.january.dataset.IDatasetdoublegetLo()doubleorg.eclipse.january.dataset.IDatasetgetMask()The mask is false to mask and true to do nothinggetMax()Default colour for positive infinity with bluedoublegetMin()The max valid value for theDefault colour for negative infinity with reddoubleorg.eclipse.core.runtime.IProgressMonitorDefault colour for NaN with greenorg.eclipse.swt.graphics.PaletteDatainthashCode()booleanbooleanisInBounds(double dv) booleanisInsideMaxCut(double dv) booleanisInsideMinCut(double dv) booleanbooleanbooleanisValidNumber(double dv) voidsetAlpha(int alpha) voidsetDepth(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)voidsetFunctionObject(Object userObject) Normally null or you may set to a FunctionContainer which defines the functions to use.voidsetHi(double hi) voidsetHistogramType(ImageServiceBean.HistoType histogramType) voidsetImage(org.eclipse.january.dataset.IDataset image) voidsetImageValue(org.eclipse.january.dataset.IDataset value) Set values to use in colour mappingvoidsetLo(double lo) voidsetLogColorScale(boolean logColorScale) voidsetMask(org.eclipse.january.dataset.IDataset mask) The mask is false to mask and true to do nothingvoidvoidsetMaximumCutBound(HistogramBound maximumBound) voidvoidsetMinimumCutBound(HistogramBound minimumBound) voidsetMonitor(org.eclipse.core.runtime.IProgressMonitor monitor) voidsetNanBound(HistogramBound nanBound) voidvoidsetPalette(org.eclipse.swt.graphics.PaletteData palette) *IMPORTANT* - remember to give the bean a copy of a palette which you do not mind it changing.voidsetTransposed(boolean transposed) Set whether the image should be transposed
-
Constructor Details
-
ImageServiceBean
public ImageServiceBean() -
ImageServiceBean
public ImageServiceBean(org.eclipse.january.dataset.IDataset slice, ImageServiceBean.HistoType histoType)
-
-
Method Details
-
clone
Clones everything apart from the data, mask and palette. -
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
-
setOrigin
-
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
The max valid value for the- Returns:
-
setMin
-
getMax
-
setMax
-
setMonitor
public void setMonitor(org.eclipse.core.runtime.IProgressMonitor monitor) -
isCancelled
public boolean isCancelled() -
getMonitor
public org.eclipse.core.runtime.IProgressMonitor getMonitor() -
getMaximumCutBound
Default colour for positive infinity with blue- Returns:
-
setMaximumCutBound
-
getMaximumCutValue
public double getMaximumCutValue()- Returns:
- value of maximum cut
-
getMinimumCutBound
Default colour for negative infinity with red- Returns:
-
setMinimumCutBound
-
getMinimumCutValue
public double getMinimumCutValue()- Returns:
- value of minimum cut
-
getNanBound
Default colour for NaN with green- Returns:
-
setNanBound
-
getHistogramType
-
setHistogramType
-
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
Normally null or may be a FunctionContainer which defines the functions to use.- Returns:
-
setFunctionObject
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
Decodes the histo string and sets the values into this bean. Example: "MEAN", "OUTLIER_VALUES:5-95"- Parameters:
histo-
-
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() -
equals
-
getLogOffset
public double getLogOffset() -
getAlpha
public int getAlpha() -
setAlpha
public void setAlpha(int alpha)
-