anatomist  5.1.2
3D neuroimaging data viewer
anatomist::AVolumeView< T > Class Template Reference

#include <anatomist/volume/volumeview.h>

Inheritance diagram for anatomist::AVolumeView< T >:
Collaboration diagram for anatomist::AVolumeView< T >:

Public Member Functions

 AVolumeView (const std::list< AObject * > &)
 
 AVolumeView (const std::string &filename)
 
 AVolumeView (carto::rc_ptr< carto::Volume< T > > vol)
 
 AVolumeView (const std::vector< carto::rc_ptr< carto::Volume< T > > > &vols)
 
virtual ~AVolumeView ()
 
virtual void setVolume (carto::rc_ptr< carto::Volume< T > > vol)
 
void setupTransformationFromView ()
 
void setupViewFromTransformation ()
 
void setTargetSize (const std::vector< int > &)
 
const std::vector< int > & targetSize () const
 
int resolutionLevel () const
 
int selectBestResolutionLevel (const Point3df &vs) const
 
const carto::rc_ptr< AVolume< T > > view () const
 
carto::rc_ptr< AVolume< T > > view ()
 
Point3df initialFOV () const
 
void setInitialFOV (const Point3df &fov)
 
virtual int MType () const
 Precise type of multi-object. More...
 
virtual bool CanRemove (AObject *)
 
virtual bool render (PrimList &prim, const ViewState &vs)
 rendering (generally 2D or 3D using OpenGL). More...
 
virtual void setFileName (const std::string &fname)
 
virtual void SetExtrema ()
 Scans the object internals and determines its (texture) extrema values. More...
 
virtual void adjustPalette ()
 Creates or updates object palette according to object values (if needed) More...
 
virtual std::vector< float > voxelSize () const
 Returns at least 4 sizes. For 3D objects, returns (1, 1, 1, 1) More...
 
bool Is2DObject ()
 Can be display in 2D windows. More...
 
bool textured2D () const
 true if 2D rendering uses a textured plane (not a full openGL object) More...
 
bool Is3DObject ()
 Can be display in 3D windows. More...
 
virtual bool isTransparent () const
 
float MinT () const
 Obsolete, deprecated. More...
 
float MaxT () const
 Obsolete, deprecated. More...
 
virtual bool boundingBox (std::vector< float > &bmin, std::vector< float > &bmax) const
 Fills bmin and bmax with the N-D bounding box extrema in the object's referential coordinates. More...
 
virtual bool boundingBox2D (std::vector< float > &bmin, std::vector< float > &bmax) const
 Bounding box in 2D views mode. More...
 
virtual void update (const Observable *observable, void *arg)
 This class is an Observer of each of the AObject it groups. More...
 
- Public Member Functions inherited from anatomist::ObjectVector
 ObjectVector ()
 
virtual ~ObjectVector ()
 
virtual size_t size () const
 
virtual iterator begin ()
 
virtual const_iterator begin () const
 
virtual iterator end ()
 
virtual const_iterator end () const
 
virtual void insert (AObject *)
 
virtual void insert (AObject *, int pos)
 
virtual void insert (const carto::shared_ptr< AObject > &, int pos=-1)
 
virtual const_iterator find (const AObject *) const
 
virtual const_iterator find (const carto::shared_ptr< AObject > &) const
 
virtual void erase (iterator &)
 
virtual TreeoptionTree () const
 Menu tree for new options, see object/optionMatcher.h. More...
 
- Public Member Functions inherited from anatomist::MObject
 MObject ()
 
virtual ~MObject ()
 
virtual const MObjectmObjectAPI () const
 
virtual MObjectmObjectAPI ()
 
int isMultiObject () const
 maybe not necessary ?: we can use dynamic_cast instead More...
 
virtual void setReferential (Referential *ref)
 
virtual void setReferentialInheritance (AObject *)
 
void eraseObject (AObject *obj)
 
virtual AObjectobjectAt (const std::vector< float > &pos, float tol=0)
 Find the object (sub-object) at given postion with a tolerence. More...
 
virtual std::list< AObject * > renderedSubObjects (const ViewState &) const
 lis of objects displayed in render() in a default implementation More...
 
