Package sc.fiji.snt.analysis
Class PathProfiler
java.lang.Object
org.scijava.module.AbstractModule
org.scijava.module.DefaultMutableModule
org.scijava.command.DynamicCommand
sc.fiji.snt.gui.cmds.CommonDynamicCmd
sc.fiji.snt.analysis.PathProfiler
- All Implemented Interfaces:
Runnable,org.scijava.Cancelable,org.scijava.command.Command,org.scijava.Contextual,org.scijava.module.Module,org.scijava.module.MutableModule,org.scijava.plugin.SciJavaPlugin
Command to retrieve Path profiles (plots of voxel intensities values along a
Path)
- Author:
- Tiago Ferreira, Cameron Arshadi
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringstatic final StringKey for retrieving distances fromgetValues(Path)static final StringKey for retrieving intensities fromgetValues(Path)Fields inherited from class sc.fiji.snt.gui.cmds.CommonDynamicCmd
EMPTY_LABEL, HEADER_HTML, snt, sntService, statusService, ui, uiServiceFields inherited from class org.scijava.command.DynamicCommand
moduleService, pluginService -
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructor used by CommandService before callingrun().PathProfiler(Path path, ij.ImagePlus imp) Deprecated.PathProfiler(Path path, net.imagej.Dataset dataset) Instantiates a new Profiler from a single path.PathProfiler(Tree tree, ij.ImagePlus imp) Deprecated.PathProfiler(Tree tree, net.imagej.Dataset dataset) Instantiates a new Profiler. -
Method Summary
Modifier and TypeMethodDescriptionvoidCallsassignValues(Path)on the Paths of the profiled TreevoidassignValues(int channel) Retrieves pixel intensities at each node of the Path storing them as PathvaluesvoidassignValues(Path p) Retrieves pixel intensities at each node of the Path storing them as Pathvalues<T extends net.imglib2.type.numeric.RealType<T>>
voidassignValues(Path p, int channel) Retrieves pixel intensities at each node of the Path storing them as Pathvaluesint[]findMaxima(Path path, int channel) Finds the maxima in the profile of the specified path.int[]findMinima(Path path, int channel) Finds the minima in the profile of the specified path.ij.gui.PlotgetPlot()Gets the plot profile as an ImageJPlot(all channels).ij.gui.PlotgetPlot(int channel) Gets the plot profile as an ImageJ plot (single-channel).ij.gui.PlotGets the plot profile as an ImageJ plot (all channels included).Gets the profile for the specified path as a map of lists, with distances (or indices) stored underX_VALUES("x-values") and intensities underY_VALUES("y-values").Gets the profile for the specified path as a map of lists, with distances (or indices) stored underX_VALUES("x-values") and intensities underY_VALUES("y-values").org.scijava.plot.XYPlotGets the plot profile as anPlotServiceplot.org.scijava.plot.XYPlotgetXYPlot(int channel) Gets the plot profile as anPlotServiceplot.static voidvoidrun()voidsetMetric(ProfileProcessor.Metric metric) voidsetNodeIndicesAsDistances(boolean nodeIndices) Sets whether the profile abscissae should be reported in real-word units (the default) or node indices (zero-based).voidsetRadius(int radius) voidsetShape(ProfileProcessor.Shape shape) Methods inherited from class sc.fiji.snt.gui.cmds.CommonDynamicCmd
cancel, cancel, error, getPromptWithCloseHandler, getPromptWithCloseHandler, init, isCanceled, msg, notifyExternalDataLoaded, notifyLoadingEnd, notifyLoadingStart, resetUI, resetUI, resetUI, statusMethods inherited from class org.scijava.command.DynamicCommand
context, getCancelReason, getContext, getInfo, getInput, getOutput, saveInputs, setContext, setInput, setOutput, uncancelMethods inherited from class org.scijava.module.AbstractModule
getDelegateObject, getInputs, getOutputs, initialize, isInputResolved, isOutputResolved, preview, resolveInput, resolveOutput, setInputs, setOutputs, unresolveInput, unresolveOutputMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.scijava.module.Module
getDelegateObject, getInputs, getOutputs, initialize, isInputResolved, isOutputResolved, isResolved, preview, resolveInput, resolveOutput, setInputs, setOutputs, setResolved, unresolveInput, unresolveOutputMethods inherited from interface org.scijava.module.MutableModule
addInput, addInput, addOutput, addOutput, removeInput, removeOutput
-
Field Details
-
CIRCLE2D
- See Also:
-
CIRCLE3D
- See Also:
-
DISK2D
- See Also:
-
DISK3D
- See Also:
-
SPHERE
- See Also:
-
LINE2D
- See Also:
-
LINE3D
- See Also:
-
NONE
- See Also:
-
X_VALUES
Key for retrieving distances fromgetValues(Path)- See Also:
-
Y_VALUES
Key for retrieving intensities fromgetValues(Path)- See Also:
-
-
Constructor Details
-
PathProfiler
public PathProfiler()Empty constructor used by CommandService before callingrun(). Should not be called directly. -
PathProfiler
Deprecated. -
PathProfiler
Deprecated. -
PathProfiler
Instantiates a new Profiler.- Parameters:
tree- the Tree to be profileddataset- the dataset from which pixel intensities will be retrieved. Note that no effort is made to ensure that the image is suitable for profiling.
-
PathProfiler
Instantiates a new Profiler from a single path.- Parameters:
path- the path to be profileddataset- the dataset from which pixel intensities will be retrieved.Note that no effort is made to ensure that the image is suitable for profiling
-
-
Method Details
-
setShape
- Parameters:
shape- EitherProfileProcessor.Shape
-
setMetric
-
setRadius
public void setRadius(int radius) -
run
public void run()- Specified by:
runin interfaceorg.scijava.module.MutableModule- Specified by:
runin interfaceRunnable- Overrides:
runin classCommonDynamicCmd
-
assignValues
CallsassignValues(Path)on the Paths of the profiled Tree- Throws:
IllegalArgumentException
-
assignValues
public void assignValues(int channel) throws IllegalArgumentException, ArrayIndexOutOfBoundsException Retrieves pixel intensities at each node of the Path storing them as Pathvalues- Parameters:
channel- the channel to be parsed (base-0 index)- Throws:
IllegalArgumentException- if image does not contain the path's channelArrayIndexOutOfBoundsException
-
assignValues
Retrieves pixel intensities at each node of the Path storing them as Pathvalues- Parameters:
p- the Path to be profiled- Throws:
IllegalArgumentException- if image does not contain the path's channel- See Also:
-
assignValues
public <T extends net.imglib2.type.numeric.RealType<T>> void assignValues(Path p, int channel) throws ArrayIndexOutOfBoundsException Retrieves pixel intensities at each node of the Path storing them as Pathvalues- Parameters:
p- the Path to be profiledchannel- the channel to be parsed (base-0 index)- Throws:
IllegalArgumentException- if image does not contain the path's channelArrayIndexOutOfBoundsException- See Also:
-
findMaxima
Finds the maxima in the profile of the specified path.A maxima (peak) will only be considered if protruding more than the profile's standard deviation from the ridge to a higher maximum
- Parameters:
channel- the channel to be parsed (base-0 index)- Returns:
- the indices of the maxima
-
findMinima
Finds the minima in the profile of the specified path.A maxima (peak) will only be considered if protruding less than the profile's standard deviation from the ridge to a lower minimum
- Parameters:
channel- the channel to be parsed (base-0 index)- Returns:
- the indices of the minima
-
setNodeIndicesAsDistances
public void setNodeIndicesAsDistances(boolean nodeIndices) Sets whether the profile abscissae should be reported in real-word units (the default) or node indices (zero-based). Must be called before callinggetValues(Path),getPlot()orgetXYPlot().- Parameters:
nodeIndices- If true, distances will be reported as indices.
-
getValues
Gets the profile for the specified path as a map of lists, with distances (or indices) stored underX_VALUES("x-values") and intensities underY_VALUES("y-values").- Parameters:
p- the path to be profiled- Returns:
- the profile
-
getValues
Gets the profile for the specified path as a map of lists, with distances (or indices) stored underX_VALUES("x-values") and intensities underY_VALUES("y-values").- Parameters:
p- the path to be profiledchannel- the channel to be parsed (base-0 index)- Returns:
- the profile map
-
getPlot
Gets the plot profile as an ImageJPlot(all channels).- Returns:
- the plot
- Throws:
IllegalArgumentExceptionArrayIndexOutOfBoundsException
-
getPlot
public ij.gui.Plot getPlot(int channel) throws IllegalArgumentException, ArrayIndexOutOfBoundsException Gets the plot profile as an ImageJ plot (single-channel).- Parameters:
channel- the channel to be parsed (base-0 index)- Returns:
- the plot
- Throws:
IllegalArgumentExceptionArrayIndexOutOfBoundsException
-
getPlot
Gets the plot profile as an ImageJ plot (all channels included).- Returns:
- the plot
-
getXYPlot
public org.scijava.plot.XYPlot getXYPlot()Gets the plot profile as anPlotServiceplot. It is recommended to callDynamicCommand.setContext(org.scijava.Context)beforehand.- Returns:
- the plot
-
getXYPlot
Gets the plot profile as anPlotServiceplot. It is recommended to callDynamicCommand.setContext(org.scijava.Context)beforehand.- Parameters:
channel- the channel to be parsed (base-0 index)- Returns:
- the plot
- Throws:
IllegalArgumentException
-
main
-
PathProfiler(Path, Dataset)