public class BOAState extends Object implements IQuimpSerialize
This class is composed from two inner classes:
Moreover there are several fields related to new features of QuimP like storing internal state
for every frame separately or SnakePlugins.
Serializer
Modifier and Type | Class and Description |
---|---|
class |
BOAState.BOAp
Holds parameters defining snake and controlling contour matching algorithm.
|
Modifier and Type | Field and Description |
---|---|
BinarySegmentation_ |
binarySegmentationPlugin
Instance of binary segmentation plugin that converts BW masks into snakes.
|
BOAState.BOAp |
boap
Reference to old BOAp class, keeps internal state of BOA.
|
ArrayList<Boolean> |
isFrameEdited
Store information whether for current frame button Edit was used.
|
Nest |
nest
Reference to Nest, which is serializable as well.
|
com.github.celldynamics.quimp.BOAState.SegParam |
segParam
Reference to segmentation parameters.
|
SnakePluginList |
snakePluginList
List of plugins selected in plugin stack and information if they are active or not.
|
ArrayList<SnakePluginList> |
snakePluginListSnapshots
Keep snapshots of SnakePluginList objects for every frame separately.
|
Constructor and Description |
---|
BOAState()
Default constructor.
|
BOAState(ij.ImagePlus ip)
Construct BOAState object for given stack size.
|
BOAState(ij.ImagePlus ip,
PluginFactory pf,
ViewUpdater vu)
Construct full base object filling snapshots with default but valid objects.
|
Modifier and Type | Method and Description |
---|---|
void |
afterSerialize()
This method is called after restoring object from JSON but before returning the object.
|
void |
beforeSerialize()
Should be called before serialization.
|
void |
copyPluginListFromSnapshot(int sourceFrame)
Copy
SnakePluginList data from given snapshot to current frame. |
void |
copySegParamFromSnapshot(int sourceFrame)
Copy
SegParam data from given snapshot to current frame. |
void |
loadParams(QParams readQp)
Build internal boa state from QParams object.
|
boolean |
readParams(File paramFile)
Read set of snake parameters from disk.
|
void |
reset(ij.ImagePlus ip,
PluginFactory pf,
ViewUpdater vu)
Reset BOAState class.
|
void |
restore(int frame)
Restore from snapshots data to current one.
|
void |
store(int frame)
Make snapshot of current objects state.
|
void |
storeOnlyEdited(int frame)
Store information whether frame was edited only.
|
void |
writeParams(int sid,
int startF,
int endF)
Write set of snake parameters to disk.
|
public transient com.github.celldynamics.quimp.BOAState.SegParam segParam
On every change of BOA state it is stored as copy in segParamSnapshots for current frame. This is why that field is transient
BOA_.run(String)
,
ConfigurationHandlingpublic BOAState.BOAp boap
public transient BinarySegmentation_ binarySegmentationPlugin
This is regular plugin but handled separately from SnakePlugins and it is not provided as external jar
public ArrayList<SnakePluginList> snakePluginListSnapshots
Plugin configurations are stored as well (but without plugin references)
public transient SnakePluginList snakePluginList
Holds current parameters as the main object not referenced in BOAp On every change of BOA state it is stored as copy in snakePluginListSnapshots for current frame. This is why that field is transient
SnakePluginList
,
BOA_.run(String)
,
store(int)
public Nest nest
public BOAState()
BOAState(ImagePlus)
public BOAState(ij.ImagePlus ip)
ip
- current image object, can be \c null. In latter case only subclasses are
initializedpublic BOAState(ij.ImagePlus ip, PluginFactory pf, ViewUpdater vu)
ip
- current image object, can be \c null. In latter case only subclasses are
initializedpf
- PluginFactory used for creating pluginsvu
- ViewUpdater referencepublic void store(int frame)
frame
- actual frame numbered from 1SnakePluginList
public void restore(int frame)
Technically makes reference links between snapshots and fields keeping hot data.
frame
- current frameSnakePluginList
public void copySegParamFromSnapshot(int sourceFrame)
SegParam
data from given snapshot to current frame.
Exchange data between segParamSnapshots
and segParam
fields making
copy of object but not reference like restore(int)
.
sourceFrame
- valid index of frame to copy parameters from. Numbered from 1copyPluginListFromSnapshot(int)
public void copyPluginListFromSnapshot(int sourceFrame)
SnakePluginList
data from given snapshot to current frame.
Exchange data between snakePluginListSnapshots
and snakePluginList
fields
making copy of object but not reference like restore(int)
.
sourceFrame
- valid index of frame to copy parameters from. Numbered from 1copySegParamFromSnapshot(int)
public void storeOnlyEdited(int frame)
Can be called when global state does not change, e.g. user clicked Edit button so parameters and plugins have not been modified.
frame
- current frame numbered from 1public void reset(ij.ImagePlus ip, PluginFactory pf, ViewUpdater vu)
This method does:
ip
- current image object, can be null. In latter case only subclasses are
initializedpf
- PluginFactory used for creating pluginsvu
- ViewUpdater referencepublic void beforeSerialize()
Creates ArrayLists from Shape.
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)
public void writeParams(int sid, int startF, int endF)
writeParams method creates paQP master file, referencing other associated files and csv file with statistics.
Compatibility layer with old QuimP
sid
- ID of cell. If many cells segmented in one time, QuimP produces separate parameter
file for every of themstartF
- Start frame (typically beginning of stack)endF
- End frame (typically end of stack)QParams
,
ticket/176public boolean readParams(File paramFile)
readParams method reads paQP master file, referencing other associated files.
paramFile
- paQP configuration fileQParams.readParams()
returned falseQParams
,
ticket/176public void loadParams(QParams readQp)
Warning
frame interval and image scale are not loaded by this function due to compatibility with BOA workflow - user set scale on beginning and then use this method to load paQP files.
readQp
- QParams objectCopyright © 2002–2019 Department of Computer Science, Warwick University. All rights reserved.