virtual bool renderingIsObserverDependent () const
 true only if the rendering (openGL) of the object changes with the observer position/orientation of the view (which is rare, but typically needed for Volume Rendering) More...
 
virtual void setContentChanged () const
 
bool hasContentChanged () const
 
virtual void clearHasChangedFlags () const
 
virtual void SetMaterial (const Material &mat)
 
virtual void setPalette (const AObjectPalette &pal)
 
virtual bool shouldRemoveChildrenWithMe () const
 tells whether children objects should be removed from views when this MObject is removed from a view. More...
 
virtual std::list< AObject * > generativeChildren () const
 Children objects which have been used to build the current MObject. More...
 
- Public Member Functions inherited from anatomist::AObject
 AObject (const std::string &filename="")
 
virtual ~AObject ()
 AObject subclasses must call cleanup() in their destructor. More...
 
virtual AObjectclone (bool shallow=true)
 Makes a copy of the object, with a duplicated object structure, palette and material, but which may share the underlying low-level data object (Aims object). More...
 
virtual const GLComponentglAPI () const
 OpenGL objects const API. More...
 
virtual GLComponentglAPI ()
 OpenGL objects API. More...
 
int type () const
 Object type identifier. More...
 
void setType (int type)
 Method to set type id, because type() is not virtual. More...
 
int id () const
 Unique ID assigned upon construction, but somewhat unused now... More...
 
std::string name () const
 Name shown in control window. More...
 
std::string fileName () const
 File name (if any) for loaded objects. More...
 
void setName (const std::string &n)
 
void setFileName (const std::string &filename)
 
void setId (int id)
 
virtual void setVoxelSize (const std::vector< float > &)
 
virtual void internalUpdate ()
 Updates the state of the object. More...
 
virtual AObjectPalettepalette ()
 Normally, getOrCreatePalette() should be used instead of this function in most cases. More...
 
virtual const AObjectPalettepalette () const
 
virtual const AObjectPalettegetOrCreatePalette () const
 User normally calls this function. More...
 
virtual void createDefaultPalette (const std::string &name="")
 function called by getOrCreatePalette() - overloadable, need not be called directly More...
 
virtual MaterialGetMaterial ()
 
virtual const Materialmaterial () const
 
ReferentialgetReferential () const
 
AObjectreferentialInheritance () const
 if not null, the object referential is inherited from this object More...
 
virtual AObjectfallbackReferentialInheritance () const
 object to take referential from when no ref is assigned More...
 
const ReferentialpreviousReferential () const
 Referential that the object was in before the last change. More...
 
virtual ObjectMenuoptionMenu () const
 
int InMemory () const
 For objects loading only when needed (not used yet...) More...
 
int Visible () const
 Visibility in control window. More...
 
void SetVisibility (int v)
 
ParentListParents ()
 List of multi-objects containing this one. Obsolete: use parents() More...
 
ParentListparents ()
 List of multi-objects containing this one. More...
 
const ParentListparents () const
 List of multi-objects containing this one. More...
 
virtual void RegisterParent (MObject *pob)
 
virtual void UnregisterParent (MObject *pob)
 
const std::set< AWindow * > & WinList ()
 List of windows showing this object. More...
 
virtual void registerWindow (AWindow *window)
 
virtual void unregisterWindow (AWindow *window)
 
virtual bool IsFusion2DAllowed ()
 
virtual int CanBeDestroyed ()
 Allows / unallows destruction of object. More...
 
virtual void setReferenceChanged ()
 
bool hasReferenceChanged () const
 
virtual void setInternalsChanged ()
 Notifies some underlying lower-level objects have changed. More...
 
bool userModified () const
 if the object has been modified by user interaction, and needs saving More...
 
void setUserModified (bool state=true)
 if the object has been modified by user interaction, and needs saving More...
 
virtual AObjectobjectAt (const std::vector< float > &pos, float tol, const Referential *orgref, const Point3df &orggeom)
 Same with origin window referential. More...
 
virtual void setGeomExtrema ()
 Scans the object internals and determines its geometry extrema. More...
 
virtual bool hasTexture () const
 Textured objects have values associated with a geometric coordinate. More...
 
