cartodata 6.0.0
carto::Volume< T >::Position4Di Class Reference

#include <cartodata/volume/volumebase.h>

Inheritance diagram for carto::Volume< T >::Position4Di:
Collaboration diagram for carto::Volume< T >::Position4Di:

Public Types

enum  
 The most "basic" (and fastest) iterators: they go from the first voxel linerarly in memory, not taking care of offsets when in a Volume view. More...
 
typedef std::vector< int > Position
 
typedef T datatype
 Access to T type.
 
typedef blitz::Array< T, Volume< T >::DIM_MAX >::iterator iterator
 
typedef blitz::Array< T, Volume< T >::DIM_MAX >::const_iterator const_iterator
 
- Public Types inherited from carto::RCObject
typedef int RefCounterType
 

Public Member Functions

 Position4Di (int x=0, int y=0, int z=0, int t=0)
 
template<typename U>
 Position4Di (const U &other)
 Generic constructor from any "vector-like" object, i.e.
 
 Position4Di (const Position4Di &pos)
 
 ~Position4Di ()
 
int & operator[] (int coord)
 
const int & operator[] (int coord) const
 
bool operator== (const Position4Di &p) const
 
bool operator!= (const Position4Di &p) const
 
unsigned size () const
 
const std::vector< int > & toVector () const
 
 Volume (int sizeX=1, int sizeY=1, int sizeZ=1, int sizeT=1, const AllocatorContext &allocatorContext=AllocatorContext(), bool allocated=true)
 Volume construction and allocation.
 
 Volume (const Position4Di &size, const AllocatorContext &allocatorContext=AllocatorContext(), bool allocated=true)
 Volume construction and allocation: Position4Di version.
 
 Volume (int sizeX, int sizeY, int sizeZ, int sizeT, int bordersize, const AllocatorContext &allocatorContext=AllocatorContext(), bool allocated=true)
 Volume construction and allocation Same as the above constructor, but allows to specify a border size.
 
 Volume (const Position4Di &size, int bordersize, const AllocatorContext &allocatorContext=AllocatorContext(), bool allocated=true)
 Volume construction and allocation: Position4Di version Same as the above constructor, but allows to specify a border size.
 
 Volume (int sizeX, int sizeY, int sizeZ, int sizeT, const Position4Di &border, const AllocatorContext &allocatorContext=AllocatorContext(), bool allocated=true)
 Volume construction and allocation Same as the above constructor, but allows to specify a border size in each dimension.
 
 Volume (const Position4Di &size, const Position4Di &border, const AllocatorContext &allocatorContext=AllocatorContext(), bool allocated=true)
 Volume construction and allocation: Position4Di version Same as the above constructor, but allows to specify a border size in each dimension.
 
 Volume (const std::vector< int > &size, const AllocatorContext &allocatorContext=AllocatorContext(), bool allocated=true)
 Volume construction and allocation: std::vector version Same as the above constructor, but allows to specify a border size in each dimension.
 
 Volume (const std::vector< int > &size, const std::vector< int > &border, const AllocatorContext &allocatorContext=AllocatorContext(), bool allocated=true)
 Volume construction and allocation: std::vector version Same as the above constructor, but allows to specify a border size in each dimension.
 
 Volume (int sizeX, int sizeY, int sizeZ, int sizeT, T *buffer, const std::vector< long > *strides=0)
 This constructor builds a Volume on an already allocated buffer.
 
 Volume (const Position4Di &size, T *buffer, const std::vector< long > *strides=0)
 Position4Di version This constructor builds a Volume on an already allocated buffer.
 
 Volume (const std::vector< int > &size, T *buffer, const std::vector< long > *strides=0)
 
 Volume (rc_ptr< Volume< T > > other, const Position4Di &pos=Position4Di(0, 0, 0, 0), const Position4Di &size=Position4Di(-1, -1, -1, -1), const AllocatorContext &allocContext=AllocatorContext())
 This is the volume view constructor.
 
 Volume (rc_ptr< Volume< T > > other, const Position &pos, const Position &size=Position(), const AllocatorContext &allocContext=AllocatorContext())
 This is the volume view constructor.
 
 Volume (rc_ptr< Volume< T > > other, const Position &pos, const Position &size, T *buffer, const std::vector< long > &strides)
 This "very special" constructor should not be used in regular programs.
 
 Volume (const Volume< T > &other)
 Copy constructor The copy constructors actually duplicates data buffers.
 
virtual ~Volume ()
 
Volume< T > & operator= (const Volume< T > &other)
 
Volume< T > & operator= (const T &value)
 Copy operator.
 
iterator begin ()
 Iterators returned here are the most "basic" (and fastest) iterators: they go from the first voxel linerarly in memory, not taking care of offsets when in a Volume view.
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
const T & operator() (long x, long y=0, long z=0, long t=0) const
 Warning: this operator is not virtual, so may not have the expected result on inherited classes (see old VolumeView)
 
T & operator() (long x, long y=0, long z=0, long t=0)
 
const T & operator() (const Position4Di &position) const
 
T & operator() (const Position4Di &position)
 
const T & operator() (const std::vector< int > &position) const
 
T & operator() (const std::vector< int > &position)
 
const T & operator() (long x1, long x2, long x3, long x4, long x5, long x6=0, long x7=0, long x8=0) const
 
T & operator() (long x1, long x2, long x3, long x4, long x5, long x6=0, long x7=0, long x8=0)
 
const T & at (long x, long y=0, long z=0, long t=0) const
 
T & at (long x, long y=0, long z=0, long t=0)
 
const T & at (const Position4Di &position) const
 
T & at (const Position4Di &position)
 
const T & at (const std::vector< int > &) const
 
T & at (const std::vector< int > &)
 
const T & at (const blitz::TinyVector< int, 1 > &) const
 
T & at (const blitz::TinyVector< int, 1 > &)
 
const T & at (const blitz::TinyVector< int, 2 > &) const
 
T & at (const blitz::TinyVector< int, 2 > &)
 
