public class SNT extends MultiDThreePanes implements SearchProgressCallback, features.GaussianGenerationCallback
XY_PLANE, XZ_PLANE, ZY_PLANE| Constructor and Description |
|---|
SNT(org.scijava.Context context,
ij.ImagePlus sourceImage)
Instantiates SNT in 'Tracing Mode'.
|
SNT(org.scijava.Context context,
PathAndFillManager pathAndFillManager)
Instantiates SNT in 'Analysis Mode'
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accessToValidImageData() |
void |
addListener(SNTListener listener) |
Path |
autoTrace(java.util.List<PointInImage> pointList,
PointInImage forkPoint)
Automatically traces a path from a list of points and adds it to the active
PathAndFillManager instance. |
Path |
autoTrace(PointInImage start,
PointInImage end,
PointInImage forkPoint)
Automatically traces a path from a point A to a point B.
|
void |
cancelPath()
Cancels the temporary path.
|
void |
cancelSearch(boolean cancelFillToo) |
void |
cancelTemporary() |
void |
changeUIState(int newState) |
void |
closeAndResetAllPanes() |
void |
confirmTemporary() |
sc.fiji.snt.InteractiveTracerCanvas |
createCanvas(ij.ImagePlus imagePlus,
int plane) |
void |
discardFill() |
boolean |
editModeAllowed()
Assesses if activation of 'Edit Mode' is possible.
|
void |
enableAstar(boolean enable)
Toggles the A* search algorithm (enabled by default)
|
void |
enableAutoActivation(boolean enable) |
void |
enableHessian(boolean enable) |
void |
enableSnapCursor(boolean enable)
Enables SNT's XYZ snap cursor feature.
|
void |
finished(SearchInterface source,
boolean success) |
org.scijava.Context |
getContext() |
Path |
getCurrentPath() |
boolean |
getDrawDiametersXY() |
ij.ImagePlus |
getFilledVolume(boolean asMask) |
HessianCaller |
getHessianCaller(java.lang.String image) |
double |
getHessianSigma(java.lang.String image,
boolean physicalUnits) |
ij.ImagePlus |
getImagePlus() |
ij.ImagePlus |
getImagePlus(int pane)
Gets the Image associated with a view pane.
|
ij.ImagePlus |
getLoadedDataAsImp()
Retrieves the pixel data of the main image currently loaded in memory as an
ImagePlus object.
|
double |
getMinimumSeparation() |
PathAndFillManager |
getPathAndFillManager() |
SNTPrefs |
getPrefs() |
ij.ImagePlus |
getSecondaryDataAsImp()
Retrieves the 'secondary image' data currently loaded in memory as an
ImagePlus object.
|
float[] |
getSecondaryImageMinMax() |
java.util.Collection<Path> |
getSelectedPaths() |
SNTUI |
getUI()
Gets the main UI.
|
void |
initialize(boolean singlePane,
int channel,
int frame)
Initializes the plugin by assembling all the required tracing views
|
void |
initialize(ij.ImagePlus imp) |
boolean |
is2D() |
boolean |
isAstarEnabled()
Checks if A* search is enabled
|
boolean |
isHessianEnabled(java.lang.String image)
Checks if Hessian analysis is enabled
|
boolean |
isOnlySelectedPathsVisible() |
boolean |
isSecondaryImageLoaded()
Assesses if the 'secondary image' has been loaded into memory.
|
boolean |
isTubenessImageCached(java.lang.String image) |
void |
justDisplayNearSlices(boolean value,
int eitherSide) |
void |
loadLabelsFile(java.lang.String path) |
void |
loadSecondaryImage(java.io.File file)
Loads the 'secondary image' specified by
setSecondaryImage(File) into
memory as 32-bit data. |
void |
loadSecondaryImage(ij.ImagePlus imp) |
void |
loadTracings(java.io.File file) |
void |
loadTubenessImage(java.lang.String type,
java.io.File file) |
void |
loadTubenessImage(java.lang.String type,
ij.ImagePlus imp) |
ij.ImagePlus |
makePathVolume() |
ij.ImagePlus |
makePathVolume(java.util.Collection<Path> paths) |
void |
mouseMovedTo(double x_in_pane,
double y_in_pane,
int in_plane,
boolean sync_panes_modifier_down,
boolean join_modifier_down) |
void |
notifyListeners(SNTEvent event) |
void |
pauseOrRestartFilling() |
void |
pointsInSearch(SearchInterface source,
int inOpen,
int inClosed) |
void |
proportionDone(double proportion) |
void |
rebuildDisplayCanvases()
Rebuilds display canvases, i.e., the placeholder canvases used when no
valid image data exists (a single-canvas is rebuilt if only the XY view is
active).
|
void |
rebuildZYXZpanes() |
void |
reloadImage(int channel,
int frame) |
void |
saveFill() |
void |
selectPath(Path p,
boolean addToExistingSelection) |
void |
setCurrentPath(Path path) |
void |
setDrawDiametersXY(boolean draw) |
void |
setFillList(java.lang.String[] newList) |
void |
setFillThreshold(double distance) |
void |
setFillThresholdFrom(double world_x,
double world_y,
double world_z) |
void |
setPathList(java.lang.String[] newList,
Path justAdded,
boolean expandAll) |
void |
setSecondaryImage(java.io.File file)
Specifies the 'secondary image' to be used during a tracing session.
|
void |
setSecondaryImageMinMax(float min,
float max) |
void |
setSelectedPaths(java.util.HashSet<Path> selectedPathsSet,
java.lang.Object source) |
void |
setShowOnlySelectedPaths(boolean showOnlySelectedPaths) |
void |
setTemporaryPath(Path path) |
void |
showCorrespondencesTo(java.io.File tracesFile,
java.awt.Color c,
double maxDistance)
Deprecated.
|
void |
showMIPOverlays(double opacity)
Overlays a semi-transparent MIP (8-bit scaled) of the data being traced
over the tracing canvas(es).
|
void |
showStatus(int progress,
int maximum,
java.lang.String status) |
void |
startFillerThread(FillerThread filler) |
void |
startFillingPaths(java.util.Set<Path> fromPaths) |
void |
startHessian(java.lang.String image,
double sigma,
double max,
boolean wait) |
void |
startUI() |
void |
threadStatus(SearchInterface source,
int status) |
void |
updateAllViewers() |
void |
updateDisplayCanvases()
Rebuilds display canvas(es) to ensure all paths are contained in the image.
|
disableEventsAllPanes, disableZoomAllPanes, findPointInStack, findPointInStackPrecise, getSinglePane, getZYXZ, imageTypeToString, initialize, isZoomAllPanesDisabled, main, mouseMovedTo, reloadZYXZpanes, removeMIPOverlayAllPanes, repaintAllPanes, setAnnotationsColorAllPanes, setCanvasLabelAllPanes, setCursorTextAllPanes, setDrawCrosshairsAllPanes, setSinglePane, setZPositionAllPanes, unzoomAllPanes, zoom100PercentAllPanes, zoomEventOccurredpublic SNT(org.scijava.Context context,
ij.ImagePlus sourceImage)
throws java.lang.IllegalArgumentException
context - the SciJava application context providing the services
required by the classsourceImage - the source imagejava.lang.IllegalArgumentException - If sourceImage is of type 'RGB'public SNT(org.scijava.Context context,
PathAndFillManager pathAndFillManager)
context - the SciJava application context providing the services
required by the classpathAndFillManager - The PathAndFillManager instance to be associated
with the pluginpublic void rebuildDisplayCanvases()
throws java.lang.IllegalArgumentException
Useful when multiple files are imported and imported paths 'fall off' the dimensions of current canvas(es). If there is not enough memory to accommodate enlarged dimensions, the resulting canvas will be a 2D image.
java.lang.IllegalArgumentException - if valid image data existspublic void updateDisplayCanvases()
rebuildDisplayCanvases()public boolean accessToValidImageData()
public void initialize(ij.ImagePlus imp)
initialize in class MultiDThreePanespublic void initialize(boolean singlePane,
int channel,
int frame)
singlePane - if true only the XY view will be generated, if false XY,
ZY, XZ views are createdchannel - the channel to be traced. Ignored when no valid image data
exists.frame - the frame to be traced. Ignored when no valid image data
exists.public void reloadImage(int channel,
int frame)
public void rebuildZYXZpanes()
public void startUI()
public void loadTracings(java.io.File file)
public PathAndFillManager getPathAndFillManager()
public ij.ImagePlus getImagePlus()
public sc.fiji.snt.InteractiveTracerCanvas createCanvas(ij.ImagePlus imagePlus,
int plane)
createCanvas in class MultiDThreePanespublic void cancelSearch(boolean cancelFillToo)
public void threadStatus(SearchInterface source, int status)
threadStatus in interface SearchProgressCallbackpublic void changeUIState(int newState)
public void saveFill()
public void discardFill()
public void pauseOrRestartFilling()
public void addListener(SNTListener listener)
public void notifyListeners(SNTEvent event)
public void finished(SearchInterface source, boolean success)
finished in interface SearchProgressCallbackpublic void pointsInSearch(SearchInterface source, int inOpen, int inClosed)
pointsInSearch in interface SearchProgressCallbackpublic void justDisplayNearSlices(boolean value,
int eitherSide)
public boolean editModeAllowed()
public void loadLabelsFile(java.lang.String path)
public void mouseMovedTo(double x_in_pane,
double y_in_pane,
int in_plane,
boolean sync_panes_modifier_down,
boolean join_modifier_down)
public void setTemporaryPath(Path path)
public void setCurrentPath(Path path)
public Path getCurrentPath()
public ij.ImagePlus makePathVolume(java.util.Collection<Path> paths)
public ij.ImagePlus makePathVolume()
public void confirmTemporary()
public void cancelTemporary()
public void cancelPath()
public Path autoTrace(PointInImage start, PointInImage end, PointInImage forkPoint)
autoTrace(List, PointInImage) for details.start - the PointInImage the starting point of the pathend - the PointInImage the terminal point of the pathforkPoint - the PointInImage fork point of the parent
Path from which the searched path should branch off, or
null if the the path should not have any parent.autoTrace(List, PointInImage)public Path autoTrace(java.util.List<PointInImage> pointList, PointInImage forkPoint)
PathAndFillManager instance. Note that this method still requires
SNT's UI. For headless auto-tracing have a look at TracerThread.
SNT's UI will remain blocked in "search mode" until the Path computation
completes. Tracing occurs through the active SearchInterface
selected in the UI, i.e., TracerThread (the default A* search),
TubularGeodesicsTracer, etc.
All input PointInImage must be specified in real world coordinates.
pointList - the list of PointInImage containing the nodes to
be used as target goals during the search. If the search cannot
converge into a target point, such point is omitted from path, if
Successful, target point will be included in the final path. the
final path. The first point in the list is the start of the path,
the last its terminus. Null objects not allowed.forkPoint - the PointInImage fork point of the parent
Path from which the searched path should branch off, or
null if the the path should not have any parent.public void setFillThresholdFrom(double world_x,
double world_y,
double world_z)
public void setFillThreshold(double distance)
public ij.ImagePlus getFilledVolume(boolean asMask)
public void startFillerThread(FillerThread filler)
public void startFillingPaths(java.util.Set<Path> fromPaths)
public double getMinimumSeparation()
public ij.ImagePlus getLoadedDataAsImp()
public void startHessian(java.lang.String image,
double sigma,
double max,
boolean wait)
public boolean isSecondaryImageLoaded()
public void setSecondaryImage(java.io.File file)
file - The file containing the 'secondary image'public void loadSecondaryImage(java.io.File file)
throws java.io.IOException,
java.lang.IllegalArgumentException
setSecondaryImage(File) into
memory as 32-bit data.file - The file to be loadedjava.io.IOException - If image could not be loadedjava.lang.IllegalArgumentException - if dimensions are unexpected, or image type
is not supportedisSecondaryImageLoaded(),
getSecondaryDataAsImp()public void loadSecondaryImage(ij.ImagePlus imp)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic void setSecondaryImageMinMax(float min,
float max)
public float[] getSecondaryImageMinMax()
public void loadTubenessImage(java.lang.String type,
java.io.File file)
throws java.io.IOException,
java.lang.IllegalArgumentException
java.io.IOExceptionjava.lang.IllegalArgumentExceptionpublic void loadTubenessImage(java.lang.String type,
ij.ImagePlus imp)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic ij.ImagePlus getSecondaryDataAsImp()
isSecondaryImageLoaded(),
loadSecondaryImage(ImagePlus),
loadSecondaryImage(File)public void enableHessian(boolean enable)
public SNTPrefs getPrefs()
public void proportionDone(double proportion)
proportionDone in interface features.GaussianGenerationCallback@Deprecated
public void showCorrespondencesTo(java.io.File tracesFile,
java.awt.Color c,
double maxDistance)
public void setShowOnlySelectedPaths(boolean showOnlySelectedPaths)
public ij.ImagePlus getImagePlus(int pane)
pane - the flag specifying the view either
MultiDThreePanes.XY_PLANE,
MultiDThreePanes.XZ_PLANE or
MultiDThreePanes.ZY_PLANE.public boolean isOnlySelectedPathsVisible()
public void updateAllViewers()
public void selectPath(Path p, boolean addToExistingSelection)
public java.util.Collection<Path> getSelectedPaths()
public void setPathList(java.lang.String[] newList,
Path justAdded,
boolean expandAll)
public void setFillList(java.lang.String[] newList)
public void setSelectedPaths(java.util.HashSet<Path> selectedPathsSet, java.lang.Object source)
public void showMIPOverlays(double opacity)
opacity - (alpha), in the range 0.0-1.0, where 0.0 is none (fully
transparent) and 1.0 is fully opaque. Setting opacity to zero
clears previous MIPs.public void enableSnapCursor(boolean enable)
enable - whether cursor snapping should be enabledpublic void enableAutoActivation(boolean enable)
public void enableAstar(boolean enable)
enable - true to enable A* search, false otherwisepublic boolean isAstarEnabled()
public boolean isHessianEnabled(java.lang.String image)
public double getHessianSigma(java.lang.String image,
boolean physicalUnits)
public boolean isTubenessImageCached(java.lang.String image)
public boolean is2D()
public void setDrawDiametersXY(boolean draw)
public boolean getDrawDiametersXY()
public void closeAndResetAllPanes()
closeAndResetAllPanes in class MultiDThreePanespublic org.scijava.Context getContext()
public SNTUI getUI()
public void showStatus(int progress,
int maximum,
java.lang.String status)
showStatus in interface PaneOwnershowStatus in class MultiDThreePanespublic HessianCaller getHessianCaller(java.lang.String image)