public class Nest extends Object implements IQuimpSerialize
Constructor and Description |
---|
Nest()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
SnakeHandler |
addHandler(Roi r,
int startFrame)
Add roi to Nest - convert them to Snake and store in SnakeHandler.
|
void |
addHandlers(ArrayList<ArrayList<SegmentedShapeRoi>> roiArray)
Convert array of SegmentedShapeRoi to SnakeHandlers.
|
void |
addHandlers(Roi[] roiArray,
int startFrame)
Add rois to Nest - convert them to Snake and store in SnakeHandler.
|
void |
addOutlinehandler(OutlineHandler oh)
Store OutlineHandler as finalSnake.
|
void |
afterSerialize()
This method is called after restoring object from JSON but before returning the object.
|
boolean |
allDead()
Check if there is live Snake in Nest.
|
boolean |
allFrozen()
Return true is all snake handlers are froze by user.
|
List<CellStatsEval> |
analyse(ij.ImagePlus oi,
boolean saveStats)
Write stQP file using current Snakes
|
void |
beforeSerialize()
This method is called just before JSON is generated.
|
void |
cleanNest()
Remove all handlers from Nest.
|
SnakeHandler |
findClosestTo(int offScreenX,
int offScreenY,
int frame,
double dist)
Find Snake that distance of its centroid to given point is smaller than given value.
|
SnakeHandler |
getHandler(int s)
Gets SnakeHandler.
|
SnakeHandler |
getHandlerofId(int id)
Get SnakeHandler of given id.
|
List<SnakeHandler> |
getHandlers()
Return list of handlers stored in Nest.
|
List<Integer> |
getSnakesforFrame(int frame)
Get list of snakes (its IDs) that are on frame frame.
|
boolean |
isVacant()
Check if Nest is empty.
|
void |
kill(SnakeHandler sh)
Remove SnakeHandler from Nest.
|
void |
removeHandler(SnakeHandler sh)
Remove
SnakeHandler from Nest. |
void |
resetNest()
Reset live snakes to ROI's.
|
void |
reviveNest()
Make all Snakes live in nest.
|
int |
size()
Get NEst size.
|
String |
toString() |
boolean |
writeSnakes()
Write all Snakes to file.
|
public void addHandlers(ArrayList<ArrayList<SegmentedShapeRoi>> roiArray)
Conversion within one SnakeHandler is stopped when there is defective Snake.
roiArray
- First level stands for objects (SnakeHandlers, second for Snakes within one
chainpublic void addHandlers(Roi[] roiArray, int startFrame)
roiArray
- roiArraystartFrame
- start frame, rois from roiArray are added to subsequent frames.public SnakeHandler addHandler(Roi r, int startFrame)
r
- ROI object that contain image object to be segmentedstartFrame
- Current framepublic SnakeHandler getHandler(int s)
s
- Index of SnakeHandler to get.getHandlerofId(int)
public List<SnakeHandler> getHandlers()
public SnakeHandler getHandlerofId(int id)
id
- ID of SnakeHandler to find in Nest.getHandler(int)
public boolean writeSnakes() throws IOException
File names are deducted in called functions.
IOException
- when the file exists but is a directory rather than a regular file, does
not exist but cannot be created, or cannot be opened for any other reasonpublic void kill(SnakeHandler sh)
sh
- handler to remove.public void reviveNest()
public boolean isVacant()
public boolean allDead()
public boolean allFrozen()
public List<CellStatsEval> analyse(ij.ImagePlus oi, boolean saveStats)
Warning
It can set current slice in ImagePlus (modifies the object state).
oi
- instance of current ImagePlus (required by CellStat that extends
ij.measure.MeasurementssaveStats
- if true stQP file is saved in disk, false stats are evaluated only and
returnedpublic void resetNest()
public void removeHandler(SnakeHandler sh)
SnakeHandler
from Nest.sh
- SnakeHandler to remove.public void cleanNest()
public int size()
public List<Integer> getSnakesforFrame(int frame)
frame
- Frame find snakes inpublic void addOutlinehandler(OutlineHandler oh)
Use SnakeHandler.copyFromFinalToSeg()
to populate
snake over segSnakes.
Conversion to Snakes is through Rois
oh
- OutlineHandler to convert from.public SnakeHandler findClosestTo(int offScreenX, int offScreenY, int frame, double dist)
offScreenX
- x coordinateoffScreenY
- y coordinateframe
- framedist
- maximal distancepublic 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.