const T & at (const blitz::TinyVector< int, 3 > &) const
 
T & at (const blitz::TinyVector< int, 3 > &)
 
const T & at (const blitz::TinyVector< int, 4 > &) const
 
T & at (const blitz::TinyVector< int, 4 > &)
 
const T & at (const blitz::TinyVector< int, Volume< T >::DIM_MAX > &) const
 
T & at (const blitz::TinyVector< int, Volume< T >::DIM_MAX > &)
 
blitz::Array< T, Volume< T >::DIM_MAXat (const blitz::RectDomain< Volume< T >::DIM_MAX > &subdomain) const
 
blitz::Array< T, Volume< T >::DIM_MAXat (const blitz::StridedDomain< Volume< T >::DIM_MAX > &subdomain) const
 
blitz::Array< T, Volume< T >::DIM_MAXat (const blitz::Range &r0) const
 
blitz::Array< T, Volume< T >::DIM_MAXat (const blitz::Range &r0, const blitz::Range &r1) const
 
blitz::Array< T, Volume< T >::DIM_MAXat (const blitz::Range &r0, const blitz::Range &r1, const blitz::Range &r2) const
 
blitz::Array< T, Volume< T >::DIM_MAXat (const blitz::Range &r0, const blitz::Range &r1, const blitz::Range &r2, const blitz::Range &r3) const
 
const T & at (long x1, long x2, long x3, long x4, long x5, long x6=0, long x7=0, long x8=0) const
 
T & at (long x1, long x2, long x3, long x4, long x5, long x6=0, long x7=0, long x8=0)
 
virtual void initialize ()
 Initializes header info.
 
const AllocatorContext & allocatorContext () const
 returns volume's AllocatorContext
 
void allocate ()
 This function is only useful in the particular context of an unallocated Volume, when the constructor has been used with the allocated flag to false.
 
virtual void reallocate (int sizeX=1, int sizeY=1, int sizeZ=1, int sizeT=1, bool keepcontents=false, const AllocatorContext &allocatorContext=AllocatorContext(), bool allocate=true, const std::vector< long > *strides=0)
 allows resizing and changing allocator
 
virtual void reallocate (const Position4Di &size, bool keepcontents=false, const AllocatorContext &allocatorContext=AllocatorContext(), bool allocate=true, const std::vector< long > *strides=0)
 
virtual void reallocate (const std::vector< int > &size, bool keepcontents=false, const AllocatorContext &allocatorContext=AllocatorContext(), bool allocate=true, const std::vector< long > *strides=0)
 
void allocateBorders (int bsx, int bsy=-1, int bsz=-1)
 reallocate the volume with given borders, keep (copy) the contents.
 
void allocateBorders (const std::vector< int > &border)
 reallocate the volume with given borders, keep (copy) the contents.
 
Volume< T > copy () const
 Create a volume of same dimension and copy the data.
 
Volume< OUTP > copy () const
 
Volume< T > deepcopy () const
 Copy the full data structure.
 
Volume< OUTP > deepcopy () const
 
Volume< T > copyStructure () const
 Copy the full data structure without copying the actual data.
 
Volume< OUTP > copyStructure () const
 Copy the full data structure without copying the actual data.
 
void copySubVolume (const Volume< T > &source, const std::vector< int > &pos=std::vector< int >())
 Copy voxels values from another volume.
 
void copySubVolume (const rc_ptr< Volume< T > > &source, const std::vector< int > &pos=std::vector< int >())
 Copy voxels values from another volume pos is the position into the destination (this) volume, and defaults to 0.
 
 operator Volume< OUTP > () const
 Cast to Volume of different datatype.
 
int getLevelsCount () const
 Get levels count in volume hierarchy from the current volume to the topmost volume.
 
int refLevel (const int level) const
 Transform a level index to a valid level index in the volume hierarchy.
 
rc_ptr< Volume< T > > refVolume () const
 Get parent volume.
 
rc_ptr< Volume< T > > refVolumeAtLevel (const int level) const
 Get parent volume at a specified level in volume hierarchy.
 
void setRefVolume (const rc_ptr< Volume< T > > &refvol)
 Set parent volume.
 
const PositionposInRefVolume () const
 Get position in parent volume.
 
Position posInRefVolumeAtLevel (const int level) const
 Get position relatively to parent volume at specified level.
 
void setPosInRefVolume (const Position4Di &pos)
 Set position in parent volume.
 
void setPosInRefVolume (const Position &pos)
 
std::vector< int > getBorders () const
 Get borders for the volume.
 
std::vector< long > getStrides () const
 Get strides for the volume.
 
 operator bool () const
 Implicit cast to bool returns all()
 
bool all () const
 True if all values compare to true.
 
bool any () const
 True if at least one value compares to true.
 
min () const
 
max () const
 
DataTypeTraits< T >::LongType sum () const
 To avoid overflow, the biggest possible type (intmax_t, uintmax_t, double...) is used for computation and returned.
 
void fill (const T &value)
 Fills the volume with a given value.
 
void fillBorder (const T &value)
 Fill border with a constant value.
 
const Referentialreferential () const
 Referential and orientation information.
 
Referentialreferential ()
 Referential and orientation information.
 
void flipToOrientation (const std::string &orient)
 Flip the volume to a given orientation.
 
void flipToOrientation (const std::string &orient, const std::string &force_memory_layout)
 Flip the volume to a given orientation.
 
Object reorientedHeader (const std::string &orient) const
 used by flipToOrientation(), reorient header information
 
std::vector< int > memoryLayoutOrientation () const
 determine the memory layout orientation from strides and current indices orientation.
 
std::vector< int > storageLayoutOrientation () const
 determine the storage (disk) layout orientation.
 
- Public Member Functions inherited from carto::VolumeProxy< T >
 VolumeProxy (int sizeX=1, int sizeY=1, int sizeZ=1, int sizeT=1)
 
 VolumeProxy (const std::vector< int > &size)
 
 VolumeProxy (const VolumeProxy< T > &other)
 