virtual unsigned dimTexture () const
 Number of texture values for a point. More...
 
virtual float mixedTexValue (const std::vector< float > &pos, const Referential *orgRef) const
 Gets a "mixed" texture value at a given space / time location. More...
 
virtual float mixedTexValue (const std::vector< float > &pos) const
 Same as above except that coordinates are not transformed but taken in object coordinates system. More...
 
virtual std::vector< float > texValues (const std::vector< float > &pos, const Referential *orgRef) const
 Gets the array of texture values at a given location. More...
 
virtual std::vector< float > texValues (const std::vector< float > &pos) const
 
virtual bool loadable () const
 
virtual bool savable () const
 
virtual bool reload (const std::string &filename)
 Re-reads objects from disk. More...
 
virtual std::string objectFullTypeName (void) const
 Get Object Full Type Name. More...
 
bool save (const std::string &filename, bool onlyIfModified)
 
virtual bool save (const std::string &filename)
 
virtual bool printTalairachCoord (const Point3df &, const Referential *) const
 should be replaced by a real referential More...
 
void setHeaderOptions ()
 Set some object properties according to the header (.minf), such as material, palette etc. More...
 
virtual void setProperties (carto::Object options)
 Same as setHeaderOptions() and used by it, allows passing a dictionary. More...
 
virtual void storeHeaderOptions ()
 Store some object properties into the header (.minf), such as material, palette etc before saving the object. More...
 
virtual carto::Object makeHeaderOptions () const
 get object properties into a generic object, such as material, palette etc before saving the object More...
 
long loadDate () const
 Time the object was created, loaded or reloaded. More...
 
void setLoadDate (long t)
 
bool isCopy () const
 
void setCopyFlag (bool x=true)
 
virtual std::string toolTip () const
 tooltip displayed in 3D views (HTML). More...
 
carto::Object aimsMeshFromGLComponent ()
 
- Public Member Functions inherited from anatomist::Observable
 Observable ()
 Construct an Observable with zero observers. More...
 
virtual ~Observable ()
 does nothing More...
 
void addObserver (Observer *observer)
 Adds an observer to the set of observers for this object. More...
 
void deleteObserver (Observer *observer)
 Deletes an observer from the set of observers of this object. More...
 
