Package sc.fiji.snt.util
Class PointInImage
java.lang.Object
sc.fiji.snt.util.PointInImage
- Direct Known Subclasses:
Path.PathNode,PointInCanvas,ShollPoint,SWCPoint
Defines a Point in an image, a node of a traced
Path. Coordinates are
always expressed in real-world coordinates.- Author:
- Tiago Ferreira
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe Path associated with this node, if any (optional field)doubleThe radius of reconstructed structure at this nodedoubleA property associated with this point (e.g., voxel intensity) (optional field)doubleThe cartesian coordinate of this nodedoubleThe cartesian coordinate of this nodedoubleThe cartesian coordinate of this node -
Constructor Summary
ConstructorsModifierConstructorDescriptionPointInImage(double x, double y, double z) protectedPointInImage(double x, double y, double z, Path onPath) -
Method Summary
Modifier and TypeMethodDescriptiondoublechebyshevDxTo(PointInImage point) doublechebyshevXYdxTo(PointInImage point) doublechebyshevZdxTo(PointInImage point) clone()Creates a copy of this PointInImage.doubledistanceSquaredTo(double ox, double oy, double oz) doubledoublebooleandoubleeuclideanDxTo(PointInImage point) doublegetCoordinateOnAxis(int axis) Gets the coordinate along the specified axis.chargetPath()Returns the Path associated with this node (if any)Converts the coordinates of this point into pixel units if this point is associated with a Path.getUnscaledPoint(int view) Converts the coordinates of this point into pixel units if this point is associated with a Path.doublegetX()doublegetY()doublegetZ()inthashCode()booleanisReal()booleanvoidscale(double xScale, double yScale, double zScale) Scales this point coordinates.voidsetAnnotation(BrainAnnotation annotation) Assigns a neuropil annotation (e.g., atlas compartment) to this point.voidsetHemisphere(char lr) voidAssociates a Path with this nodetoString()transform(PathTransformer transformer)
-
Field Details
-
x
public double xThe cartesian coordinate of this node -
y
public double yThe cartesian coordinate of this node -
z
public double zThe cartesian coordinate of this node -
radius
public double radiusThe radius of reconstructed structure at this node -
v
public double vA property associated with this point (e.g., voxel intensity) (optional field) -
onPath
The Path associated with this node, if any (optional field)
-
-
Constructor Details
-
PointInImage
public PointInImage() -
PointInImage
public PointInImage(double x, double y, double z) -
PointInImage
-
-
Method Details
-
distanceSquaredTo
public double distanceSquaredTo(double ox, double oy, double oz) -
distanceSquaredTo
-
distanceTo
-
euclideanDxTo
-
chebyshevXYdxTo
-
chebyshevZdxTo
-
chebyshevDxTo
-
toString
-
transform
-
isReal
public boolean isReal() -
isSameLocation
-
scale
public void scale(double xScale, double yScale, double zScale) Scales this point coordinates.- Parameters:
xScale- the scaling factor for x coordinatesyScale- the scaling factor for y coordinateszScale- the scaling factor for z coordinates
-
getUnscaledPoint
Converts the coordinates of this point into pixel units if this point is associated with a Path.- Returns:
- this point in pixel coordinates
- Throws:
IllegalArgumentException- if this point is not associated with a Path
-
getUnscaledPoint
Converts the coordinates of this point into pixel units if this point is associated with a Path.- Parameters:
view-MultiDThreePanes.XY_PLANE,MultiDThreePanes.ZY_PLANE, etc.- Returns:
- this point in pixel coordinates
- Throws:
IllegalArgumentException- if this point is not associated with a Path, or view was not recognized
-
getPath
Returns the Path associated with this node (if any)- Returns:
- the path associated with this node or null if
setPath(Path)has not been called.
-
setPath
Associates a Path with this node- Parameters:
onPath- the Path to be associated with this node
-
clone
Creates a copy of this PointInImage.This method creates a copy of the point including all properties such as coordinates, value, annotation, and hemisphere information.
-
equals
-
hashCode
public int hashCode() -
getX
public double getX() -
getY
public double getY() -
getZ
public double getZ() -
getCoordinateOnAxis
public double getCoordinateOnAxis(int axis) Gets the coordinate along the specified axis.- Specified by:
getCoordinateOnAxisin interfaceSNTPoint- Parameters:
axis- the axis. EitherTree.X_AXIS,Tree.Y_AXIS, orTree.Z_AXIS- Returns:
- the coordinate on the specified axis
-
setAnnotation
Description copied from interface:SNTPointAssigns a neuropil annotation (e.g., atlas compartment) to this point.- Specified by:
setAnnotationin interfaceSNTPoint- Parameters:
annotation- the annotation to be assigned to this point
-
getAnnotation
- Specified by:
getAnnotationin interfaceSNTPoint- Returns:
- the neuropil annotation assigned to this point
-
setHemisphere
public void setHemisphere(char lr) - Specified by:
setHemispherein interfaceSNTPoint
-
getHemisphere
public char getHemisphere()- Specified by:
getHemispherein interfaceSNTPoint
-