virtual ~VolumeProxy ()
 
int getSizeX () const
 
int getSizeY () const
 
int getSizeZ () const
 
int getSizeT () const
 
std::vector< int > getSize () const
 get the 4 dimensions in a vector
 
std::vector< float > getVoxelSize () const
 get the voxel size from the header, with 4 values defaulting to 1.mm if not present
 
void setVoxelSize (float vx, float vy=1., float vz=1., float vt=1.)
 
void setVoxelSize (const std::vector< float > &vs)
 
VolumeProxy< T > & operator= (const VolumeProxy< T > &other)
 
virtual void copyHeaderFrom (const PropertySet &other, bool stopOnError=true)
 copy properties from other to this, avoiding forbidden properties like size.
 
virtual void copyHeaderFrom (const Object &other, bool stopOnError=true)
 
- Public Member Functions inherited from carto::Headered
 Headered ()
 
 Headered (const Headered &other)
 
virtual ~Headered ()
 
Headeredoperator= (const Headered &other)
 
const PropertySetheader () const
 
PropertySetheader ()
 
void addPropertyFilter (const rc_ptr< PropertyFilter > &propertyFilter)
 
bool hasPropertyFilter (const std::string &propertyFilterName) const
 
bool connect (const std::string &propertyFilterName, const PropertyFilter::Slot &slot)
 
bool disconnect (const std::string &propertyFilterName, const PropertyFilter::Slot &slot)
 
std::set< rc_ptr< PropertyFilter > > getPropertyFilters (const std::string &propertyName) const
 
void delay ()
 
void flush ()
 
void blockSignals (bool)
 
bool signalsBlocked () const
 
std::string uuid ()
 
bool copyUuid (const PropertySet &)
 
bool copyUuid (const Headered &)
 
- Public Member Functions inherited from carto::RCObject
 RCObject ()
 
 RCObject (const RCObject &)
 
RCObjectoperator= (const RCObject &)
 
virtual ~RCObject ()
 
- Public Member Functions inherited from carto::Observer
virtual ~Observer ()
 

Static Public Member Functions

static std::vector< int > fixed_position (const std::vector< int > &vec)
 
static std::vector< int > fixed_size (const std::vector< int > &vec)
 
static unsigned long long size_num_elements (const std::vector< int > &vec)
 

Protected Member Functions

void allocate (int oldSizeX, int oldSizeY, int oldSizeZ, int oldSizeT, bool allocate, const AllocatorContext &allocatorContext, const std::vector< long > *strides=0)
 
void allocate (const std::vector< int > &oldSize, bool allocate, const AllocatorContext &allocatorContext, const std::vector< long > *strides=0)
 
void slotSizeChanged (const PropertyFilter &propertyFilter)
 
void updateItemsBuffer ()
 
void constructBorders (const Position &bordersize, const AllocatorContext &allocatorContext, bool allocated)
 
- Protected Member Functions inherited from carto::Observer
 Observer ()
 

Protected Attributes

AllocatedVector< T > _items
 
T * _start
 
blitz::Array< T, Volume< T >::DIM_MAX_blitz
 
rc_ptr< Volume< T > > _refvol
 
std::vector< int > _pos
 
Referential _referential
 
- Protected Attributes inherited from carto::VolumeProxy< T >
std::vector< int > _size
 

Detailed Description

template<typename T>
class carto::Volume< T >::Position4Di

Definition at line 593 of file volumebase.h.

Member Typedef Documentation

◆ const_iterator

typedef blitz::Array<T,Volume<T>::DIM_MAX>::const_iterator carto::Volume< T >::const_iterator

Definition at line 143 of file volumebase.h.

◆ datatype

typedef T carto::Volume< T >::datatype

Access to T type.

Definition at line 133 of file volumebase.h.

◆ iterator

typedef blitz::Array<T,Volume<T>::DIM_MAX>::iterator carto::Volume< T >::iterator

Definition at line 142 of file volumebase.h.

◆ Position

typedef std::vector<int> carto::Volume< T >::Position

Definition at line 130 of file volumebase.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

The most "basic" (and fastest) iterators: they go from the first voxel linerarly in memory, not taking care of offsets when in a Volume view.

Taking care of splitting loops line-by-line is the responsability of programmers using such

Definition at line 141 of file volumebase.h.

Constructor & Destructor Documentation

◆ Position4Di() [1/3]

template<typename T>
carto::Volume< T >::Position4Di::Position4Di ( int x = 0,
int y = 0,
int z = 0,
int t = 0 )
inlineexplicit

Definition at line 596 of file volumebase.h.

Referenced by operator!=(), operator==(), and Position4Di().

◆ Position4Di() [2/3]

template<typename T>
template<typename U>
carto::Volume< T >::Position4Di::Position4Di ( const U & other)
inline

Generic constructor from any "vector-like" object, i.e.

that has a size() method and the [] accessor.

It is not explicit to allow implicit conversion.

Definition at line 610 of file volumebase.h.

◆ Position4Di() [3/3]

template<typename T>
carto::Volume< T >::Position4Di::Position4Di ( const Position4Di & pos)
inline

Definition at line 619 of file volumebase.h.

References Position4Di().

◆ ~Position4Di()

template<typename T>
carto::Volume< T >::Position4Di::~Position4Di ( )
inline

Definition at line 623 of file volumebase.h.

◆ ~Volume()

carto::Volume< T >::~Volume ( )
virtual

Definition at line 264 of file volumebase_d.h.

Member Function Documentation

◆ all()

bool carto::Volume< T >::all ( ) const
inline

True if all values compare to true.

Definition at line 475 of file volumebase_d_operators.h.

◆ allocate() [1/3]

void carto::Volume< T >::allocate ( )

This function is only useful in the particular context of an unallocated Volume, when the constructor has been used with the allocated flag to false.

Calling allocate() afterwards will actually allocate the memory. Otherwise it will do nothing.

Definition at line 349 of file volumebase_d.h.

◆ allocate() [2/3]

