public class SegmentationController extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
SegmentationController.Executable
Tasks for the exception throwing service.
|
Constructor and Description |
---|
SegmentationController(SegmentationModel model)
Creates a controller for the supplied model.
|
Modifier and Type | Method and Description |
---|---|
void |
addFrameListener(FrameListener listener)
Adds a new frame listener that gets notified whenever: nextFrame, previousFrame, setFrame, or the backing imageplus is changed.
|
void |
addMesh(DeformableMesh3D m)
Adds the mesh to the currently selected track.
|
void |
addMesh(int frame,
DeformableMesh3D m)
Adds the provided mesh to the model.
|
void |
addMeshListener(FrameListener listener)
Adds a listener, that gets notified every time the displayed meshes should change.
|
void |
addTracer(Track t)
Addes a line that follows the center of mass of the provided mesh track to the current frame.
|
void |
addTransientObject(DataObject dataObject)
Adds a data object to the current meshframe, the object is "transient" and will be removed
when clear transient objects is called.
|
void |
addUndoStateListener(StateListener listener)
Gets notified when the action stack updates the value.
|
void |
autotrackAvailableTracks() |
void |
calculateAllInterfaceTimeScans()
Iterates over all of the meshes and calculates intensity.
|
void |
calculateLineScans()
TODO remove
|
void |
calculateObscuringMeshes(double v)
Calculates the surface area over time, and the surface areas that are obscured by neighboring meshes.
|
void |
calculateSelectedInterfaceTimeScans()
Calculates the time course for the selected mesh only.
|
boolean |
canRedo()
Checks if there is an action to be undone.
|
boolean |
canUndo()
Checks if there is an action to be undone.
|
void |
centerSelectedMesh() |
void |
changeVolumeClipping(int minDelta,
int maxDelta)
Adjust the min/max values for clipping the image.
|
void |
clearHistory()
The history can take up a lot of memory, especially for actions like deformlAllMeshes.
|
void |
clearMesh(DeformableMesh3D mesh)
Least efficient way to clear a mesh.
|
void |
clearMeshFromTrack(Track t,
int f) |
void |
clearMeshFromTrack(Track old,
int f,
DeformableMesh3D mesh)
Clears the mesh specified mesh from the track at the specific time frame.
|
void |
clearSelectedMesh()
Remove the currently selected mesh, from the current frame only.
|
void |
clearTransientObjects()
clears all transient objects, objects being displayed in the 3d viewer that were added as transient objects.
|
void |
confineMesh(DeformableMesh3D mesh)
If a point is outside of the boundary, it is moved to the edge along that axis.
|
DeformableMesh3D |
copyMesh(DeformableMesh3D mesh)
Creates a copy of the provided mesh.
|
void |
createBinaryImage()
Creates an imageplus that is a binary image with pixes values 1 inside a mesh and 0 outside.
|
void |
createDataTable() |
void |
createEnergyImage()
Creates an image that is generated by the current image energy.
|
FurrowTransformer |
createFurrowTransform(double[] pos,
double[] normal)
The provided normal and position represent a plane.
|
void |
createLabelledImage(List<Track> tracks)
Creates a labelled image of the provided tracks.
|
void |
createMosaicImage()
Creates a mosaic image, which is like a binary image, execept each mesh is labelled with it's color instead of
binary.
|
Image |
createSlice(double[] pos,
double[] normal)
Creates an image based on a furrow transformer built using the provided position and normal.
|
Image |
createSlice(FurrowTransformer transformer)
Creates an Image based on slicing the working volume with the plane represented by this transformer.
|
void |
curvatureSnapShot()
Takes the currently selected mesh and looks for neighbors.
|
SurfacePlot |
curvatureSurfacePlot()
Creates a 3D plot frame for the currently selected mesh, and plots the curvature on the surface.
|
void |
deformAllMeshes()
Deforms all meshes in the current frame sequentially.
|
void |
deformAllMeshes(int steps)
Deforms all meshes in the current frame for steps number of iterations, sequentially.
|
void |
deformMesh()
Deforms mesh until stopped.
|
void |
deformMesh(int count)
Deforms mesh for a set number of iterations.
|
void |
deformPartialMesh() |
void |
exportAsPly(File f)
Export every mesh in the current frame as a ply file with color.
|
void |
exportAsStl(File f)
Saves all of the meshes in the current frame as an ascii stl file.
|
void |
exportAsWireframeStl(File f)
Export as wire-frame mesh stl file.
|
void |
generateTrainingData(int start,
int finish)
Training data consists of two images.
|
List<Track> |
getAllTracks() |
double |
getAlpha() |
double |
getBeta() |
Box3D |
getBounds()
Bounds of the current image being analyzed.
|
int |
getCurrentChannel()
Gets the currently selected channel.
|
int |
getCurrentFrame()
Zero based frame number.
|
long |
getCurrentState()
The action stack controls the undo/redo commands.
|
int |
getDeformationSteps()
Gets the current number of deformations that have occurred.
|
int |
getDivisions() |
List<Exception> |
getExecutionErrors()
For the gui to check for errors.
|
double |
getGamma() |
double |
getImageWeight() |
File |
getLastSavedFile()
For using save without save-as.
|
double |
getMaxConnectionLength() |
DeformableMesh3D |
getMesh() |
MeshFrame3D |
getMeshFrame3D()
Returns the main 3D view.
|
MeshImageStack |
getMeshImageStack()
Gets the currently selected MeshImageStack.
|
boolean |
getMeshModified()
returns true if the current state of mesh tracks has changed.
|
double |
getMinConnectionLength() |
SegmentationModel |
getModel()
This is being exposed to create undoable tasks it should not be used if it can be avoided.
|
int |
getNChannels()
Get the number of channels of the currently selected image.
|
int |
getNFrames()
Total number of frames in the movie.
|
double |
getNormalizeWeight() |
int[] |
getOriginalStackDimensions() |
double |
getPressure() |
String |
getRedoName()
Returns the name of the next action that can be redone.
|
RingController |
getRingController()
Controls the furrow.
|
DeformableMesh3D |
getSelectedMesh() |
String |
getSelectedMeshName()
Gets the name of the currently selected mesh.
|
Track |
getSelectedMeshTrack() |
String |
getShortImageName()
Returns the short image name based on the full image title with the image name extension removed.
|
double |
getStericNeighborWeight() |
double[] |
getSurfaceOffsets()
The origin in the 3d view is in the center of the original image.
|
String |
getUndoName()
Gets the name of the next action to be undone, if it has a name.
|
Color |
getVolumeColor() |
double |
getZToYScale() |
ij.ImagePlus |
guessMeshes(int level)
Thresholds the current image and places meshes over the individual regions.
|
boolean |
has3DViewer()
Checks for a MeshFrame3D.
|
boolean |
hasOriginalPlus()
Checks if an image is loaded.
|
void |
hideVolume()
Stops displaying the volume in the meshframe3d.
|
void |
importMeshes(File f,
ImportType type)
Opens the meshfile and adds all of the meshes to the current meshes.
|
void |
initializeMesh(DeformableMesh3D mesh)
For creating a new mesh, if there is a currently selected mesh in the current frame,
this starts a new mesh track.
|
SurfacePlot |
intensitySurfacePlot()
Creates an object that is used for producing an intensity plot based on the currently selected mesh and image.
|
void |
linkPossibleTrack()
If the currently selected mesh is available, this well look in the same
area in the next frame and link the best possibility.
|
void |
load3DFurrows(File f)
Loads furrows, 3D plane 1 per frame.
|
void |
loadImage(String file_name)
Loads an imageplus from the provided file.
|
void |
loadMeshes(File f)
Loads meshes and replaces the current meshes.
|
void |
loadParameters(File f)
gets deformation parameters that have been saved in a file.
|
void |
lumpImports(List<Track> imports)
Groups all of the meshes into the current frame.
|
void |
maskToDistanceTransform()
Creates a distance transform with the currently selected image.
|
void |
measureAllVolumes()
Measures the volumes for all of the mesh tracks, creates a text window with the data like.
|
void |
measureSelected()
Measures the selected track through time and calculates:
c_x, c_y, c_z: centroid position coordinates.
|
void |
measureVolume()
Opens a window with volume measurements for the currently selected mesh track.
|
void |
nextFrame()
Changes to the next image frame.
|
void |
plotCellCount()
Creates a plot of mesh count vs time.
|
void |
plotDisplacements()
Creates two plots.
|
void |
plotElongationsVsTime()
Finds the principle moments of Inertia and plots the anisotropy over time.
|
void |
plotTrackingStatistics()
Creates a plot with information about the frame to frame displacement of the current set of meshes.
|
void |
plotVolumeAveragedIntensityVsTime() |
void |
plotVolumes()
Plots the volumes of meshes over time for all of the meshes.
|
void |
previousFrame()
Moves to the previous image frame.
|
void |
recordSnapshots(int start,
int end)
Creates an ImagePlus with snapshots from each frame.
|
void |
redo()
moves the action stack forward.
|
void |
relateImports(List<Track> imports)
Finds the earliest mesh frame, aligns that to the current frame
|
void |
reMesh()
Remeshes the currently selected mesh by raycasting a sphere.
|
void |
reMeshConnections(double minConnectionLength,
double maxConnectionLength)
Remesh the selected mesh to the provided min and max connection lengths.
|
void |
reMeshConnections(Track track,
int frame,
double minConnectionLength,
double maxConnectionLength)
Remeshes the current track by using the remesh connection algorithm.
|
void |
reMeshConnectionsAllMeshes(double minConnectionLength,
double maxConnectionLength)
Applies the connection remesh algorith to all meshes in the current frame.
|
void |
removeFrameListener(FrameListener listener) |
void |
removeMeshListener(FrameListener listener) |
void |
removeUndoStateListener(StateListener listener) |
void |
renderMeshesIn2D()
Opens a new window that renders the provided meshes in 2D.
|
void |
restartMeshes()
Clears ALL of the current meshes.
|
void |
saveFurrows(File f)
Saves the furrow from each plane.
|
void |
saveMeshes(File f)
Saves the current meshes
|
void |
saveParameters(File f)
Saves the current deformation parameters to a file.
|
void |
selectChannel(int c) |
void |
selectImports(List<Track> imports)
Reduces the provided meshes to only meshes in the currently selected frame.
|
void |
selectMesh(DeformableMesh3D mesh)
Attempts to select the track that contains the provided mesh.
|
void |
selectMeshTrack(Track track)
Overload for convenience.
|
void |
selectNextMeshTrack()
Changes the currently selected track to be the next one.
|
void |
selectNone()
Causes no mesh track to be selected.
|
void |
selectPreviousMeshTrack()
Changes to the previously selected track.
|
void |
setAlpha(double d)
Deformation parameter, effectively the spring-like stiffness connections.
|
void |
setBeta(double d)
deformation parameter: represents the bending stiffness.
|
void |
setDivisions(int d)
When a new mesh is created, it is subdivided this number of times.
|
void |
setFurrowForCurrentFrame(double[] center,
double[] normal)
Sets the position and normal of the furrow.
|
void |
setGamma(double gamma)
Deformation parameter, high values limit the rate of deformation.
|
void |
setHardBoundaries(boolean v)
Hard boundaries cause a mesh to be confined after each step during deformation.
|
void |
setImageEnergyType(ImageEnergyType selectedItem)
The type of image energy that will be used.
|
void |
setMaxConnectionLength(double mcl)
Set the maximum connection length that is used when doing a connection remesh.
|
void |
setMesh(Track track,
int frame,
DeformableMesh3D mesh)
Sets the provided mesh to be the mesh for the provided track at the specified frame.
|
void |
setMeshes(List<Track> tracks,
int frame,
List<DeformableMesh3D> meshes)
Adds all of the provided meshes to the corresponding track.
|
void |
setMeshFrame3D(MeshFrame3D meshFrame3D)
Sets up the provided meshframe3d as the main threed display.
|
void |
setMeshTracks(List<Track> replacements)
Replaces the current tracks with the provided.
|
void |
setMinConnectionLength(double mcl)
Gets the minimum connection length when doing a connection remesh.
|
void |
setNormalizerWeight(double d)
Turns on an external energy that tries to normalize triangle sizes.
|
void |
setOriginalPlus(ij.ImagePlus plus)
Sets the current image, and sets it on channel 0.
|
void |
setOriginalPlus(ij.ImagePlus plus,
int channel)
Causes the provided image to be the main backing image data.
|
void |
setPressure(double d)
For shrinking or growing a mesh.
|
void |
setRigidBoundaries(boolean selected)
When true, deforming meshes are confined at each step.
|
void |
setStericNeighborWeight(double d)
Causes a 'steric' force from neighboring meshes to prevent mesh overlap.
|
void |
setVolumeColor(Color color)
The color the image volume is display as, when the image volume is showing.
|
void |
setWeight(double d)
Sets the magnitude of force the image causes on the mesh.
|
void |
showBinaryBlob()
Shows the volume of the currently selected mesh by adding a voxel transient object, similar to the way
show volume works, but the result is binary and colored.
|
void |
showCurvature()
TODO remove
|
void |
showForces()
Shows forces on the currently selected mesh.
|
void |
showForces(DeformableMesh3D mesh)
Creates a set of vectors to show how the mesh will deform based on the image energy and
external forces.
|
void |
showFurrowValues()
Creates a text window with the current furrow values, position in image units and normal.
|
double[] |
showInertialVector()
Shows a two vectors.
|
void |
showStress()
TODO remove
|
void |
showTexturedMeshSurface()
Adds a transient data object using a 3D volume texture and a surface with the currently
selected mesh geometry.
|
void |
showVolume()
Shows the volume data in the meshframe.
|
void |
showVolumeClippingDialog() |
void |
splitMesh() |
void |
splitMeshTrack()
Splits this track into two with all meshes from, and up to the current frame in one
track and all of the subsequent meshes in a new track.
|
void |
startNewMeshTrack(int frame,
DeformableMesh3D mesh)
Starts a new mesh track with one mesh on the specified frame.
|
void |
startNewMeshTracks(List<DeformableMesh3D> meshes)
Starts a new Track for each of provided meshes.
|
void |
stopRunning()
Primarily used to stop deforming a mesh.
|
void |
submit(SegmentationController.Executable runnable)
Method for submitting jobs to the models main loops.
|
void |
takeSnapShot()
Creates a snapshot of the current 3d view and creates an image plus window.
|
void |
toFrame(int f)
Sets the frame.
|
void |
toggleSurface()
Toggles displaying the surface of the currently selected mesh track.
|
void |
trackMesh()
Creates a copy of the current mesh, advances a frame and adds it to the current track.
|
void |
trackMesh(Track track,
int frame)
Extands the track to (frame + 1) provided by copying the deformable mesh at frame.
|
void |
trackMeshBackwards()
Copies the current mesh, moves to the previous frame and adds the copy to the currently selected track.
|
void |
undo()
Moves the action stack back.
|
void |
validateMeshes() |
public SegmentationController(SegmentationModel model)
model
- data that will be controlled.public void setGamma(double gamma)
gamma
- a number greater than 0.public void setAlpha(double d)
d
- a number greater than 0public void setPressure(double d)
d
- Non-zero values create an effective force that either causes the mesh to expand (positive) or
shrink (negative).public void setStericNeighborWeight(double d)
d
- magnitude of repulsion. 0 turns off effect.public void setWeight(double d)
d
- can be positive or negative.public void setDivisions(int d)
d
- number of times mesh is subdivided.public double getGamma()
public double getAlpha()
public double getPressure()
public double getMinConnectionLength()
public void setMinConnectionLength(double mcl)
mcl
- must be greater than 0 less than max.public double getMaxConnectionLength()
public void setMaxConnectionLength(double mcl)
mcl
- greater than zero, greater than minimum length.public void addMeshListener(FrameListener listener)
listener
- cannot be null.public void removeMeshListener(FrameListener listener)
public double getImageWeight()
public int getDivisions()
public void clearMesh(DeformableMesh3D mesh)
mesh
- mesh that will be removed from a track.clearMeshFromTrack(Track, int, DeformableMesh3D)
public void clearMeshFromTrack(Track t, int f)
t
- track that will lose a meshf
- frame the mesh will be removed from if a mesh exists.clearMeshFromTrack(Track, int, DeformableMesh3D)
public void clearMeshFromTrack(Track old, int f, DeformableMesh3D mesh)
old
- track that mesh will be removed from.f
- time frame.mesh
- mesh to be removed.public void clearSelectedMesh()
public void addUndoStateListener(StateListener listener)
listener
- public void removeUndoStateListener(StateListener listener)
public void undo()
public void redo()
public boolean canUndo()
public boolean canRedo()
public void submit(SegmentationController.Executable runnable)
runnable
- public void previousFrame()
public void nextFrame()
public void toFrame(int f)
f
- desired frame, silently fails if out of range.public void takeSnapShot()
MeshFrame3D
public void recordSnapshots(int start, int end)
start
- the first frame to be imaged, frame 1 is 0.end
- last frame, inclusive.public void centerSelectedMesh()
public void reMesh()
public void maskToDistanceTransform()
public MeshImageStack getMeshImageStack()
public void reMeshConnections(Track track, int frame, double minConnectionLength, double maxConnectionLength)
track
- track to be remeshed.frame
- the frame # of the mesh to be remeshed.minConnectionLength
- connections shorter that the minimum length will be removed.maxConnectionLength
- connections long than the maximum length will be split in two.public void setMeshes(List<Track> tracks, int frame, List<DeformableMesh3D> meshes)
tracks
- frame
- meshes
- public void setMesh(Track track, int frame, DeformableMesh3D mesh)
track
- track that will acquire the new mesh.frame
- frame the mesh will be placed at.mesh
- the mesh that will be part of the track.public void generateTrainingData(int start, int finish)
start
- 0 based time frame. First frame inclusive.finish
- 0 based time frame. Last frame inclusive.public void reMeshConnections(double minConnectionLength, double maxConnectionLength)
minConnectionLength
- normalized lengthmaxConnectionLength
- normalized lengthreMeshConnections(Track, int, double, double)
public int getNChannels()
public int getCurrentChannel()
public void plotCellCount()
public void plotTrackingStatistics()
public void plotVolumes()
public void plotDisplacements()
public void plotElongationsVsTime()
public double[] showInertialVector()
public void selectNone()
public void clearHistory()
public ij.ImagePlus guessMeshes(int level)
level
- The value used for thresholding the image. Expected to work on integer images.public void reMeshConnectionsAllMeshes(double minConnectionLength, double maxConnectionLength)
minConnectionLength
- normalized length for min connection lengths.maxConnectionLength
- normalized length for max connection lengths.reMeshConnections(Track, int, double, double)
public void curvatureSnapShot()
public SurfacePlot curvatureSurfacePlot()
public SurfacePlot intensitySurfacePlot()
public void showBinaryBlob()
public void restartMeshes()
public File getLastSavedFile()
public void addMesh(DeformableMesh3D m)
m
- addMesh(int frame, DeformableMesh3D mesh)
public void startNewMeshTrack(int frame, DeformableMesh3D mesh)
frame
- frame mesh is added to. Note 0 based indexing.mesh
- public void selectNextMeshTrack()
public void selectPreviousMeshTrack()
public void selectMeshTrack(Track track)
track
- track that will be selected. can be nullpublic void selectMesh(DeformableMesh3D mesh)
mesh
- public void addMesh(int frame, DeformableMesh3D m)
frame
- m
- public void addTracer(Track t)
t
- public void startNewMeshTracks(List<DeformableMesh3D> meshes)
meshes
- If the list is empty, this is a non-op.public FurrowTransformer createFurrowTransform(double[] pos, double[] normal)
pos
- center of the planenormal
- normal of the plane.public Image createSlice(double[] pos, double[] normal)
pos
- center of planenormal
- direction of normalpublic Image createSlice(FurrowTransformer transformer)
transformer
- public void addTransientObject(DataObject dataObject)
dataObject
- 3d display objectpublic void clearTransientObjects()
public void measureVolume()
public void calculateAllInterfaceTimeScans()
public void calculateSelectedInterfaceTimeScans()
public void calculateLineScans()
MeshAnalysis
public void showStress()
public void showCurvature()
public void showVolume()
public void setImageEnergyType(ImageEnergyType selectedItem)
selectedItem
- enum to select which image energy will be created.public void hideVolume()
public void changeVolumeClipping(int minDelta, int maxDelta)
minDelta
- maxDelta
- public void showVolumeClippingDialog()
public void deformMesh()
public void splitMeshTrack()
public void validateMeshes()
public void splitMesh()
public void deformPartialMesh()
public void showTexturedMeshSurface()
public void deformAllMeshes()
public void deformAllMeshes(int steps)
steps
- public void confineMesh(DeformableMesh3D mesh)
mesh
- public void setHardBoundaries(boolean v)
v
- confineMesh(DeformableMesh3D)
public void deformMesh(int count)
count
- number of iterations, if less than zero, it continues to deform until stopped.public DeformableMesh3D copyMesh(DeformableMesh3D mesh)
mesh
- public void trackMesh(Track track, int frame)
track
- track to be extended.frame
- initial framepublic void trackMesh()
public void trackMeshBackwards()
public void stopRunning()
public void setOriginalPlus(ij.ImagePlus plus)
plus
- new backing image.public void setOriginalPlus(ij.ImagePlus plus, int channel)
plus
- public void selectChannel(int c)
public void saveMeshes(File f)
f
- where they'll be saved.public long getCurrentState()
public void loadMeshes(File f)
f
- public void importMeshes(File f, ImportType type)
f
- type
- public void lumpImports(List<Track> imports)
imports
- public void relateImports(List<Track> imports)
imports
- public void selectImports(List<Track> imports)
imports
- list of tracks that will be modified to only have tracks with meshes in the
current frame.public void renderMeshesIn2D()
public void setMeshTracks(List<Track> replacements)
replacements
- public void exportAsStl(File f)
f
- public void exportAsWireframeStl(File f)
f
- public void load3DFurrows(File f)
f
- public void saveFurrows(File f)
f
- public List<Exception> getExecutionErrors()
public int getCurrentFrame()
public void loadImage(String file_name)
file_name
- public DeformableMesh3D getMesh()
public Track getSelectedMeshTrack()
public String getShortImageName()
public void setBeta(double d)
d
- public double getBeta()
public void setNormalizerWeight(double d)
d
- public double getNormalizeWeight()
public void createBinaryImage()
public void createLabelledImage(List<Track> tracks)
public void initializeMesh(DeformableMesh3D mesh)
mesh
- addMesh(int, DeformableMesh3D)
public List<Track> getAllTracks()
public DeformableMesh3D getSelectedMesh()
public Color getVolumeColor()
public void setVolumeColor(Color color)
color
- public double getZToYScale()
public int[] getOriginalStackDimensions()
public double[] getSurfaceOffsets()
public RingController getRingController()
public Box3D getBounds()
public void createMosaicImage()
public void measureAllVolumes()
public boolean hasOriginalPlus()
public int getNFrames()
public void toggleSurface()
public void createDataTable()
public void plotVolumeAveragedIntensityVsTime()
public void measureSelected()
public void showFurrowValues()
public void exportAsPly(File f)
f
- public String getSelectedMeshName()
public void calculateObscuringMeshes(double v)
v
- cutoff distance from the center of the triangle along the normal to another triangle. Units are
the units of the image.public boolean getMeshModified()
public int getDeformationSteps()
public void saveParameters(File f)
f
- public void loadParameters(File f)
f
- PropertySaver
public void setRigidBoundaries(boolean selected)
selected
- public String getUndoName()
public String getRedoName()
public double getStericNeighborWeight()
public void showForces()
public void createEnergyImage()
public void showForces(DeformableMesh3D mesh)
mesh
- public boolean has3DViewer()
public SegmentationModel getModel()
public void setFurrowForCurrentFrame(double[] center, double[] normal)
center
- normal
- RingController
public void setMeshFrame3D(MeshFrame3D meshFrame3D)
meshFrame3D
- public MeshFrame3D getMeshFrame3D()
public void addFrameListener(FrameListener listener)
listener
- public void linkPossibleTrack()
public void removeFrameListener(FrameListener listener)
public void autotrackAvailableTracks()
Copyright © 2013–2022 Francis Crick Institute. All rights reserved.