Class TreeParser
- All Implemented Interfaces:
Parser,ProfileProperties
- Author:
- Tiago Ferreira
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intFlag for defining the profile center as the average position of root nodes of all primary Paths.static final intFlag for defining the profile center as the average position of root nodes of Paths tagged as Apical Dendrite.static final intFlag for defining the profile center as the average position of root nodes of Paths tagged as Axon.static final intFlag for defining the profile center as the average position of root nodes of Paths tagged as Custom.static final intFlag for defining the profile center as the average position of root nodes of Paths tagged as (Basal) Dendritestatic final intFlag for defining the profile center as the average position of root nodes of primary Paths tagged as Somastatic final intFlag for defining the profile center as the average position of root nodes of _ANY_ Paths tagged as Soma, independently of connectivitystatic final intFlag for defining the profile center as the average position of root nodes of Paths tagged as UndefinedFields inherited from interface sc.fiji.snt.analysis.sholl.ProfileProperties
HEMI_EAST, HEMI_NONE, HEMI_NORTH, HEMI_SOUTH, HEMI_WEST, INTG_MEAN, INTG_MEDIAN, INTG_MODE, KEY_2D3D, KEY_CALIBRATION, KEY_CENTER, KEY_CHANNEL_POS, KEY_EFFECTIVE_STEP_SIZE, KEY_EXTRA_MEASUREMENT, KEY_FRAME_POS, KEY_HEMISHELLS, KEY_ID, KEY_NSAMPLES, KEY_NSAMPLES_INTG, KEY_SLICE_POS, KEY_SOURCE, KEY_THRESHOLD_RANGE, SRC_IMG, SRC_TABLE, SRC_TRACES, UNSET -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the center coordinatesij.ImagePlusgetLabelsImage(ij.ImagePlus templateImg, net.imglib2.display.ColorTable cTable) Gets the labels image.Gets the Sholl profile generated by the parsing operation.getTree()Returns the tree associated with this parserbooleanstatic voidvoidparse()Performs the parsing operation to extract the Sholl profile.voidsetCenter(double[] coordinates) Sets the center of the profile.voidsetCenter(int choice) Computes the center of the Profile.voidsetCenter(PointInImage center) Sets the center of the profile.voidsetIntersectedVolumeAsExtraMeasurement(boolean b) Enables storing the intersected arbor volume as a per-shell extra measurement in the resultingProfile.voidsetSkipSomaticSegments(boolean skipSomaticSegments) If primary paths start far-away from the soma (expected to be defined by a single-point (soma centroid)), should segments between the soma and neurite be ignored.voidsetStepSize(double stepSize) Sets the radius step size.booleanChecks if the parsing operation was successful.voidTerminates the parsing operation.
-
Field Details
-
ROOT_NODES_ANY
public static final int ROOT_NODES_ANYFlag for defining the profile center as the average position of root nodes of all primary Paths.- See Also:
-
ROOT_NODES_APICAL_DENDRITE
public static final int ROOT_NODES_APICAL_DENDRITEFlag for defining the profile center as the average position of root nodes of Paths tagged as Apical Dendrite.- See Also:
-
ROOT_NODES_AXON
public static final int ROOT_NODES_AXONFlag for defining the profile center as the average position of root nodes of Paths tagged as Axon.- See Also:
-
ROOT_NODES_CUSTOM
public static final int ROOT_NODES_CUSTOMFlag for defining the profile center as the average position of root nodes of Paths tagged as Custom.- See Also:
-
ROOT_NODES_DENDRITE
public static final int ROOT_NODES_DENDRITEFlag for defining the profile center as the average position of root nodes of Paths tagged as (Basal) Dendrite- See Also:
-
ROOT_NODES_SOMA
public static final int ROOT_NODES_SOMAFlag for defining the profile center as the average position of root nodes of primary Paths tagged as Soma- See Also:
-
ROOT_NODES_SOMA_ANY
public static final int ROOT_NODES_SOMA_ANYFlag for defining the profile center as the average position of root nodes of _ANY_ Paths tagged as Soma, independently of connectivity- See Also:
-
ROOT_NODES_UNDEFINED
public static final int ROOT_NODES_UNDEFINEDFlag for defining the profile center as the average position of root nodes of Paths tagged as Undefined- See Also:
-
-
Constructor Details
-
TreeParser
Instantiates a new Tree Parser.- Parameters:
tree- the Tree to be profiled
-
-
Method Details
-
setCenter
Computes the center of the Profile.- Parameters:
choice- the flag specifying the center (e.g.,ROOT_NODES_SOMA,ROOT_NODES_ANY, etc.)- Throws:
IllegalArgumentException- if choice is not a recognized flag or if no Paths in the Tree match the choice criteria
-
getCenter
Returns the center coordinates- Returns:
- the point defining the center, or null if it has not yet been set.
-
setCenter
Sets the center of the profile.- Parameters:
center- the focal point of the profile
-
setCenter
public void setCenter(double[] coordinates) Sets the center of the profile.- Parameters:
coordinates- the array holding the focal point coordinates of the profile
-
setIntersectedVolumeAsExtraMeasurement
public void setIntersectedVolumeAsExtraMeasurement(boolean b) Enables storing the intersected arbor volume as a per-shell extra measurement in the resultingProfile.When enabled, each
ProfileEntrywill include the volume of cable lying inside the current sampling shell, expressed in calibrated units cubed (e.g., µm³). The value is computed by clipping each traced segment to the shell and summing the volumes of the resulting truncated-cone (frustum) pieces. If only one endpoint radius is available, that radius is used for both ends; if neither endpoint has a radius, the piece contributes no volume.Shells are defined by the parser’s sampling mode: for discontinuous sampling (step size > 0), shells have thickness equal to
stepSize; for continuous sampling (step size = 0), a thin shell is used whose thickness falls back to the median internode distance of the Tree.Important: This method must be called before
parse().- Parameters:
b- whether to store the intersected volume as an extra measurement
-
setStepSize
public void setStepSize(double stepSize) Sets the radius step size.- Parameters:
stepSize- the radius step size
-
parse
Description copied from interface:ParserPerforms the parsing operation to extract the Sholl profile.This method analyzes the data source and computes intersection counts at various radial distances from the center point. The resulting profile can be retrieved using
Parser.getProfile().Implementations should handle any necessary preprocessing, validation, and error handling during the parsing process.
- Specified by:
parsein interfaceParser- Throws:
IllegalArgumentException
-
successful
public boolean successful()Description copied from interface:ParserChecks if the parsing operation was successful.This method should be called after
Parser.parse()to determine if the parsing completed without errors and produced a valid profile.- Specified by:
successfulin interfaceParser- Returns:
- true if parsing was successful, false otherwise
-
terminate
public void terminate()Description copied from interface:ParserTerminates the parsing operation.This method should be called to clean up resources and stop any ongoing parsing operations. It may be used to interrupt long-running analyses or to ensure proper cleanup when the parser is no longer needed.
-
getProfile
Description copied from interface:ParserGets the Sholl profile generated by the parsing operation.This method returns the profile containing intersection counts at various radial distances. The profile should only be retrieved after calling
Parser.parse()and verifying success withParser.successful().- Specified by:
getProfilein interfaceParser- Returns:
- the Sholl profile, or null if parsing has not been performed or was unsuccessful
-
getLabelsImage
public ij.ImagePlus getLabelsImage(ij.ImagePlus templateImg, net.imglib2.display.ColorTable cTable) Gets the labels image.- Parameters:
templateImg- the template imgcTable- the c table- Returns:
- the labels image
-
main
-
getTree
Returns the tree associated with this parser- Returns:
- the profiled tree
-
isSkipSomaticSegments
public boolean isSkipSomaticSegments()- See Also:
-
setSkipSomaticSegments
public void setSkipSomaticSegments(boolean skipSomaticSegments) If primary paths start far-away from the soma (expected to be defined by a single-point (soma centroid)), should segments between the soma and neurite be ignored. Useful when soma is large relatively to the length of arbor, as in microglia cells. See e.g., this forum thread.- Parameters:
skipSomaticSegments- the skipFirsNode to set
-