void carto::Volume< T >::allocate ( const std::vector< int > & oldSize,
bool allocate,
const AllocatorContext & allocatorContext,
const std::vector< long > * strides = 0 )
protected

Definition at line 570 of file volumebase_d.h.

◆ allocate() [3/3]

void carto::Volume< T >::allocate ( int oldSizeX,
int oldSizeY,
int oldSizeZ,
int oldSizeT,
bool allocate,
const AllocatorContext & allocatorContext,
const std::vector< long > * strides = 0 )
protected

Definition at line 567 of file volumebase_d.h.

◆ allocateBorders() [1/2]

void carto::Volume< T >::allocateBorders ( const std::vector< int > & border)

reallocate the volume with given borders, keep (copy) the contents.

only 1 value is mandatory.

Definition at line 370 of file volumebase_d.h.

◆ allocateBorders() [2/2]

void carto::Volume< T >::allocateBorders ( int bsx,
int bsy = -1,
int bsz = -1 )

reallocate the volume with given borders, keep (copy) the contents.

Definition at line 367 of file volumebase_d.h.

◆ allocatorContext()

const AllocatorContext & carto::Volume< T >::allocatorContext ( ) const
inline

returns volume's AllocatorContext

Definition at line 343 of file volumebase_d.h.

◆ any()

bool carto::Volume< T >::any ( ) const
inline

True if at least one value compares to true.

Definition at line 477 of file volumebase_d_operators.h.

◆ at() [1/24]

blitz::Array< T, Volume< T >::DIM_MAX > carto::Volume< T >::at ( const blitz::Range & r0) const
inline

Definition at line 316 of file volumebase_d_inline.h.

◆ at() [2/24]

blitz::Array< T, Volume< T >::DIM_MAX > carto::Volume< T >::at ( const blitz::Range & r0,
const blitz::Range & r1 ) const
inline

Definition at line 317 of file volumebase_d_inline.h.

◆ at() [3/24]

blitz::Array< T, Volume< T >::DIM_MAX > carto::Volume< T >::at ( const blitz::Range & r0,
const blitz::Range & r1,
const blitz::Range & r2 ) const
inline

Definition at line 319 of file volumebase_d_inline.h.

◆ at() [4/24]

blitz::Array< T, Volume< T >::DIM_MAX > carto::Volume< T >::at ( const blitz::Range & r0,
const blitz::Range & r1,
const blitz::Range & r2,
const blitz::Range & r3 ) const
inline

Definition at line 322 of file volumebase_d_inline.h.

◆ at() [5/24]

blitz::Array< T, Volume< T >::DIM_MAX > carto::Volume< T >::at ( const blitz::RectDomain< Volume< T >::DIM_MAX > & subdomain) const
inline

Definition at line 312 of file volumebase_d_inline.h.

◆ at() [6/24]

blitz::Array< T, Volume< T >::DIM_MAX > carto::Volume< T >::at ( const blitz::StridedDomain< Volume< T >::DIM_MAX > & subdomain) const
inline

Definition at line 314 of file volumebase_d_inline.h.

◆ at() [7/24]

T & carto::Volume< T >::at ( const blitz::TinyVector< int, 1 > & index)
inline

Definition at line 303 of file volumebase_d_inline.h.

◆ at() [8/24]

const T & carto::Volume< T >::at ( const blitz::TinyVector< int, 1 > & index) const
inline

Definition at line 302 of file volumebase_d_inline.h.

◆ at() [9/24]

T & carto::Volume< T >::at ( const blitz::TinyVector< int, 2 > & index)
inline

Definition at line 305 of file volumebase_d_inline.h.

◆ at() [10/24]

const T & carto::Volume< T >::at ( const blitz::TinyVector< int, 2 > & index) const
inline

Definition at line 304 of file volumebase_d_inline.h.

◆ at() [11/24]

T & carto::Volume< T >::at ( const blitz::TinyVector< int, 3 > & index)
inline

Definition at line 307 of file volumebase_d_inline.h.

◆ at() [12/24]

const T & carto::Volume< T >::at ( const blitz::TinyVector< int, 3 > & index) const
inline

Definition at line 306 of file volumebase_d_inline.h.

◆ at() [13/24]

T & carto::Volume< T >::at ( const blitz::TinyVector< int, 4 > & index)
inline

Definition at line 309 of file volumebase_d_inline.h.

◆ at() [14/24]

const T & carto::Volume< T >::at ( const blitz::TinyVector< int, 4 > & index) const
inline

Definition at line 308 of file volumebase_d_inline.h.

◆ at() [15/24]

T & carto::Volume< T >::at ( const blitz::TinyVector< int, Volume< T >::DIM_MAX > & index)
inline

Definition at line 311 of file volumebase_d_inline.h.

◆ at() [16/24]

const T & carto::Volume< T >::at ( const blitz::TinyVector< int, Volume< T >::DIM_MAX > & index) const
inline

Definition at line 310 of file volumebase_d_inline.h.

◆ at() [17/24]

T & carto::Volume< T >::at ( const Position4Di & position)
inline

Definition at line 296 of file volumebase_d_inline.h.

◆ at() [18/24]

const T & carto::Volume< T >::at ( const Position4Di & position) const
inline

Definition at line 295 of file volumebase_d_inline.h.

◆ at() [19/24]

T & carto::Volume< T >::at ( const std::vector< int > & index)
inline

Definition at line 298 of file volumebase_d_inline.h.

◆ at() [20/24]

const T & carto::Volume< T >::at ( const std::vector< int > & index) const
inline

Definition at line 297 of file volumebase_d_inline.h.

◆ at() [21/24]

T & carto::Volume< T >::at ( long x,
long y = 0,
long z = 0,
long t = 0 )
inline

Definition at line 292 of file volumebase_d_inline.h.

◆ at() [22/24]

const T & carto::Volume< T >::at ( long x,
long y = 0,
long z = 0,
long t = 0 ) const
inline

Definition at line 291 of file volumebase_d_inline.h.

