STIR
6.2.0
|
Three-dimensional ellipsoidal cylinder. More...
#include "stir/Shape/EllipsoidalCylinder.h"
Public Member Functions | |
EllipsoidalCylinder () | |
Default constructor (calls set_defaults()) | |
EllipsoidalCylinder (const float length_z, const float radius_y, const float radius_x, const CartesianCoordinate3D< float > ¢re, const Array< 2, float > &direction_vectors=diagonal_matrix(3, 1.F)) | |
Constructor. More... | |
EllipsoidalCylinder (const float length_z, const float radius_y, const float radius_x, const float theta_1, const float theta_2, const CartesianCoordinate3D< float > ¢re, const Array< 2, float > &direction_vectors=diagonal_matrix(3, 1.F)) | |
Constructor. More... | |
Shape3D * | clone () const override |
Allocate a new Shape3D object which is a copy of the current one. | |
bool | operator== (const EllipsoidalCylinder &cylinder) const |
Compare cylinders. More... | |
bool | operator== (const Shape3D &shape) const override |
Compare shapes. More... | |
float | get_geometric_volume () const override |
get volume | |
bool | is_inside_shape (const CartesianCoordinate3D< float > &coord) const override |
determine if a point is inside the shape or not (up to floating point errors) More... | |
float | get_length () const |
float | get_radius_x () const |
float | get_radius_y () const |
void | set_length (const float) |
void | set_radius_x (const float) |
void | set_radius_y (const float) |
Public Member Functions inherited from stir::RegisteredParsingObject< EllipsoidalCylinder, Shape3D, Shape3DWithOrientation > | |
std::string | get_registered_name () const override |
Returns Derived::registered_name. | |
std::string | parameter_info () override |
Returns a string with all parameters and their values, in a form suitable for parsing again. | |
Public Member Functions inherited from stir::Shape3DWithOrientation | |
bool | operator== (const Shape3DWithOrientation &s) const |
void | scale (const CartesianCoordinate3D< float > &scale3D) override |
scale the whole shape More... | |
const Array< 2, float > & | get_direction_vectors () const |
get direction vectors currently in use More... | |
Succeeded | set_direction_vectors (const Array< 2, float > &) |
set direction vectors More... | |
Public Member Functions inherited from stir::Shape3D | |
bool | operator!= (const Shape3D &) const |
Compare shapes. | |
virtual float | get_voxel_weight (const CartesianCoordinate3D< float > &voxel_centre, const CartesianCoordinate3D< float > &voxel_size, const CartesianCoordinate3D< int > &num_samples) const |
Determine (approximately) the intersection volume of a voxel with the shape. More... | |
virtual void | translate (const CartesianCoordinate3D< float > &direction) |
translate the whole shape by shifting its origin More... | |
void | scale_around_origin (const CartesianCoordinate3D< float > &scale3D) |
scale the whole shape, keeping the centre at the same place | |
virtual void | construct_volume (VoxelsOnCartesianGrid< float > &image, const CartesianCoordinate3D< int > &num_samples) const |
construct an image representation the shape in a discretised manner More... | |
CartesianCoordinate3D< float > | get_origin () const |
get the origin of the shape-coordinate system | |
virtual void | set_origin (const CartesianCoordinate3D< float > &) |
set the origin of the shape-coordinate system | |
Public Member Functions inherited from stir::ParsingObject | |
ParsingObject (const ParsingObject &) | |
ParsingObject & | operator= (const ParsingObject &) |
void | ask_parameters () |
bool | parse (std::istream &f) |
bool | parse (const char *const filename) |
Static Public Attributes | |
static const char *const | registered_name = "Ellipsoidal Cylinder" |
Name which will be used when parsing a Shape3D object. | |
Protected Member Functions | |
void | set_defaults () override |
set defaults before parsing More... | |
void | initialise_keymap () override |
Initialise all keywords. | |
bool | post_processing () override |
This will be called at the end of the parsing. More... | |
Protected Member Functions inherited from stir::Shape3DWithOrientation | |
Shape3DWithOrientation () | |
default constructor (NO initialisation of values) | |
Shape3DWithOrientation (const CartesianCoordinate3D< float > &origin, const Array< 2, float > &directions=diagonal_matrix(3, 1.F)) | |
float | get_volume_of_unit_cell () const |
gets the volume of the cell spanned by the direction vectors More... | |
CartesianCoordinate3D< float > | transform_to_shape_coords (const CartesianCoordinate3D< float > &) const |
Transform a 'real-world' coordinate to the coordinate system used by the shape. | |
void | set_defaults () override |
sets defaults for parsing More... | |
void | initialise_keymap () override |
Initialise all keywords. | |
bool | post_processing () override |
This will be called at the end of the parsing. More... | |
void | set_key_values () override |
This will be called before parsing or parameter_info is called. More... | |
Protected Member Functions inherited from stir::Shape3D | |
Shape3D (const CartesianCoordinate3D< float > &origin) | |
Protected Attributes | |
float | length |
Length of the cylinder. | |
float | radius_x |
Radius in x-direction if the shape is not rotated. | |
float | radius_y |
Radius in y-direction if the shape is not rotated. | |
float | theta_1 |
initial theta if the shape is not rotated (in degrees) | |
float | theta_2 |
final theta if the shape is not rotated (in degrees) | |
Protected Attributes inherited from stir::ParsingObject | |
KeyParser | parser |
Additional Inherited Members | |
Static Public Member Functions inherited from stir::RegisteredParsingObject< EllipsoidalCylinder, Shape3D, Shape3DWithOrientation > | |
static Shape3D * | read_from_stream (std::istream *) |
Construct a new object (of type Derived) by parsing the istream. More... | |
Static Public Member Functions inherited from stir::RegisteredObject< Shape3D > | |
static Shape3D * | read_registered_object (std::istream *in, const std::string ®istered_name) |
Construct a new object (of a type derived from Root, its actual type determined by the registered_name parameter) by parsing the istream. More... | |
static Shape3D * | ask_type_and_parameters () |
ask the user for the type, and then calls read_registered_object(0, type) More... | |
static void | list_registered_names (std::ostream &stream) |
List all possible registered names to the stream. More... | |
Protected Types inherited from stir::RegisteredObject< Shape3D > | |
typedef Shape3D *(* | RootFactory) (std::istream *) |
The type of a root factory is a function, taking an istream* as argument, and returning a Root*. | |
typedef FactoryRegistry< std::string, RootFactory, interfile_less > | RegistryType |
The type of the registry. | |
Static Protected Member Functions inherited from stir::RegisteredObject< Shape3D > | |
static RegistryType & | registry () |
Static function returning the registry. More... | |
Three-dimensional ellipsoidal cylinder.
and
and
where are described in the documentation for class Shape3DWithOrientation.
Ellipsoidal Cylinder Parameters:= radius-x (in mm):= <float> radius-y (in mm):= <float> length-z (in mm):= <float> initial angle (in deg):= <float> ; (defaults to 0) final_angle (in deg):= <float> ; (defaults to 360) ; any parameters of Shape3DWithOrientation End:=
stir::EllipsoidalCylinder::EllipsoidalCylinder | ( | const float | length_z, |
const float | radius_y, | ||
const float | radius_x, | ||
const CartesianCoordinate3D< float > & | centre, | ||
const Array< 2, float > & | direction_vectors = diagonal_matrix(3, 1.F) |
||
) |
Constructor.
stir::EllipsoidalCylinder::EllipsoidalCylinder | ( | const float | length_z, |
const float | radius_y, | ||
const float | radius_x, | ||
const float | theta_1, | ||
const float | theta_2, | ||
const CartesianCoordinate3D< float > & | centre, | ||
const Array< 2, float > & | direction_vectors = diagonal_matrix(3, 1.F) |
||
) |
Constructor.
References stir::error(), length, radius_x, radius_y, stir::Shape3DWithOrientation::set_direction_vectors(), and stir::Shape3D::set_origin().
bool stir::EllipsoidalCylinder::operator== | ( | const EllipsoidalCylinder & | cylinder | ) | const |
|
overridevirtual |
Compare shapes.
This virtual function has to be implemented in each final class of the hierarchy. However, Shape3D::operator== has an implementation that checks equality of the origin (up-to a tolerance of .001). Derived classes can call this implementation.
Implements stir::Shape3D.
|
overridevirtual |
determine if a point is inside the shape or not (up to floating point errors)
coord | is a cartesian coordinate in 'absolute' coordinates, i.e. in mm and not relative to the origin member. |
This is really only well defined for shapes with sharp boundaries.
Implements stir::Shape3D.
References _PI, clone(), EllipsoidalCylinder(), get_geometric_volume(), stir::Shape3DWithOrientation::get_volume_of_unit_cell(), length, radius_x, radius_y, stir::square(), theta_1, theta_2, and stir::Shape3DWithOrientation::transform_to_shape_coords().
|
overrideprotectedvirtual |
set defaults before parsing
sets radii and length to 0, theta_1=0, theta_2=360 and calls Shape3DWithOrientation::set_defaults()
Reimplemented from stir::ParsingObject.
|
overrideprotectedvirtual |
This will be called at the end of the parsing.
Reimplemented from stir::ParsingObject.
References stir::warning().