MorphoGraphX
|
The Stack class represent the dimensions of the 3D data, and the frames transformations. More...
#include <Process.hpp>
Public Member Functions | |
Stack (int id) | |
Create an empty stack with a main and a work store. | |
Stack (const Stack ©) | |
Deep copy of a stack (i.e. More... | |
~Stack () | |
Delete the stores attached to the stack, but not the meshes. | |
int | id () const |
Id of a stack. More... | |
void | setId (int i) |
Change the id of the stack. More... | |
int | userId () const |
Id as seen by the user. More... | |
const Store * | main () const |
Access the main store. | |
Store * | main () |
Access the main store. | |
void | setMain (Store *m) |
Change the main store. More... | |
const Store * | work () const |
Access the work store. | |
Store * | work () |
Access the work store. | |
void | setWork (Store *w) |
Change the work store. More... | |
const Store * | currentStore () const |
Returns the current store. | |
Store * | currentStore () |
Returns the current store. | |
Point3u | size () const |
Returns the size, in voxels, of the stores. | |
BoundingBox3i | boundingBox () const |
Returns the bounding box, in voxels, of the stores. | |
Point3f | step () const |
Returns the size, in micro-meters, of a voxel. | |
size_t | storeSize () const |
Returns the size, in number of elements, of the stores. | |
bool | empty () const |
True if the stack is empty (i.e. More... | |
Point3f | scale () const |
Scaling factor to apply, if scaled. | |
Point3f | origin () const |
Position of the point (0,0,0) of the image, in world coordinate. | |
void | setScale (Point3f s) |
Set the scaling factor of the stack. | |
void | setOrigin (const Point3f &s) |
Set the origin in coordinate of the front-bottom-left corner. | |
void | setSize (const Point3u &s) |
Change the size (in voxel) of the stack. More... | |
void | setStep (const Point3f &s) |
Change the dimensions of a voxel. | |
bool | showScale () const |
True if the stack is scaled. | |
void | setShowScale (bool s) |
Set if the stack should be scaled. | |
bool | tieScales () const |
True if the 3 scaling axis are tied together. | |
void | setTieScales (bool s) |
Set if the scales should be tied. | |
bool | showTrans () const |
True if the stack is shown transformed. | |
void | setShowTrans (bool s) |
Set if the stack should be transformed. | |
bool | showBBox () const |
True if the Bounding Box of the stack is shown. | |
void | setShowBBox (bool s) |
Set if the bounding box of the stack should be visible. | |
Matrix4f | worldToImage () const |
Matrix transforming a world point to an image one. | |
Matrix4f | imageToWorld () const |
Matrix transforming an image point to a world one. | |
Matrix4f | worldToImageVector () const |
Matrix transforming a world vector to an image one. | |
Matrix4f | imageToWorldVector () const |
Matrix transforming an image vector to a world one. | |
template<typename T > | |
Point3f | imageToWorld (const util::Vector< 3, T > &img) const |
Go from image coordinates to world coordinates (for a point) | |
template<typename T > | |
util::Vector< 3, T > | worldToImage (Point3f wrld) const |
Go from world coordinates to image coordinates (for a point) | |
template<typename T > | |
Point3f | imageToWorldVector (const util::Vector< 3, T > &img) const |
Go from image coordinates to world coordinates (for a vector) | |
template<typename T > | |
util::Vector< 3, T > | worldToImageVector (Point3f wrld) const |
Go from world coordinates to image coordinates (for a vector) | |
template<typename T > | |
BoundingBox3f | imageToWorld (const util::BoundingBox< 3, T > &img) const |
Go from image coordinates to world coordinates (for a point) | |
template<typename T > | |
util::BoundingBox< 3, T > | worldToImage (const BoundingBox3f &wrld) const |
Go from world coordinates to image coordinates (for a point) | |
Point3f | worldToImagef (const Point3f &a) const |
Point3i | worldToImagei (const Point3f &a) const |
Point3u | worldToImageu (const Point3f &a) const |
BoundingBox3f | worldToImagef (const BoundingBox3f &a) const |
BoundingBox3i | worldToImagei (const BoundingBox3f &a) const |
BoundingBox3u | worldToImageu (const BoundingBox3f &a) const |
Point3f | worldToImageVectorf (const Point3f &a) const |
Point3i | worldToImageVectori (const Point3f &a) const |
Point3u | worldToImageVectoru (const Point3f &a) const |
Point3f | abstractToWorld (const Point3f &p) const |
Go from abstract unit to world unit. More... | |
Point3f | worldSize () const |
Size of the image, in world coordinate. | |
bool | boundsOK (int x, int y, int z) const |
Check if (x,y,z) is in the image. | |
size_t | offset (uint x, uint y, uint z) const |
Compute offset for image data. | |
size_t | offset (Point3i ipos) const |
Returns the position, in the image, of the point of image coordinate ipos . | |
Point3u | position (size_t offset) const |
Compute the position from the offset. | |
void | center () |
Shift the image so it is centered. | |
const qglviewer::ManipulatedFrame & | frame () const |
Returns the manipulated frame. | |
qglviewer::ManipulatedFrame & | frame () |
Returns the manipulated frame. | |
const qglviewer::ManipulatedFrame & | trans () const |
Returns the transformation frame. | |
qglviewer::ManipulatedFrame & | trans () |
Returns the transformation frame. | |
qglviewer::ManipulatedFrame & | getFrame () |
Returns the active frame (i.e. More... | |
const qglviewer::ManipulatedFrame & | getFrame () const |
Returns the active frame (i.e. More... | |
int | viewLabel () const |
Return the label to be used. | |
void | setLabel (int l) |
Change the label to be used. | |
int | nextLabel () |
Return the next label to be used and change it so successive calls return successive labels. | |
bool | labelChanged () const |
Returns true if the label changed during this process. | |
void | setMainAsCurrent () |
void | setWorkAsCurrent () |
void | setNoneAsCurrent () |
void | setCurrentStore (Store *store) |
void | reset () |
Erase everything. | |
Friends | |
class | process::SetupProcess |
The Stack class represent the dimensions of the 3D data, and the frames transformations.
The stack contains two stores (i.e. two 3D images): main and work. Typical algorithm will read the current store, and write the result in the work store. If, at the end of the process, the main and work store are not of the size stored in the stack, then both will be erased.
mgx::Stack::Stack | ( | const Stack & | copy | ) |
Deep copy of a stack (i.e.
the content of main and work store will be copied)
Go from abstract unit to world unit.
Abstract unit is a reference system in which the stack maximal dimensions are [-0.5,0.5]
|
inline |
True if the stack is empty (i.e.
of zero size)
|
inline |
Returns the active frame (i.e.
It will be the manipulated frame or the transformation frame, depending on which is used (i.e. is showTrans() true or false)
|
inline |
Returns the active frame (i.e.
It will be the manipulated frame or the transformation frame, depending on which is used (i.e. is showTrans() true or false)
|
inline |
Id of a stack.
This is the same id used in the Process:stack(int) method.
|
inline |
Change the id of the stack.
Please do not use this method for stacks attached to a process.
void mgx::Stack::setMain | ( | Store * | m | ) |
Change the main store.
void mgx::Stack::setSize | ( | const Point3u & | s | ) |
Change the size (in voxel) of the stack.
void mgx::Stack::setWork | ( | Store * | w | ) |
Change the work store.
|
inline |
Id as seen by the user.
This is, typically id()+1