◆ at() [23/24]

T & carto::Volume< T >::at ( long x1,
long x2,
long x3,
long x4,
long x5,
long x6 = 0,
long x7 = 0,
long x8 = 0 )
inline

Definition at line 329 of file volumebase_d_inline.h.

◆ at() [24/24]

const T & carto::Volume< T >::at ( long x1,
long x2,
long x3,
long x4,
long x5,
long x6 = 0,
long x7 = 0,
long x8 = 0 ) const
inline

Definition at line 327 of file volumebase_d_inline.h.

◆ begin() [1/2]

Volume< T >::iterator carto::Volume< T >::begin ( )

Iterators returned here are the most "basic" (and fastest) iterators: they go from the first voxel linerarly in memory, not taking care of offsets when in a Volume view.

Taking care of splitting loops line-by-line is the responsability of programmers using such iterators.

Definition at line 277 of file volumebase_d.h.

◆ begin() [2/2]

Volume< T >::const_iterator carto::Volume< T >::begin ( ) const

Definition at line 279 of file volumebase_d.h.

◆ constructBorders()

void carto::Volume< T >::constructBorders ( const Position & bordersize,
const AllocatorContext & allocatorContext,
bool allocated )
protected

Definition at line 576 of file volumebase_d.h.

Referenced by carto::Position4Di< T >::Volume().

◆ copy() [1/2]

Volume< T > carto::Volume< T >::copy ( ) const
inline

Create a volume of same dimension and copy the data.

This method does not deal with the underlying view structures, so borders or parent volumes are not copied or transfered.

Definition at line 379 of file volumebase_d_operators.h.

◆ copy() [2/2]

Volume< OUTP > carto::Volume< T >::copy ( ) const
inline

Definition at line 381 of file volumebase_d_operators.h.

◆ copyStructure() [1/2]

Volume< T > carto::Volume< T >::copyStructure ( ) const
inline

Copy the full data structure without copying the actual data.

Definition at line 389 of file volumebase_d_operators.h.

◆ copyStructure() [2/2]

Volume< OUTP > carto::Volume< T >::copyStructure ( ) const
inline

Copy the full data structure without copying the actual data.

Definition at line 392 of file volumebase_d_operators.h.

◆ copySubVolume() [1/2]

void carto::Volume< T >::copySubVolume ( const rc_ptr< Volume< T > > & source,
const std::vector< int > & pos = std::vector<int>() )

Copy voxels values from another volume pos is the position into the destination (this) volume, and defaults to 0.

Contrarily to the = operator, the destination (this) volume is not reallocated or reshaped, and its header is left unchanged.

Definition at line 406 of file volumebase_d.h.

◆ copySubVolume() [2/2]

void carto::Volume< T >::copySubVolume ( const Volume< T > & source,
const std::vector< int > & pos = std::vector<int>() )

Copy voxels values from another volume.

pos is the position into the destination (this) volume, and defaults to 0. Contrarily to the = operator, the destination (this) volume is not reallocated or reshaped, and its header is left unchanged.

Definition at line 399 of file volumebase_d.h.

◆ deepcopy() [1/2]

Volume< T > carto::Volume< T >::deepcopy ( ) const
inline

Copy the full data structure.

This is similar to what the copy constructor does.

Definition at line 384 of file volumebase_d_operators.h.

◆ deepcopy() [2/2]

Volume< OUTP > carto::Volume< T >::deepcopy ( ) const
inline

Definition at line 386 of file volumebase_d_operators.h.

◆ end() [1/2]

Volume< T >::iterator carto::Volume< T >::end ( )

Definition at line 278 of file volumebase_d.h.

◆ end() [2/2]

Volume< T >::const_iterator carto::Volume< T >::end ( ) const

Definition at line 280 of file volumebase_d.h.

◆ fill()

void carto::Volume< T >::fill ( const T & value)
inline

Fills the volume with a given value.

Definition at line 488 of file volumebase_d_operators.h.

◆ fillBorder()

void carto::Volume< T >::fillBorder ( const T & value)
inline

Fill border with a constant value.

Fill borders with a constant value.

More precisely, fill the surrounding of the volume view in the reference volume (if any) using the given value.

Definition at line 494 of file volumebase_d_operators.h.

◆ fixed_position()

template<typename T>
static std::vector< int > carto::Volume< T >::Position4Di::fixed_position ( const std::vector< int > & vec)
inlinestatic

Definition at line 641 of file volumebase.h.

◆ fixed_size()

template<typename T>
static std::vector< int > carto::Volume< T >::Position4Di::fixed_size ( const std::vector< int > & vec)
inlinestatic

Definition at line 652 of file volumebase.h.

◆ flipToOrientation() [1/2]

void carto::Volume< T >::flipToOrientation ( const std::string & orient)

Flip the volume to a given orientation.

The volume voxels will be reordered to match the given orientation. Using this method, only the strides will be changed, and the data block will remain preserverd. This is different with the other flipToOrientation() method and the additional force_memory_layout argument.

Orientation is given as a 3 char string: "LPI" (the default orientation in AIMS), "RAS", and combinations of these 6 letters. See https://brainvisa.info/aimsdata/user_doc/coordinates_systems.html and http://www.grahamwideman.com/gw/brain/orientation/orientterms.htm.

Definition at line 530 of file volumebase_d.h.

◆ flipToOrientation() [2/2]

void carto::Volume< T >::flipToOrientation ( const std::string & orient,
const std::string & force_memory_layout )

Flip the volume to a given orientation.

The volume voxels will be reordered to match the given orientation. Contrarily to the other flipToOrientation method, the voxels data block will be reallocated and flipped to match the given orientation. It is also given as a 3 char string, thus it may specify a different memory layout from the one used for indices.

Definition at line 539 of file volumebase_d.h.

◆ getBorders()

std::vector< int > carto::Volume< T >::getBorders ( ) const
inline

Get borders for the volume.

A volume that can have borders is a volume
that references another volume. It can be understood as a view in the reference volume.

