EMAN2
|
Region defines a 2D or 3D rectangular region specified by its origin coordinates and all edges' sizes. More...
#include <geometry.h>
Public Member Functions | |
Region () | |
Construct a null region with its origin at coordinate origins and its sizes to be 0. More... | |
Region (int x, int xsize) | |
Construct a 1D integer region. More... | |
Region (int x, int y, int xsize, int ysize) | |
Construct a 2D integer region. More... | |
Region (int x, int y, int z, int xsize, int ysize, int zsize) | |
Construct a 3D integer region. More... | |
Region (float x, float xsize) | |
Construct a 1D floating-number region. More... | |
Region (float x, float y, float xsize, float ysize) | |
Construct a 2D floating-number region. More... | |
Region (float x, float y, float z, float xsize, float ysize, float zsize) | |
Construct a 3D floating-number region. More... | |
Region (double x, double xsize) | |
Construct a 1D floating-number region. More... | |
Region (double x, double y, double xsize, double ysize) | |
Construct a 2D floating-number region. More... | |
Region (double x, double y, double z, double xsize, double ysize, double zsize) | |
Construct a 3D floating-number region. More... | |
Region (const FloatPoint &o, const FloatSize &s) | |
Construct a region given's orginal point and edge sizes. More... | |
Region (const Region &r) | |
~Region () | |
bool | inside_region () const |
to check whether a point is inside this region More... | |
bool | inside_region (const FloatPoint &p) const |
bool | inside_region (float x) const |
bool | inside_region (float x, float y) const |
bool | inside_region (float x, float y, float z) const |
float | get_width () const |
get the width More... | |
float | get_height () const |
get the height More... | |
float | get_depth () const |
get the depth More... | |
void | set_width (const float &v) |
set the width More... | |
void | set_height (const float &v) |
set the height More... | |
void | set_depth (const float &v) |
set the depth More... | |
float | x_origin () const |
get the x element of the origin More... | |
float | y_origin () const |
get the y element of the origin More... | |
float | z_origin () const |
get the z element of the origin More... | |
vector< float > | get_size () const |
get the size of each dimension as a vector More... | |
vector< float > | get_origin () const |
get the origin as a vector More... | |
void | set_origin (const vector< float > &v) |
set the origin using a vector More... | |
bool | is_region_in_box (const FloatSize &box) const |
To check whether 'this' region is inside a given box assuming the box's origins are (0,0,0). More... | |
int | get_ndim () const |
Get the region's dimension. More... | |
string | get_string () const |
Get the description of this region in a string. More... | |
Public Attributes | |
FloatPoint | origin |
FloatSize | size |
Region defines a 2D or 3D rectangular region specified by its origin coordinates and all edges' sizes.
The coordinates and edge sizes can be integer or floating numbers.
Definition at line 496 of file geometry.h.
|
inline |
Construct a null region with its origin at coordinate origins and its sizes to be 0.
Definition at line 502 of file geometry.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Construct a region given's orginal point and edge sizes.
Definition at line 582 of file geometry.h.
|
inline |
|
inline |
Definition at line 593 of file geometry.h.
|
inline |
get the depth
Definition at line 610 of file geometry.h.
References size.
Referenced by EMAN::EMData::extract_box(), and EMAN::EMUtil::process_region_io().
|
inline |
get the height
Definition at line 608 of file geometry.h.
References size.
Referenced by EMAN::EMData::extract_box(), and EMAN::EMUtil::process_region_io().
|
inline |
Get the region's dimension.
Definition at line 644 of file geometry.h.
References EMAN::FloatPoint::get_ndim(), and origin.
Referenced by EMAN::ImageIO::check_region(), EMAN::EMUtil::get_region_dims(), EMAN::EMUtil::get_region_origins(), EMAN::EMUtil::process_region_io(), and EMAN::MrcIO::read_mrc_header().
|
inline |
get the origin as a vector
Definition at line 629 of file geometry.h.
References origin.
Referenced by EMAN::EMUtil::process_region_io().
|
inline |
get the size of each dimension as a vector
Definition at line 627 of file geometry.h.
References size.
Referenced by EMAN::EMUtil::get_region_dims(), and EMAN::EMUtil::process_region_io().
string Region::get_string | ( | ) | const |
Get the description of this region in a string.
Definition at line 138 of file geometry.cpp.
References EMAN::FloatPoint::get_ndim(), origin, and size.
Referenced by EMAN::ImageIO::check_region().
|
inline |
get the width
Definition at line 606 of file geometry.h.
References size.
Referenced by EMAN::EMData::extract_box(), and EMAN::EMUtil::process_region_io().
bool Region::inside_region | ( | ) | const |
to check whether a point is inside this region
Definition at line 64 of file geometry.cpp.
References size.
Referenced by inside_region().
bool Region::inside_region | ( | const FloatPoint & | p | ) | const |
Definition at line 73 of file geometry.cpp.
References EMAN::FloatPoint::get_ndim(), and inside_region().
bool Region::inside_region | ( | float | x | ) | const |
bool Region::inside_region | ( | float | x, |
float | y | ||
) | const |
bool Region::inside_region | ( | float | x, |
float | y, | ||
float | z | ||
) | const |
Definition at line 111 of file geometry.cpp.
bool Region::is_region_in_box | ( | const FloatSize & | box | ) | const |
To check whether 'this' region is inside a given box assuming the box's origins are (0,0,0).
box | The nD rectangular box. |
Definition at line 123 of file geometry.cpp.
Referenced by EMAN::ImageIO::check_region().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
get the x element of the origin
Definition at line 620 of file geometry.h.
References origin.
Referenced by EMAN::EMData::extract_box(), and EMAN::EMUtil::process_region_io().
|
inline |
get the y element of the origin
Definition at line 622 of file geometry.h.
References origin.
Referenced by EMAN::EMData::extract_box(), and EMAN::EMUtil::process_region_io().
|
inline |
get the z element of the origin
Definition at line 624 of file geometry.h.
References origin.
Referenced by EMAN::EMData::extract_box(), and EMAN::EMUtil::process_region_io().
FloatPoint EMAN::Region::origin |
Definition at line 654 of file geometry.h.
Referenced by EMAN::EMData::clip_inplace(), EMAN::EMData::get_clip(), get_ndim(), get_origin(), EMAN::EMUtil::get_region_origins(), get_string(), EMAN::TestTomoImage::insert_rectangle(), inside_region(), is_region_in_box(), EMAN::EMUtil::process_ascii_region_io(), EMAN::MrcIO::read_mrc_header(), Region(), set_origin(), x_origin(), y_origin(), and z_origin().
FloatSize EMAN::Region::size |
Definition at line 655 of file geometry.h.
Referenced by EMAN::EMData::clip_inplace(), EMAN::EMData::get_clip(), get_depth(), get_height(), get_size(), get_string(), get_width(), EMAN::TestTomoImage::insert_rectangle(), inside_region(), is_region_in_box(), Region(), set_depth(), set_height(), and set_width().