void deleteObservers ()
 Clears the observer list so that this object no longer has any observers (doesn't call any observer method - see notifyUnregisterObservers() for this ) More...
 
int countObservers () const
 Returns the number of observers of this object. More...
 
virtual void notifyObservers (void *arg=0)
 If this object has changed, as indicated by the hasChanged method, then notify all of its observers. More...
 
virtual void notifyUnregisterObservers ()
 Notifies observable destruction to all observers and unregisters them. More...
 
bool hasChanged () const
 Tests if this object has changed. More...
 
bool obsHasChanged (int) const
 only valid during an Observer::update() More...
 
bool obsHasChanged (const std::string &) const
 only valid during an Observer::update() More...
 
void setChanged () const
 Indicates that this object has changed. More...
 
- Public Member Functions inherited from carto::SharedObject
 SharedObject ()
 
 SharedObject (const SharedObject &x)
 
virtual ~SharedObject ()
 
SharedObjectoperator= (const SharedObject &)
 
bool testDeletable ()
 
bool tryDelete ()
 
- Public Member Functions inherited from carto::WeakObject
void attachWeakPtr (weak_ptr< T > &) const
 
void detachWeakPtr (weak_ptr< T > &) const
 
void attachWeakPtr (weak_shared_ptr< T > &) const
 
void detachWeakPtr (weak_shared_ptr< T > &) const
 
virtual ~WeakObject ()
 
- Public Member Functions inherited from carto::RCObject
 RCObject ()
 
 RCObject (const RCObject &)
 
RCObjectoperator= (const RCObject &)
 
virtual ~RCObject ()
 
- Public Member Functions inherited from anatomist::Observer
virtual ~Observer ()
 

Static Public Member Functions

static int classType ()
 
- Static Public Member Functions inherited from anatomist::AObject
static std::list< AObject * > load (const std::string &filename)
 Static object loader: creates an objects, loads its contents. More...
 
static bool reload (AObject *object, bool onlyoutdated=false)
 Reads from disk again. More...
 
static int registerObjectType (const std::string &id)
 Creates a new object type number and returns it. More...
 
static std::string objectTypeName (int type)
 
static void setObjectMenu (std::string type, carto::rc_ptr< ObjectMenu > om)
 
static carto::rc_ptr< ObjectMenugetObjectMenu (std::string type)
 
static std::map< std::string, carto::rc_ptr< ObjectMenu > > & getObjectMenuMap ()
 
static void addObjectMenuRegistration (ObjectMenuRegistrerFunction)
 
static void addObjectMenuRegistration (ObjectMenuRegistrerClass *)
 
static void cleanStatic ()
 cleanup static global variables (called when quitting anatomist) More...
 

Additional Inherited Members

- Public Types inherited from anatomist::MObject
typedef AIterator iterator
 
typedef AIterator const_iterator
 
- Public Types inherited from anatomist::AObject
enum  ObjectType {
  VOLUME , BUCKET , FACET , TRIANG ,
  LIST , VECTOR , MAP , SET ,
  GRAPH , GRAPHOBJECT , VOLSURF , MULTISURF ,
  MULTIBUCKET , MULTIVOLUME , FUSION2D , FUSION3D ,
  FASCICLE , FASCICLEGRAPH , TEXTURE , TEXSURFACE ,
  FUSION2DMESH , VECTORFIELD , OTHER
}
 Base object type identifiers. More...
 
typedef std::set< MObject * > ParentList
 Storage type for parent objects (multi-objects containing this one) More...
 
typedef ObjectMenu *(* ObjectMenuRegistrerFunction) (const AObject *objtype, ObjectMenu *menu)
 dynamic menu registration function More...
 
- Public Types inherited from carto::RCObject
typedef int RefCounterType
 
- Static Public Attributes inherited from anatomist::ObjectVector
static Tree_optionTree
 
- Protected Types inherited from anatomist::ObjectVector
typedef std::list< carto::shared_ptr< AObject > > datatype
 
- Protected Member Functions inherited from anatomist::MObject
virtual void _insertObject (AObject *o)
 must be called by all subclasses in their insert() implementation More...
 
virtual void _eraseObject (AObject *o)
 must be called by all subclasses if they reimplement erase() More...
 
virtual void updateSubObjectReferential (const AObject *o)
 
virtual void clearReferentialInheritance ()
 sets the object to get referential from to null, unregister it More...
 
- Protected Member Functions inherited from anatomist::AObject
const PrimListprimitives () const
 
PrimListprimitives ()
 
virtual void cleanup ()
 must be called by objects destructors - Must be explicitly called by each object destructor since it can call virtual functions More...
 
AObject *& _referentialInheritance ()
 provide access to derived classes More...
 
virtual void unregisterObservable (Observable *)
 Called when an observable is destroyed, only called by Observable: don't use this function directly. More...
 
 AObject (const AObject &)
 copy constructor, protected and used only to reimplement clone() More...
 
- Protected Member Functions inherited from anatomist::Observable
void clearChanged () const
 Indicates that this object has no longer changed, or that it has already notified all of its observers of its most recent change. More...
 
void obsSetChanged (int, bool=true) const
 int-based change flags (use enums to address them) More...
 
void obsSetChanged (const std::string &, bool=true) const
 string-based change flags More...
 
- Protected Member Functions inherited from carto::SharedObject
void disableRefCount ()
 
- Protected Member Functions inherited from carto::WeakObject
 WeakObject ()
 
 WeakObject (const WeakObject &)
 
WeakObjectoperator= (const WeakObject &)
 
- Protected Member Functions inherited from anatomist::Observer
virtual void cleanupObserver ()
 call this function from inherited classes destructors. More...
 
virtual void registerObservable (Observable *)
 only called by Observable: don't use this function directly More...
 
const std::set< Observable * > & observed () const
 
- Protected Attributes inherited from anatomist::ObjectVector
datatype _data
 
- Protected Attributes inherited from anatomist::MObject
bool _contentHasChanged
 
- Protected Attributes inherited from anatomist::AObject
int _type
 Should be static in each object class. More...
 
int _id
 
std::string _name
 
std::string _filename
 
std::set< AWindow * > _winList
 
int _inMemory
 
int _visible
 
ParentList _parents
 
Material _material
 Should be a pointer: some objects don't have a material (2D objects) More...
 
Referential_referential
 Referentiel. More...
 
bool _referenceHasChanged
 Reference has-changed flag. More...
 
AObjectPalette_palette
 Palette. More...
 
- Static Protected Attributes inherited from anatomist::AObject
static std::map< std::string, int > _objectTypes
 name-to-type map More...
 
static std::map< int, std::string > _objectTypeNames
 type-to-name map More...
 
static std::map< std::string, carto::rc_ptr< ObjectMenu > > _objectmenu_map
 Object Menu Map. More...
 

Detailed Description

template<typename T>
class anatomist::AVolumeView< T >

Definition at line 45 of file volumeview.h.

Constructor & Destructor Documentation

◆ AVolumeView() [1/4]

template<typename T >
anatomist::AVolumeView< T >::AVolumeView ( const std::list< AObject * > &  )

◆ AVolumeView() [2/4]

template<typename T >
anatomist::AVolumeView< T >::AVolumeView ( const std::string &  filename)

◆ AVolumeView() [3/4]

template<typename T >
anatomist::AVolumeView< T >::AVolumeView ( carto::rc_ptr< carto::Volume< T > >  vol)

◆ AVolumeView() [4/4]

template<typename T >
anatomist::AVolumeView< T >::AVolumeView ( const std::vector< carto::rc_ptr< carto::Volume< T > > > &  vols)

◆ ~AVolumeView()

template<typename T >
virtual anatomist::AVolumeView< T >::~AVolumeView ( )
virtual

Member Function Documentation

◆ adjustPalette()

template<typename T >
virtual void anatomist::AVolumeView< T >::adjustPalette ( )
virtual

Creates or updates object palette according to object values (if needed)

Reimplemented from anatomist::AObject.

◆ boundingBox()

template<typename T >
virtual bool anatomist::AVolumeView< T >::boundingBox ( std::vector< float > &  bmin,
std::vector< float > &  bmax 
) const
inlinevirtual

Fills bmin and bmax with the N-D bounding box extrema in the object's referential coordinates.

Changed in Anatomist 4.6. The older API was using Point3df instead of vector and informed only the spatial dimensions.

An object with no spatial information (a texture for instance) may still have time information. For this reason, the resulting bounding box should always have 4 components (at least), then 4th and additional ones should be valid, even if the function returns false (no spatial bounding box).

Returns
true if object has a "spatial" bounding box (x, y, z coordinates)

Reimplemented from anatomist::MObject.

Definition at line 84 of file volumeview.h.

◆ boundingBox2D()

template<typename T >
virtual bool anatomist::AVolumeView< T >::boundingBox2D ( std::vector< float > &  bmin,
std::vector< float > &  bmax 
) const
inlinevirtual

Bounding box in 2D views mode.

In mm, may be the same as boundingBox() if the object field of view is the same in 3D and 2D modes. It normally includes voxels size (for a volume, bmin will be -vs/2 where vs is the voxel size, for the 3 first coordinates).

The default implementation just calls boundingBox().

Reimplemented from anatomist::MObject.

Definition at line 87 of file volumeview.h.

◆ CanRemove()

template<typename T >
virtual bool anatomist::AVolumeView< T >::CanRemove ( AObject )
inlinevirtual

Reimplemented from anatomist::ObjectVector.

Definition at line 71 of file volumeview.h.

◆ classType()

template<typename T >
static int anatomist::AVolumeView< T >::classType ( )
static

◆ initialFOV()

template<typename T >
Point3df anatomist::AVolumeView< T >::initialFOV ( ) const
inline

Definition at line 65 of file volumeview.h.

◆ Is2DObject()

template<typename T >
bool anatomist::AVolumeView< T >::Is2DObject ( )
inlinevirtual

Can be display in 2D windows.

Reimplemented from anatomist::MObject.

Definition at line 78 of file volumeview.h.

◆ Is3DObject()

template<typename T >
bool anatomist::AVolumeView< T >::Is3DObject ( )
inlinevirtual

Can be display in 3D windows.

Reimplemented from anatomist::MObject.

Definition at line 80 of file volumeview.h.

◆ isTransparent()

template<typename T >
virtual bool anatomist::AVolumeView< T >::isTransparent ( ) const
inlinevirtual

Reimplemented from anatomist::MObject.

Definition at line 81 of file volumeview.h.

◆ MaxT()

template<typename T >
float anatomist::AVolumeView< T >::MaxT ( ) const
inlinevirtual

Obsolete, deprecated.

Reimplemented from anatomist::MObject.

Definition at line 83 of file volumeview.h.

◆ MinT()

template<typename T >
float anatomist::AVolumeView< T >::MinT ( ) const
inlinevirtual

Obsolete, deprecated.

Reimplemented from anatomist::MObject.

Definition at line 82 of file volumeview.h.

◆ MType()

template<typename T >
virtual int anatomist::AVolumeView< T >::MType ( ) const
inlinevirtual

Precise type of multi-object.

Reimplemented from anatomist::ObjectVector.

Definition at line 69 of file volumeview.h.

References anatomist::AObject::type().

◆ render()

template<typename T >
virtual bool anatomist::AVolumeView< T >::render ( PrimList ,
const ViewState  
)
virtual

rendering (generally 2D or 3D using OpenGL).

Calls GLComponent API ig glAPI() is not null, otherwise nothing is done and this method should be overloaded.

Reimplemented from anatomist::MObject.

◆ resolutionLevel()

template<typename T >
int anatomist::AVolumeView< T >::resolutionLevel ( ) const
inline

Definition at line 61 of file volumeview.h.

◆ selectBestResolutionLevel()

template<typename T >
int anatomist::AVolumeView< T >::selectBestResolutionLevel ( const Point3df vs) const

◆ SetExtrema()

template<typename T >
virtual void anatomist::AVolumeView< T >::SetExtrema ( )
virtual

Scans the object internals and determines its (texture) extrema values.

Reimplemented from anatomist::AObject.

◆ setFileName()

template<typename T >
virtual void anatomist::AVolumeView< T >::setFileName ( const std::string &  fname)
virtual

◆ setInitialFOV()

template<typename T >
void anatomist::AVolumeView< T >::setInitialFOV ( const Point3df fov)

◆ setTargetSize()

template<typename T >
void anatomist::AVolumeView< T >::setTargetSize ( const std::vector< int > &  )

◆ setupTransformationFromView()

template<typename T >
void anatomist::AVolumeView< T >::setupTransformationFromView ( )

◆ setupViewFromTransformation()

template<typename T >
void anatomist::AVolumeView< T >::setupViewFromTransformation ( )

◆ setVolume()

template<typename T >
virtual void anatomist::AVolumeView< T >::setVolume ( carto::rc_ptr< carto::Volume< T > >  vol)
virtual

◆ targetSize()

template<typename T >
const std::vector<int>& anatomist::AVolumeView< T >::targetSize ( ) const

◆ textured2D()

template<typename T >
bool anatomist::AVolumeView< T >::textured2D ( ) const
inlinevirtual

true if 2D rendering uses a textured plane (not a full openGL object)

Reimplemented from anatomist::AObject.

Definition at line 79 of file volumeview.h.

◆ update()

template<typename T >
virtual void anatomist::AVolumeView< T >::update ( const Observable observable,
void *  arg 
)
virtual

This class is an Observer of each of the AObject it groups.

Reimplemented from anatomist::MObject.

◆ view() [1/2]

template<typename T >
carto::rc_ptr<AVolume<T> > anatomist::AVolumeView< T >::view ( )
inline

Definition at line 64 of file volumeview.h.

◆ view() [2/2]

template<typename T >
const carto::rc_ptr<AVolume<T> > anatomist::AVolumeView< T >::view ( ) const
inline

Definition at line 63 of file volumeview.h.

◆ voxelSize()

template<typename T >
virtual std::vector<float> anatomist::AVolumeView< T >::voxelSize ( ) const
inlinevirtual

Returns at least 4 sizes. For 3D objects, returns (1, 1, 1, 1)

Reimplemented from anatomist::MObject.

Definition at line 76 of file volumeview.h.


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