Returns
std::vector<uint16_t> that contains the borders availables for the volume. vector[0]: low border in x direction vector[1]: high border in x direction vector[2]: low border in y direction vector[3]: high border in y direction vector[4]: low border in z direction vector[5]: high border in z direction vector[6]: low border in t direction vector[7]: high border in t direction

Definition at line 462 of file volumebase_d.h.

◆ getLevelsCount()

int carto::Volume< T >::getLevelsCount ( ) const
inline

Get levels count in volume hierarchy from the current volume to the topmost volume.

Definition at line 415 of file volumebase_d.h.

◆ getStrides()

std::vector< long > carto::Volume< T >::getStrides ( ) const
inline

Get strides for the volume.

Strides contain the number of voxels for
each dimension including.

Definition at line 466 of file volumebase_d.h.

◆ initialize()

void carto::Volume< T >::initialize ( )
virtual

Initializes header info.

Reimplemented from carto::Headered.

Definition at line 341 of file volumebase_d.h.

◆ max()

T carto::Volume< T >::max ( ) const
inline

Definition at line 479 of file volumebase_d_operators.h.

◆ memoryLayoutOrientation()

std::vector< int > carto::Volume< T >::memoryLayoutOrientation ( ) const

determine the memory layout orientation from strides and current indices orientation.

Use volume.referential().orientationStr(volume.memoryLayoutOrientation()) to get a more readable string description.

Definition at line 550 of file volumebase_d.h.

◆ min()

T carto::Volume< T >::min ( ) const
inline

Definition at line 478 of file volumebase_d_operators.h.

◆ operator bool()

carto::Volume< T >::operator bool ( ) const
inline

Implicit cast to bool returns all()

Definition at line 473 of file volumebase_d_operators.h.

◆ operator Volume< OUTP >()

carto::Volume< T >::operator Volume< OUTP > ( ) const
inline

Cast to Volume of different datatype.

Definition at line 411 of file volumebase_d_operators.h.

◆ operator!=()

template<typename T>
bool carto::Volume< T >::Position4Di::operator!= ( const Position4Di & p) const
inline

Definition at line 632 of file volumebase.h.

References carto::operator==(), and Position4Di().

◆ operator()() [1/8]

T & carto::Volume< T >::operator() ( const Position4Di & position)
inline

Definition at line 294 of file volumebase_d_inline.h.

◆ operator()() [2/8]

const T & carto::Volume< T >::operator() ( const Position4Di & position) const
inline

Definition at line 293 of file volumebase_d_inline.h.

◆ operator()() [3/8]

T & carto::Volume< T >::operator() ( const std::vector< int > & position)
inline

Definition at line 300 of file volumebase_d_inline.h.

◆ operator()() [4/8]

const T & carto::Volume< T >::operator() ( const std::vector< int > & position) const
inline

Definition at line 299 of file volumebase_d_inline.h.

◆ operator()() [5/8]

T & carto::Volume< T >::operator() ( long x,
long y = 0,
long z = 0,
long t = 0 )
inline

Definition at line 290 of file volumebase_d_inline.h.

◆ operator()() [6/8]

const T & carto::Volume< T >::operator() ( long x,
long y = 0,
long z = 0,
long t = 0 ) const
inline

Warning: this operator is not virtual, so may not have the expected result on inherited classes (see old VolumeView)

Definition at line 288 of file volumebase_d_inline.h.

◆ operator()() [7/8]

T & carto::Volume< T >::operator() ( long x1,
long x2,
long x3,
long x4,
long x5,
long x6 = 0,
long x7 = 0,
long x8 = 0 )
inline

Definition at line 333 of file volumebase_d_inline.h.

◆ operator()() [8/8]

const T & carto::Volume< T >::operator() ( long x1,
long x2,
long x3,
long x4,
long x5,
long x6 = 0,
long x7 = 0,
long x8 = 0 ) const
inline

Definition at line 331 of file volumebase_d_inline.h.

◆ operator=() [1/2]

Volume< T > & carto::Volume< T >::operator= ( const T & value)
inline

Copy operator.

Care should be taken regarding the behavior of the copy operator: depending on the allocation mode of the copied volume, and whether it is a view into another volume, different behaviors will be achieved:

  • if "value" is a "regular" volume, then a full copy is performed: if "this" is modified later, "value" will not be changed.
  • if "value" is a view into a larger volume (its volumeRef() is not null, and its own data buffer is not actually allocated), then the copied object, "this", will be another view into the same volume, thus resulting in a shallow copy. If "this" is modified later, both "value " and the reference volume from which the view is taken, will be modified.

Definition at line 515 of file volumebase_d_operators.h.

◆ operator=() [2/2]

Volume< T > & carto::Volume< T >::operator= ( const Volume< T > & other)

Definition at line 266 of file volumebase_d.h.

◆ operator==()

template<typename T>
bool carto::Volume< T >::Position4Di::operator== ( const Position4Di & p) const
inline

Definition at line 628 of file volumebase.h.

References Position4Di().

◆ operator[]() [1/2]

template<typename T>
int & carto::Volume< T >::Position4Di::operator[] ( int coord)
inline

Definition at line 625 of file volumebase.h.

◆ operator[]() [2/2]

template<typename T>
const int & carto::Volume< T >::Position4Di::operator[] ( int coord) const
inline

Definition at line 626 of file volumebase.h.

◆ posInRefVolume()

const Volume< T >::Position & carto::Volume< T >::posInRefVolume ( ) const
inline

Get position in parent volume.

Definition at line 442 of file volumebase_d.h.

◆ posInRefVolumeAtLevel()

Volume< T >::Position carto::Volume< T >::posInRefVolumeAtLevel ( const int level) const
inline

Get position relatively to parent volume at specified level.

Definition at line 444 of file volumebase_d.h.

◆ reallocate() [1/3]

void carto::Volume< T >::reallocate ( const Position4Di & size,
bool keepcontents = false,
const AllocatorContext & allocatorContext = AllocatorContext(),
bool allocate = true,
const std::vector< long > * strides = 0 )
virtual

