MorphoGraphX  2.0-1-227
Public Member Functions | Friends | List of all members
mgx::Stack Class Reference

#include <Process.hpp>

Public Member Functions

 Stack (int id)
 Create an empty stack with a main and a work store. More...
 
 Stack (const Stack &copy)
 Deep copy of a stack (i.e. More...
 
 ~Stack ()
 Delete the stores attached to the stack, but not the meshes. More...
 
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 Storemain () const
 Access the main store. More...
 
Storemain ()
 Access the main store. More...
 
void setMain (Store *m)
 Change the main store. More...
 
const Storework () const
 Access the work store. More...
 
Storework ()
 Access the work store. More...
 
void setWork (Store *w)
 Change the work store. More...
 
const StorecurrentStore () const
 Returns the current store. More...
 
StorecurrentStore ()
 Returns the current store. More...
 
Point3u size () const
 Returns the size, in voxels, of the stores. More...
 
BoundingBox3i boundingBox () const
 Returns the bounding box, in voxels, of the stores. More...
 
Point3f step () const
 Returns the size, in micro-meters, of a voxel. More...
 
size_t storeSize () const
 Returns the size, in number of elements, of the stores. More...
 
bool empty () const
 True if the stack is empty (i.e. More...
 
Point3f scale () const
 Scaling factor to apply, if scaled. More...
 
Point3f origin () const
 Position of the point (0,0,0) of the image, in world coordinate. More...
 
void setScale (Point3f s)
 Set the scaling factor of the stack. More...
 
void setOrigin (const Point3f &s)
 Set the origin in coordinate of the front-bottom-left corner. More...
 
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. More...
 
bool showScale () const
 True if the stack is scaled. More...
 
void setShowScale (bool s)
 Set if the stack should be scaled. More...
 
bool tieScales () const
 True if the 3 scaling axis are tied together. More...
 
void setTieScales (bool s)
 Set if the scales should be tied. More...
 
bool showTrans () const
 True if the stack is shown transformed. More...
 
void setShowTrans (bool s)
 Set if the stack should be transformed. More...
 
bool showBBox () const
 True if the Bounding Box of the stack is shown. More...
 
void setShowBBox (bool s)
 Set if the bounding box of the stack should be visible. More...
 
Matrix4f worldToImage () const
 Matrix transforming a world point to an image one. More...
 
Matrix4f imageToWorld () const
 Matrix transforming an image point to a world one. More...
 
Matrix4f worldToImageVector () const
 Matrix transforming a world vector to an image one. More...
 
Matrix4f imageToWorldVector () const
 Matrix transforming an image vector to a world one. More...
 
template<typename T >
Point3f imageToWorld (const Vector< 3, T > &img) const
 Go from image coordinates to world coordinates (for a point) More...
 
template<typename T >
Vector< 3, T > worldToImage (Point3f wrld) const
 Go from world coordinates to image coordinates (for a point) More...
 
template<typename T >
Point3f imageToWorldVector (const Vector< 3, T > &img) const
 Go from image coordinates to world coordinates (for a vector) More...
 
template<typename T >
Vector< 3, T > worldToImageVector (Point3f wrld) const
 Go from world coordinates to image coordinates (for a vector) More...
 
template<typename T >
BoundingBox3f imageToWorld (const BoundingBox< 3, T > &img) const
 Go from image coordinates to world coordinates (for a point) More...
 
template<typename T >
BoundingBox< 3, T > worldToImage (const BoundingBox3f &wrld) const
 Go from world coordinates to image coordinates (for a point) More...
 
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. More...
 
bool boundsOK (int x, int y, int z) const
 Check if (x,y,z) is in the image. More...
 
size_t offset (uint x, uint y, uint z) const
 Compute offset for image data. More...
 
size_t offset (Point3i ipos) const
 Returns the position, in the image, of the point of image coordinate ipos. More...
 
Point3u position (size_t offset) const
 Compute the position from the offset. More...
 
void center ()
 Shift the image so it is centered. More...
 
const qglviewer::ManipulatedFrameframe () const
 Returns the manipulated frame. More...
 
qglviewer::ManipulatedFrameframe ()
 Returns the manipulated frame. More...
 
const qglviewer::ManipulatedFrametrans () const
 Returns the transformation frame. More...
 
qglviewer::ManipulatedFrametrans ()
 Returns the transformation frame. More...
 
qglviewer::ManipulatedFramegetFrame ()
 Returns the active frame (i.e. More...
 
const qglviewer::ManipulatedFramegetFrame () const
 Returns the active frame (i.e. More...
 
int viewLabel () const
 Return the label to be used. More...
 
void setLabel (int l)
 Change the label to be used. More...
 
int nextLabel ()
 Return the next label to be used and change it so successive calls return successive labels. More...
 
void setMainAsCurrent ()
 
void setWorkAsCurrent ()
 
void setNoneAsCurrent ()
 
void setCurrentStore (Store *store)
 
void reset ()
 Erase everything. More...
 

Friends

class SetupProcess
 

Detailed Description

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.

Definition at line 33 of file Stack.hpp.

Constructor & Destructor Documentation

◆ Stack() [1/2]

mgx::Stack::Stack ( int  id)

Create an empty stack with a main and a work store.

◆ Stack() [2/2]

mgx::Stack::Stack ( const Stack copy)

Deep copy of a stack (i.e.

the content of main and work store will be copied)

◆ ~Stack()

mgx::Stack::~Stack ( )

Delete the stores attached to the stack, but not the meshes.

Member Function Documentation

◆ abstractToWorld()

Point3f mgx::Stack::abstractToWorld ( const Point3f p) const
inline

Go from abstract unit to world unit.

Abstract unit is a reference system in which the stack maximal dimensions are [-0.5,0.5]

Definition at line 335 of file Stack.hpp.

◆ boundingBox()

BoundingBox3i mgx::Stack::boundingBox ( ) const
inline

Returns the bounding box, in voxels, of the stores.

Definition at line 139 of file Stack.hpp.

◆ boundsOK()

bool mgx::Stack::boundsOK ( int  x,
int  y,
int  z 
) const
inline

Check if (x,y,z) is in the image.

Definition at line 348 of file Stack.hpp.

◆ center()

void mgx::Stack::center ( )

Shift the image so it is centered.

◆ currentStore() [1/2]

Store* mgx::Stack::currentStore ( )
inline

Returns the current store.

Definition at line 126 of file Stack.hpp.

◆ currentStore() [2/2]

const Store* mgx::Stack::currentStore ( ) const
inline

Returns the current store.

Definition at line 120 of file Stack.hpp.

◆ empty()

bool mgx::Stack::empty ( ) const
inline

True if the stack is empty (i.e.

of zero size)

Definition at line 160 of file Stack.hpp.

◆ frame() [1/2]

qglviewer::ManipulatedFrame& mgx::Stack::frame ( )
inline

Returns the manipulated frame.

Definition at line 393 of file Stack.hpp.

◆ frame() [2/2]

const qglviewer::ManipulatedFrame& mgx::Stack::frame ( ) const
inline

Returns the manipulated frame.

Definition at line 386 of file Stack.hpp.

◆ getFrame() [1/2]

qglviewer::ManipulatedFrame& mgx::Stack::getFrame ( )
inline

Returns the active frame (i.e.

frame() or trans()).

It will be the manipulated frame or the transformation frame, depending on which is used (i.e. is showTrans() true or false)

Definition at line 416 of file Stack.hpp.

◆ getFrame() [2/2]

const qglviewer::ManipulatedFrame& mgx::Stack::getFrame ( ) const
inline

Returns the active frame (i.e.

frame() or trans()).

It will be the manipulated frame or the transformation frame, depending on which is used (i.e. is showTrans() true or false)

Definition at line 426 of file Stack.hpp.

◆ id()

int mgx::Stack::id ( ) const
inline

Id of a stack.

This is the same id used in the Process:stack(int) method.

Definition at line 57 of file Stack.hpp.

◆ imageToWorld() [1/3]

Matrix4f mgx::Stack::imageToWorld ( ) const

Matrix transforming an image point to a world one.

◆ imageToWorld() [2/3]

template<typename T >
BoundingBox3f mgx::Stack::imageToWorld ( const BoundingBox< 3, T > &  img) const
inline

Go from image coordinates to world coordinates (for a point)

Definition at line 289 of file Stack.hpp.

◆ imageToWorld() [3/3]

template<typename T >
Point3f mgx::Stack::imageToWorld ( const Vector< 3, T > &  img) const
inline

Go from image coordinates to world coordinates (for a point)

Definition at line 265 of file Stack.hpp.

◆ imageToWorldVector() [1/2]

Matrix4f mgx::Stack::imageToWorldVector ( ) const

Matrix transforming an image vector to a world one.

◆ imageToWorldVector() [2/2]

template<typename T >
Point3f mgx::Stack::imageToWorldVector ( const Vector< 3, T > &  img) const
inline

Go from image coordinates to world coordinates (for a vector)

Definition at line 277 of file Stack.hpp.

◆ main() [1/2]

Store* mgx::Stack::main ( )
inline

Access the main store.

Definition at line 88 of file Stack.hpp.

◆ main() [2/2]

const Store* mgx::Stack::main ( ) const
inline

Access the main store.

Definition at line 82 of file Stack.hpp.

◆ nextLabel()

int mgx::Stack::nextLabel ( )
inline

Return the next label to be used and change it so successive calls return successive labels.

Definition at line 446 of file Stack.hpp.

◆ offset() [1/2]

size_t mgx::Stack::offset ( Point3i  ipos) const
inline

Returns the position, in the image, of the point of image coordinate ipos.

Definition at line 364 of file Stack.hpp.

◆ offset() [2/2]

size_t mgx::Stack::offset ( uint  x,
uint  y,
uint  z 
) const
inline

Compute offset for image data.

Definition at line 357 of file Stack.hpp.

◆ origin()

Point3f mgx::Stack::origin ( ) const
inline

Position of the point (0,0,0) of the image, in world coordinate.

Definition at line 174 of file Stack.hpp.

◆ position()

Point3u mgx::Stack::position ( size_t  offset) const
inline

Compute the position from the offset.

Definition at line 369 of file Stack.hpp.

◆ reset()

void mgx::Stack::reset ( )

Erase everything.

◆ scale()

Point3f mgx::Stack::scale ( ) const
inline

Scaling factor to apply, if scaled.

Definition at line 167 of file Stack.hpp.

◆ setCurrentStore()

void mgx::Stack::setCurrentStore ( Store store)
inline

Definition at line 464 of file Stack.hpp.

◆ setId()

void mgx::Stack::setId ( int  i)
inline

Change the id of the stack.

Please do not use this method for stacks attached to a process.

Definition at line 66 of file Stack.hpp.

◆ setLabel()

void mgx::Stack::setLabel ( int  l)
inline

Change the label to be used.

Definition at line 439 of file Stack.hpp.

◆ setMain()

void mgx::Stack::setMain ( Store m)

Change the main store.

Note
A process shouldn't use this method. It is more sensible to clear, or resize the existing store.

◆ setMainAsCurrent()

void mgx::Stack::setMainAsCurrent ( )
inline

Definition at line 454 of file Stack.hpp.

◆ setNoneAsCurrent()

void mgx::Stack::setNoneAsCurrent ( )
inline

Definition at line 460 of file Stack.hpp.

◆ setOrigin()

void mgx::Stack::setOrigin ( const Point3f s)

Set the origin in coordinate of the front-bottom-left corner.

◆ setScale()

void mgx::Stack::setScale ( Point3f  s)
inline

Set the scaling factor of the stack.

Definition at line 181 of file Stack.hpp.

◆ setShowBBox()

void mgx::Stack::setShowBBox ( bool  s)
inline

Set if the bounding box of the stack should be visible.

Definition at line 248 of file Stack.hpp.

◆ setShowScale()

void mgx::Stack::setShowScale ( bool  s)
inline

Set if the stack should be scaled.

Definition at line 210 of file Stack.hpp.

◆ setShowTrans()

void mgx::Stack::setShowTrans ( bool  s)
inline

Set if the stack should be transformed.

Definition at line 236 of file Stack.hpp.

◆ setSize()

void mgx::Stack::setSize ( const Point3u s)

Change the size (in voxel) of the stack.

Note
This method will resize the two stores, keeping the data when possible.

◆ setStep()

void mgx::Stack::setStep ( const Point3f s)

Change the dimensions of a voxel.

◆ setTieScales()

void mgx::Stack::setTieScales ( bool  s)
inline

Set if the scales should be tied.

Definition at line 223 of file Stack.hpp.

◆ setWork()

void mgx::Stack::setWork ( Store w)

Change the work store.

Note
A process shouldn't use this method. It is more sensible to clear, or resize the existing store.

◆ setWorkAsCurrent()

void mgx::Stack::setWorkAsCurrent ( )
inline

Definition at line 457 of file Stack.hpp.

◆ showBBox()

bool mgx::Stack::showBBox ( ) const
inline

True if the Bounding Box of the stack is shown.

Definition at line 242 of file Stack.hpp.

◆ showScale()

bool mgx::Stack::showScale ( ) const
inline

True if the stack is scaled.

Definition at line 204 of file Stack.hpp.

◆ showTrans()

bool mgx::Stack::showTrans ( ) const
inline

True if the stack is shown transformed.

Definition at line 230 of file Stack.hpp.

◆ size()

Point3u mgx::Stack::size ( ) const
inline

Returns the size, in voxels, of the stores.

Definition at line 133 of file Stack.hpp.

◆ step()

Point3f mgx::Stack::step ( ) const
inline

Returns the size, in micro-meters, of a voxel.

Definition at line 146 of file Stack.hpp.

◆ storeSize()

size_t mgx::Stack::storeSize ( ) const
inline

Returns the size, in number of elements, of the stores.

Definition at line 154 of file Stack.hpp.

◆ tieScales()

bool mgx::Stack::tieScales ( ) const
inline

True if the 3 scaling axis are tied together.

Definition at line 217 of file Stack.hpp.

◆ trans() [1/2]

qglviewer::ManipulatedFrame& mgx::Stack::trans ( )
inline

Returns the transformation frame.

Definition at line 406 of file Stack.hpp.

◆ trans() [2/2]

const qglviewer::ManipulatedFrame& mgx::Stack::trans ( ) const
inline

Returns the transformation frame.

Definition at line 400 of file Stack.hpp.

◆ userId()

int mgx::Stack::userId ( ) const
inline

Id as seen by the user.

This is, typically id()+1

Definition at line 75 of file Stack.hpp.

◆ viewLabel()

int mgx::Stack::viewLabel ( ) const
inline

Return the label to be used.

Definition at line 433 of file Stack.hpp.

◆ work() [1/2]

Store* mgx::Stack::work ( )
inline

Access the work store.

Definition at line 107 of file Stack.hpp.

◆ work() [2/2]

const Store* mgx::Stack::work ( ) const
inline

Access the work store.

Definition at line 101 of file Stack.hpp.

◆ worldSize()

Point3f mgx::Stack::worldSize ( ) const
inline

Size of the image, in world coordinate.

Definition at line 343 of file Stack.hpp.

◆ worldToImage() [1/3]

Matrix4f mgx::Stack::worldToImage ( ) const

Matrix transforming a world point to an image one.

◆ worldToImage() [2/3]

template<typename T >
BoundingBox<3, T> mgx::Stack::worldToImage ( const BoundingBox3f wrld) const
inline

Go from world coordinates to image coordinates (for a point)

Definition at line 295 of file Stack.hpp.

◆ worldToImage() [3/3]

template<typename T >
Vector<3, T> mgx::Stack::worldToImage ( Point3f  wrld) const
inline

Go from world coordinates to image coordinates (for a point)

Definition at line 271 of file Stack.hpp.

◆ worldToImagef() [1/2]

BoundingBox3f mgx::Stack::worldToImagef ( const BoundingBox3f a) const
inline

Definition at line 310 of file Stack.hpp.

◆ worldToImagef() [2/2]

Point3f mgx::Stack::worldToImagef ( const Point3f a) const
inline

Definition at line 300 of file Stack.hpp.

◆ worldToImagei() [1/2]

BoundingBox3i mgx::Stack::worldToImagei ( const BoundingBox3f a) const
inline

Definition at line 313 of file Stack.hpp.

◆ worldToImagei() [2/2]

Point3i mgx::Stack::worldToImagei ( const Point3f a) const
inline

Definition at line 303 of file Stack.hpp.

◆ worldToImageu() [1/2]

BoundingBox3u mgx::Stack::worldToImageu ( const BoundingBox3f a) const
inline

Definition at line 316 of file Stack.hpp.

◆ worldToImageu() [2/2]

Point3u mgx::Stack::worldToImageu ( const Point3f a) const
inline

Definition at line 306 of file Stack.hpp.

◆ worldToImageVector() [1/2]

Matrix4f mgx::Stack::worldToImageVector ( ) const

Matrix transforming a world vector to an image one.

◆ worldToImageVector() [2/2]

template<typename T >
Vector<3, T> mgx::Stack::worldToImageVector ( Point3f  wrld) const
inline

Go from world coordinates to image coordinates (for a vector)

Definition at line 283 of file Stack.hpp.

◆ worldToImageVectorf()

Point3f mgx::Stack::worldToImageVectorf ( const Point3f a) const
inline

Definition at line 320 of file Stack.hpp.

◆ worldToImageVectori()

Point3i mgx::Stack::worldToImageVectori ( const Point3f a) const
inline

Definition at line 323 of file Stack.hpp.

◆ worldToImageVectoru()

Point3u mgx::Stack::worldToImageVectoru ( const Point3f a) const
inline

Definition at line 326 of file Stack.hpp.

Friends And Related Function Documentation

◆ SetupProcess

friend class SetupProcess
friend

Definition at line 34 of file Stack.hpp.


The documentation for this class was generated from the following file: