44 { _center = c; _radius = r; setNormal(
n); }
67 {
proj = getPlane().getClosestPoint(p);
return (
proj - _center).length() <= _radius; }
71 {
return getPlane().intersect(l,
cut); }
75 {
return Plane(_normal, _center); }
Class to handle the geometry primitive "Disc" consisting of a center, a normal and a radius.
void setCenter(const Vector3 &c)
Set center.
double getRadius() const
Get radius.
SubImageBox getBoundingBox(const MedicalImageProperties &pImg) const
Compute bounding box of disc in voxel coordinates.
void setRadius(double r)
Set radius.
void getBoundingBox(const Matrix4 &transform, Vector3 &boxMin, Vector3 &boxMax) const
Compute bounding box of disc in target coordinates; box is a homogeneous matrix specifying the transf...
void fill(const MedicalImageProperties &pImg, SubImage &destImg, double fillVal) const
Draw disc with value fillVal into subimage destImg.
const Vector3 & getCenter() const
Get center.
bool intersect(const Line &l, Vector3 &cut) const
Intersects line l with disc plane, true if cut point exists, no radius check.
bool setNormal(const Vector3 &n)
Set normal vector (performing normalization, (1,0,0) if zero).
void fill(const MedicalImageProperties &pImg, VirtualVolume &destImg, double fillVal) const
Draw disc with value fillVal into VirtualVolume destImg.
void setValue(const Vector3 &c, const Vector3 &n, double r)
Initialize disc parameters (used by constructor)
Disc()
Constructor. Default state is center at (0,0,0), normal (1,0,0) and radius 0.
bool project(const Vector3 &p, Vector3 &proj) const
Project p to disc plane, return true if projected point lies on disc.
Disc(const Vector3 &c, const Vector3 &n, double r)
Convenience constructor.
Plane getPlane() const
Get Plane object in which disc is located.
const Vector3 & getNormal() const
Get normal.
Class to define the geometry primitive "Line" consisting of a position and a direction.
This class encapsulates basic medical image properties:
Class defining a plane in 3D.
This class manages/represents a rectangular 6d image region which is organized linearly in memory.
This class manages a virtual volume organizing efficient voxel access to the output image of an input...
Target mlrange_cast(Source arg)
Generic version of checked ML casts.