Definition at line 356 of file volumebase_d.h.

◆ reallocate() [2/3]

void carto::Volume< T >::reallocate ( const std::vector< int > & size,
bool keepcontents = false,
const AllocatorContext & allocatorContext = AllocatorContext(),
bool allocate = true,
const std::vector< long > * strides = 0 )
virtual

Definition at line 361 of file volumebase_d.h.

◆ reallocate() [3/3]

void carto::Volume< T >::reallocate ( int sizeX = 1,
int sizeY = 1,
int sizeZ = 1,
int sizeT = 1,
bool keepcontents = false,
const AllocatorContext & allocatorContext = AllocatorContext(),
bool allocate = true,
const std::vector< long > * strides = 0 )
virtual

allows resizing and changing allocator

Definition at line 351 of file volumebase_d.h.

◆ referential() [1/2]

Referential & carto::Volume< T >::referential ( )

Referential and orientation information.

Definition at line 499 of file volumebase_d_inline.h.

◆ referential() [2/2]

const Referential & carto::Volume< T >::referential ( ) const

Referential and orientation information.

Definition at line 497 of file volumebase_d_inline.h.

◆ refLevel()

int carto::Volume< T >::refLevel ( const int level) const
inline

Transform a level index to a valid level index in the volume hierarchy.

The current volume has level 0, parent volume as level 1, ... Level can also be a negative index from topmost volume. -1 is topmost volume, -2 is the the child volume below topmost volume.

Definition at line 421 of file volumebase_d.h.

◆ refVolume()

rc_ptr< Volume< T > > carto::Volume< T >::refVolume ( ) const
inline

Get parent volume.

Note
refVolume() returns a rc_ptr<Volume> and not a VolumeRef. Because arithmetic operators are only defined for Volume and VolumeRef objects, this result must be converted to a VolumeRef to be used in arithmetic operations.

Definition at line 429 of file volumebase_d.h.

◆ refVolumeAtLevel()

rc_ptr< Volume< T > > carto::Volume< T >::refVolumeAtLevel ( const int level) const
inline

Get parent volume at a specified level in volume hierarchy.

Note
refVolumeAtLevel() returns a rc_ptr<Volume> and not a VolumeRef. Because arithmetic operators are only defined for Volume and VolumeRef objects, this result must be converted to a VolumeRef to be used in arithmetic operations.

Definition at line 437 of file volumebase_d.h.

◆ reorientedHeader()

Object carto::Volume< T >::reorientedHeader ( const std::string & orient) const

used by flipToOrientation(), reorient header information

Definition at line 542 of file volumebase_d.h.

◆ setPosInRefVolume() [1/2]

void carto::Volume< T >::setPosInRefVolume ( const Position & pos)
inline

Definition at line 448 of file volumebase_d.h.

◆ setPosInRefVolume() [2/2]

void carto::Volume< T >::setPosInRefVolume ( const Position4Di & pos)
inline

Set position in parent volume.

Definition at line 447 of file volumebase_d.h.

◆ setRefVolume()

void carto::Volume< T >::setRefVolume ( const rc_ptr< Volume< T > > & refvol)
inline

Set parent volume.

Definition at line 440 of file volumebase_d.h.

◆ size()

template<typename T>
unsigned carto::Volume< T >::Position4Di::size ( ) const
inline

Definition at line 635 of file volumebase.h.

◆ size_num_elements()

template<typename T>
static unsigned long long carto::Volume< T >::Position4Di::size_num_elements ( const std::vector< int > & vec)
inlinestatic

Definition at line 663 of file volumebase.h.

◆ slotSizeChanged()

void carto::Volume< T >::slotSizeChanged ( const PropertyFilter & propertyFilter)
protected

Definition at line 573 of file volumebase_d.h.

◆ storageLayoutOrientation()

std::vector< int > carto::Volume< T >::storageLayoutOrientation ( ) const

determine the storage (disk) layout orientation.

The storage orientation is optionnally stored int the header "storage_to_memory" matrix. If not, the storage orientation is undefined.

Use volume.referential().orientationStr(volume.storageLayoutOrientation()) to get a more readable string description.

Definition at line 561 of file volumebase_d.h.

◆ sum()

DataTypeTraits< T >::LongType carto::Volume< T >::sum ( ) const
inline

To avoid overflow, the biggest possible type (intmax_t, uintmax_t, double...) is used for computation and returned.

Definition at line 482 of file volumebase_d_operators.h.

◆ toVector()

template<typename T>
const std::vector< int > & carto::Volume< T >::Position4Di::toVector ( ) const
inline

◆ updateItemsBuffer()

void carto::Volume< T >::updateItemsBuffer ( )
inlineprotected

Definition at line 574 of file volumebase_d.h.

◆ Volume() [1/15]

carto::Volume< T >::Volume ( const Position4Di & size,
const AllocatorContext & allocatorContext = AllocatorContext(),
bool allocated = true )
explicit

Volume construction and allocation: Position4Di version.

Parameters
sizenumber of voxels in each dimension
allocatorContextinformation about how to allocate the volume: it can be a bit complex to do really optimal things, but the default value (default constructor of AllocatorContext) is OK in most cases.
allocatednormally left to true, it can exceptionnally be set to false for "virtual" volumes that must not be actually allocated but are only sources for a view Volume.

Definition at line 172 of file volumebase_d.h.

◆ Volume() [2/15]

carto::Volume< T >::Volume ( const Position4Di & size,
const Position4Di & border,
const AllocatorContext & allocatorContext = AllocatorContext(),
bool allocated = true )
explicit

Volume construction and allocation: Position4Di version Same as the above constructor, but allows to specify a border size in each dimension.

Definition at line 204 of file volumebase_d.h.

◆ Volume() [3/15]

carto::Volume< T >::Volume ( const Position4Di & size,
int bordersize,
const AllocatorContext & allocatorContext = AllocatorContext(),
bool allocated = true )
explicit

Volume construction and allocation: Position4Di version Same as the above constructor, but allows to specify a border size.

Border is handled as a larger volume, with a view in it. The current volume is this view.

Definition at line 189 of file volumebase_d.h.

◆ Volume() [4/15]

carto::Volume< T >::Volume ( const Position4Di & size,
T * buffer,
const std::vector< long > * strides = 0 )

Position4Di version This constructor builds a Volume on an already allocated buffer.

The Volume is not owner of the underlying data.

Definition at line 231 of file volumebase_d.h.

◆ Volume() [5/15]

carto::Volume< T >::Volume ( const std::vector< int > & size,
const AllocatorContext & allocatorContext = AllocatorContext(),
bool allocated = true )
explicit

Volume construction and allocation: std::vector version Same as the above constructor, but allows to specify a border size in each dimension.

Definition at line 212 of file volumebase_d.h.

◆ Volume() [6/15]

carto::Volume< T >::Volume ( const std::vector< int > & size,
const std::vector< int > & border,
const AllocatorContext & allocatorContext = AllocatorContext(),
bool allocated = true )
explicit

Volume construction and allocation: std::vector version Same as the above constructor, but allows to specify a border size in each dimension.

Definition at line 219 of file volumebase_d.h.

◆ Volume() [7/15]

carto::Volume< T >::Volume ( const std::vector< int > & size,
T * buffer,
const std::vector< long > * strides = 0 )

Definition at line 233 of file volumebase_d.h.

◆ Volume() [8/15]

carto::Volume< T >::Volume ( const Volume< T > & other)

Copy constructor The copy constructors actually duplicates data buffers.

In the case of a volume view, the underlying volume is also duplicated, so the new volume will be a view in a new duplicate bigger volume.

Definition at line 263 of file volumebase_d.h.

◆ Volume() [9/15]

carto::Volume< T >::Volume ( int sizeX,
int sizeY,
int sizeZ,
int sizeT,
const Position4Di & border,
const AllocatorContext & allocatorContext = AllocatorContext(),
bool allocated = true )
explicit

Volume construction and allocation Same as the above constructor, but allows to specify a border size in each dimension.

Definition at line 196 of file volumebase_d.h.

◆ Volume() [10/15]

carto::Volume< T >::Volume ( int sizeX,
int sizeY,
int sizeZ,
int sizeT,
int bordersize,
const AllocatorContext & allocatorContext = AllocatorContext(),
bool allocated = true )
explicit

Volume construction and allocation Same as the above constructor, but allows to specify a border size.

Border is handled as a larger volume, with a view in it. The current volume is this view.

Definition at line 180 of file volumebase_d.h.

◆ Volume() [11/15]

carto::Volume< T >::Volume ( int sizeX,
int sizeY,
int sizeZ,
int sizeT,
T * buffer,
const std::vector< long > * strides = 0 )

This constructor builds a Volume on an already allocated buffer.

The Volume is not owner of the underlying data.

Definition at line 226 of file volumebase_d.h.

◆ Volume() [12/15]

carto::Volume< T >::Volume ( int sizeX = 1,
int sizeY = 1,
int sizeZ = 1,
int sizeT = 1,
const AllocatorContext & allocatorContext = AllocatorContext(),
bool allocated = true )
explicit

Volume construction and allocation.

Parameters
sizeXnumber of voxels
sizeYnumber of voxels
sizeZnumber of voxels
sizeTnumber of voxels
allocatorContextinformation about how to allocate the volume: it can be a bit complex to do really optimal things, but the default value (default constructor of AllocatorContext) is OK in most cases.
allocatednormally left to true, it can exceptionnally be set to false for "virtual" volumes that must not be actually allocated but are only sources for a view Volume.

Definition at line 159 of file volumebase_d.h.

◆ Volume() [13/15]

carto::Volume< T >::Volume ( rc_ptr< Volume< T > > other,
const Position & pos,
const Position & size,
T * buffer,
const std::vector< long > & strides )

This "very special" constructor should not be used in regular programs.

It is meant for the IO system to map file views into memory views.

Definition at line 255 of file volumebase_d.h.

◆ Volume() [14/15]

carto::Volume< T >::Volume ( rc_ptr< Volume< T > > other,
const Position & pos,
const Position & size = Position(),
const AllocatorContext & allocContext = AllocatorContext() )
inline

This is the volume view constructor.

Beware not to mix it up with the copy constructor ( it takes a pointer to volume instead of a volume ) If parent volume is allocated, view points to its data and doesn't own it. Else, it allocates size and owns it.

Definition at line 249 of file volumebase_d.h.

◆ Volume() [15/15]

carto::Volume< T >::Volume ( rc_ptr< Volume< T > > other,
const Position4Di & pos = Position4Di( 0, 0, 0, 0 ),
const Position4Di & size = Position4Di( -1, -1, -1, -1 ),
const AllocatorContext & allocContext = AllocatorContext() )
inline

This is the volume view constructor.

Beware not to mix it up with the copy constructor ( it takes a pointer to volume instead of a volume ) If parent volume is allocated, view points to its data and doesn't own it. Else, it allocates size and owns it.

Definition at line 240 of file volumebase_d.h.

Member Data Documentation

◆ _blitz

blitz::Array<T, Volume<T>::DIM_MAX> carto::Volume< T >::_blitz
protected

Definition at line 583 of file volumebase.h.

◆ _items

AllocatedVector<T> carto::Volume< T >::_items
protected

Definition at line 580 of file volumebase.h.

◆ _pos

std::vector<int> carto::Volume< T >::_pos
protected

Definition at line 585 of file volumebase.h.

◆ _referential

Referential carto::Volume< T >::_referential
protected

Definition at line 586 of file volumebase.h.

◆ _refvol

rc_ptr<Volume<T> > carto::Volume< T >::_refvol
protected

Definition at line 584 of file volumebase.h.

◆ _start

T* carto::Volume< T >::_start
protected

Definition at line 582 of file volumebase.h.


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