public class STmap extends Object implements IQuimpSerialize
This class can be serialized but only as container of maps. Data required for creation of those maps are not serialized, thus restored object is not fully functional. As this is last step in QuimP workflow it may not be necessary to load this JSON anymore.
Modifier and Type | Field and Description |
---|---|
static int |
ALLFLU
Combine all FLU maps.
|
static int |
ALLMAPS
Combine all maps.
|
static int |
CONVEXITY
Convexity map code.
|
static int |
COORD
Coordinates map code.
|
static int |
FLU1
Fluorescence channel 1 map code.
|
static int |
FLU2
Fluorescence channel 2 map code.
|
static int |
FLU3
Fluorescence channel 3 map code.
|
FluoMap[] |
fluoMaps
Fluoroscence maps for channels.
|
static org.slf4j.Logger |
LOGGER
The Constant LOGGER.
|
static int |
MOTILITY
Motility map code.
|
static int |
ORIGIN
Origin map code.
|
static int |
XMAP
X coordinates map code.
|
static int |
YMAP
Y coordinates map code.
|
Constructor and Description |
---|
STmap()
Default constructor to satisfy GSon builder.
|
STmap(OutlineHandler o,
int r,
Qp params)
Build object for given.
|
STmap(STmap src)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
afterSerialize()
This method is called after restoring object from JSON but before returning the object.
|
void |
beforeSerialize()
This method is called just before JSON is generated.
|
double[][] |
getConvMap()
getConvMap.
|
double[][] |
getCoordMap()
Get coordinates map.
|
FluoMap[] |
getFluMaps()
getFluMaps.
|
double[][] |
getMotMap()
getMotMap.
|
double[][] |
getOriginMap()
Get origin map.
|
int |
getRes()
Return resolution of the map.
|
int |
getT()
Return number of outline points.
|
int |
getVerticalResolution()
Compute vertical resolution tiff image generated from map.
|
double[][] |
getxMap()
getxMap.
|
double[][] |
getyMap()
getyMap.
|
ij.ImagePlus |
map2ColorImagePlus(String name,
String palette,
double[][] map,
double min,
double max)
Convert raw map to colorscale.
|
ij.ImagePlus |
map2ImagePlus(String name,
ij.process.ImageProcessor imp)
Convert ImageProcessor created from Map to ImagePlus.
|
void |
resize(ij.ImagePlus imp)
Resize image to size of this map.
|
void |
saveMaps(int maps)
Save map files (maQP) on disk.
|
void |
setCalibration(ij.ImagePlus imp)
Calibrate image for sizes of this maps.
|
void |
setConvMap(double[][] convMap)
Set map.
|
void |
setCoordMap(double[][] coordMap)
Set map.
|
void |
setMotMap(double[][] motMap)
Set map.
|
void |
setOriginMap(double[][] originMap)
Set map.
|
void |
setParams(Qp params)
Attach other than default configuration object.
|
void |
setxMap(double[][] xmap)
Set map.
|
void |
setyMap(double[][] ymap)
Set map.
|
public static org.slf4j.Logger LOGGER
FormatConverter.saveMaps(int)
can replace itpublic static final int MOTILITY
saveMaps(int)
,
Constant Field Valuespublic static final int CONVEXITY
saveMaps(int)
,
Constant Field Valuespublic static final int ORIGIN
saveMaps(int)
,
Constant Field Valuespublic static final int COORD
saveMaps(int)
,
Constant Field Valuespublic static final int XMAP
saveMaps(int)
,
Constant Field Valuespublic static final int YMAP
saveMaps(int)
,
Constant Field Valuespublic static final int FLU1
saveMaps(int)
,
Constant Field Valuespublic static final int FLU2
saveMaps(int)
,
Constant Field Valuespublic static final int FLU3
saveMaps(int)
,
Constant Field Valuespublic static final int ALLFLU
saveMaps(int)
,
Constant Field Valuespublic static final int ALLMAPS
public FluoMap[] fluoMaps
public STmap()
public STmap(STmap src)
warning
Make a copy of serializable fields only
src
- source objectpublic STmap(OutlineHandler o, int r, Qp params)
o
- Outline from ECMMr
- Map resolution in pixelsparams
- configuration of QanalysisQp
public void saveMaps(int maps) throws QuimpException
maps
- Map to be saved, defined in this class. Use ALLMAPS
for save allQuimpException
- any error with saving maps (except IO)public ij.ImagePlus map2ImagePlus(String name, ij.process.ImageProcessor imp)
Usually maps are non-square and need to be rescaled for correct presentation, what this method does.
Note
Take care about what ImageProcessor is used. The ColorProcessor is created from 1D array, whereas e.g. FloatProcessor from 2D arrays. This causes that the same map will be displayed with different orientation. QuimP natively uses maps presented by ColorProcessor, if one uses FloatProcessor it must be rotated and flip to maintain correct orientation. See the following example:
{ @code float[][] motMap = QuimPArrayUtils.double2float(mapCell.motMap); ImageProcessor imp = new FloatProcessor(motMap).rotateRight(); imp.flipHorizontal(); mapCell.map2ImagePlus("motility_map", imp).show(); }
name
- Name of the ImagePlus windowimp
- Image processormap2ColorImagePlus(String, String, double[][], double, double)
public ij.ImagePlus map2ColorImagePlus(String name, String palette, double[][] map, double min, double max)
warning
Assumes that input 2D array map is regular and not column. This method can be used with data restored from QCONF file in the following way:
// Maps are correlated in order with Outlines in DataContainer.
mapCell.map2ColorImagePlus("motility_map", "rwb",mapCell.motMap, oHs.oHs.get(h).migLimits[0],
oHs.oHs.get(h).migLimits[1]).show();
name
- Name of the ImagePlusmap
- Map to convertpalette
- Palette code, can be "rww" or "rwb".min
- Minimum value in Outline that was used for creation of this mapmax
- Maximum value in Outline that was used for creation of this mapmap2ImagePlus(String, ImageProcessor)
,
for palettes
public int getVerticalResolution()
Horizontal resolution is as defined in UI but vertical can be different. USe this method if input coordinates comes from image but not map.
resize(ImagePlus)
public void resize(ij.ImagePlus imp)
imp
- image to resize.public void setCalibration(ij.ImagePlus imp)
imp
- image to calibrate.public int getRes()
This is value set by user in Q Analysis UI.
public int getT()
This is value obtained after interpolation of Outlines.
public double[][] getxMap()
public void setxMap(double[][] xmap)
public double[][] getyMap()
public void setyMap(double[][] ymap)
public double[][] getCoordMap()
public void setCoordMap(double[][] coordMap)
public double[][] getOriginMap()
public void setOriginMap(double[][] originMap)
public double[][] getMotMap()
public void setMotMap(double[][] motMap)
public double[][] getConvMap()
public FluoMap[] getFluMaps()
public void setConvMap(double[][] convMap)
public void setParams(Qp params)
This is passed by constructors, use setParams(Qp)
if deserialised.
params
- the params to setpublic void beforeSerialize()
IQuimpSerialize
beforeSerialize
in interface IQuimpSerialize
Serializer.save(String)
public void afterSerialize() throws Exception
IQuimpSerialize
afterSerialize
in interface IQuimpSerialize
Exception
- from wrapped object in any problem. This is implementation dependentSerializer.load(String)
Copyright © 2002–2019 Department of Computer Science, Warwick University. All rights reserved.