|
cartodata 6.0.0
|
N-D Volume main class. More...
#include <cartodata/volume/volumebase.h>


Classes | |
| class | Position4Di |
Public Types | |
| enum | { DIM_MAX = 8 } |
| 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 | |
| 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) |
| 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. | |
| iterator | end () |
| const_iterator | begin () const |
| 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 & | 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 & | operator() (const Position4Di &position) const |
| T & | operator() (const Position4Di &position) |
| 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 & | operator() (const std::vector< int > &position) const |
| T & | operator() (const std::vector< int > &position) |
| 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_MAX > | at (const blitz::RectDomain< Volume< T >::DIM_MAX > &subdomain) const |
| blitz::Array< T, Volume< T >::DIM_MAX > | at (const blitz::StridedDomain< Volume< T >::DIM_MAX > &subdomain) const |
| blitz::Array< T, Volume< T >::DIM_MAX > | at (const blitz::Range &r0) const |
| blitz::Array< T, Volume< T >::DIM_MAX > | at (const blitz::Range &r0, const blitz::Range &r1) const |
| blitz::Array< T, Volume< T >::DIM_MAX > | at (const blitz::Range &r0, const blitz::Range &r1, const blitz::Range &r2) const |
| blitz::Array< T, Volume< T >::DIM_MAX > | at (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) |
| 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) |
| 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. | |
| template<typename OUTP> | |
| Volume< OUTP > | copy () const |
| Volume< T > | deepcopy () const |
| Copy the full data structure. | |
| template<typename OUTP> | |
| Volume< OUTP > | deepcopy () const |
| Volume< T > | copyStructure () const |
| Copy the full data structure without copying the actual data. | |
| template<typename OUTP> | |
| 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. | |
| template<typename OUTP> | |
| 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 Position & | posInRefVolume () 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. | |
| T | min () const |
| T | 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 Referential & | referential () const |
| Referential and orientation information. | |
| Referential & | referential () |
| Referential and orientation information. | |
| Volume< T > & | operator= (const T &value) |
| Copy operator. | |
| 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 () |
| Headered & | operator= (const Headered &other) |
| const PropertySet & | header () const |
| PropertySet & | header () |
| 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 &) | |
| RCObject & | operator= (const RCObject &) |
| virtual | ~RCObject () |
Public Member Functions inherited from carto::Observer | |
| virtual | ~Observer () |
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 |
N-D Volume main class.
Since 2013 release (version 4.4), Volume and VolumeView are merged into a singleclass. Every Volume can be a view into an other volume. If it is not, its parent volume is NULL. This allows to deal the same way with classic volumes, volumes with borders or partially read volumes.
Volumes should generally be used via reference-counting pointers (rc_ptr): there is a (slightly) specialized rc_ptr for Volume subclasses: VolumeRef.
Since 2016 release (version 4.5), comparison and arithmetic operators are specialized and shipped in volume.h. They can be used as long as the same operation between contained types is well defined. Several helper method (member and non member) are also included.
In version 4.6 Volume has extended support from 4D to N-D, still limited to a fixed max number of dimensions at compilation time (normally set to 8).
Iterating on volumes is described in Iterating over volumes
To use Volume classes on "standard" types (numeric types, on which the Volume class has already been compiled in the libraries), just include <cartodata/volume/volume.h>. If you need to use them on other non-standard types (if you get a link error about missing symbols), you will need to recompile the Volume template class on these types: in this case you should include <cartodata/volume/volume_d.h> and force the compilation:
This should be done only once (in one source file) for each type.
Definition at line 119 of file volumebase.h.
| typedef blitz::Array<T,Volume<T>::DIM_MAX>::const_iterator carto::Volume< T >::const_iterator |
Definition at line 143 of file volumebase.h.
| typedef T carto::Volume< T >::datatype |
Access to T type.
Definition at line 133 of file volumebase.h.
| typedef blitz::Array<T,Volume<T>::DIM_MAX>::iterator carto::Volume< T >::iterator |
Definition at line 142 of file volumebase.h.
| typedef std::vector<int> carto::Volume< T >::Position |
Definition at line 130 of file volumebase.h.
| 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
| Enumerator | |
|---|---|
| DIM_MAX | |
Definition at line 141 of file volumebase.h.
|
explicit |
Volume construction and allocation.
| sizeX | number of voxels |
| sizeY | number of voxels |
| sizeZ | number of voxels |
| sizeT | number of voxels |
| allocatorContext | information 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. |
| allocated | normally 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 72 of file volumebase_d.h.
References _items, _pos, _referential, _start, carto::PropertySet::addBuiltinProperty(), allocate(), allocatorContext(), carto::Headered::header(), and carto::VolumeProxy< T >::VolumeProxy().
Referenced by allocateBorders(), constructBorders(), copy(), copyStructure(), copySubVolume(), copySubVolume(), deepcopy(), getLevelsCount(), operator bool(), operator Volume< OUTP >(), operator=(), operator=(), posInRefVolumeAtLevel(), refVolumeAtLevel(), setRefVolume(), Volume(), Volume(), Volume(), and Volume().
|
explicit |
Volume construction and allocation: Position4Di version.
| size | number of voxels in each dimension |
| allocatorContext | information 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. |
| allocated | normally 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 85 of file volumebase_d.h.
References _items, _pos, _referential, _start, carto::PropertySet::addBuiltinProperty(), allocate(), allocatorContext(), carto::Headered::header(), and carto::VolumeProxy< T >::VolumeProxy().
|
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 198 of file volumebase_d.h.
References _items, allocatorContext(), and carto::VolumeProxy< T >::VolumeProxy().
|
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 219 of file volumebase_d.h.
References allocatorContext(), and carto::VolumeProxy< T >::VolumeProxy().
|
explicit |
Volume construction and allocation Same as the above constructor, but allows to specify a border size in each dimension.
Definition at line 165 of file volumebase_d.h.
References _items, allocatorContext(), carto::none(), and carto::VolumeProxy< T >::VolumeProxy().
|
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 180 of file volumebase_d.h.
References _items, allocatorContext(), and carto::VolumeProxy< T >::VolumeProxy().
|
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 243 of file volumebase_d.h.
References _items, _start, allocatorContext(), and carto::VolumeProxy< T >::VolumeProxy().
|
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 257 of file volumebase_d.h.
References _items, allocatorContext(), and carto::VolumeProxy< T >::VolumeProxy().
| 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 277 of file volumebase_d.h.
| 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 290 of file volumebase_d.h.
References _items, _pos, _referential, carto::PropertySet::addBuiltinProperty(), allocate(), allocatorContext(), carto::Headered::header(), and carto::VolumeProxy< T >::VolumeProxy().
| carto::Volume< T >::Volume | ( | const std::vector< int > & | size, |
| T * | buffer, | ||
| const std::vector< long > * | strides = 0 ) |
Definition at line 308 of file volumebase_d.h.
References _items, _pos, _referential, carto::PropertySet::addBuiltinProperty(), allocate(), allocatorContext(), carto::Headered::header(), and carto::VolumeProxy< T >::VolumeProxy().
|
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 408 of file volumebase_d.h.
References allocatorContext(), carto::VolumeProxy< T >::getSizeX(), carto::VolumeProxy< T >::getSizeY(), Volume(), and carto::VolumeProxy< T >::VolumeProxy().
|
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 467 of file volumebase_d.h.
References _blitz, _items, _pos, _referential, _refvol, carto::VolumeProxy< T >::_size, _start, carto::PropertySet::addBuiltinProperty(), allocate(), DIM_MAX, carto::Headered::header(), referential(), carto::Headered::uuid(), Volume(), and carto::VolumeProxy< T >::VolumeProxy().
| 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 524 of file volumebase_d.h.
References _items, _refvol, Volume(), and carto::VolumeProxy< T >::VolumeProxy().
| 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 547 of file volumebase_d.h.
References Volume(), and carto::VolumeProxy< T >::VolumeProxy().
|
virtual |
Definition at line 600 of file volumebase_d.h.
|
inline |
True if all values compare to true.
Definition at line 143 of file volumebase_d_operators.h.
References carto::volumebaseinternal::select_has_bool_conversion< T, has_bool_conversion >::all().
| 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 1203 of file volumebase_d.h.
References allocate(), allocatorContext(), carto::VolumeProxy< T >::getSize(), and getStrides().
Referenced by allocate(), allocate(), allocate(), constructBorders(), carto::Position4Di< T >::end(), reallocate(), reallocate(), slotSizeChanged(), carto::Position4Di< T >::Volume(), Volume(), Volume(), Volume(), Volume(), and Volume().
|
protected |
Definition at line 989 of file volumebase_d.h.
References _blitz, _items, _referential, carto::VolumeProxy< T >::_size, _start, allocate(), DIM_MAX, std::numeric_limits< typename _Tp >::max(), and carto::toString().
|
protected |
Definition at line 971 of file volumebase_d.h.
References allocate().
| 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 1350 of file volumebase_d.h.
References _pos, _refvol, constructBorders(), carto::copy(), copySubVolume(), and Volume().
| 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 1338 of file volumebase_d.h.
References allocateBorders().
Referenced by allocateBorders().
|
inline |
returns volume's AllocatorContext
Definition at line 609 of file volumebase_d.h.
References _items.
Referenced by allocate(), constructBorders(), carto::copyStructure(), carto::deepcopy(), carto::Position4Di< T >::end(), operator=(), soma::VolumeFormatReader< T >::read(), soma::VolumeUtilIO< T >::readFull(), carto::setBorders(), carto::setMinBorders(), carto::Creator< Volume< T > >::setup(), slotSizeChanged(), updateItemsBuffer(), Volume(), Volume(), Volume(), Volume(), Volume(), Volume(), Volume(), Volume(), Volume(), Volume(), Volume(), and soma::VolumeFormatWriter< T >::write().
|
inline |
True if at least one value compares to true.
Definition at line 150 of file volumebase_d_operators.h.
References carto::volumebaseinternal::select_has_bool_conversion< T, has_bool_conversion >::any().
|
inline |
Definition at line 540 of file volumebase_d_inline.h.
References _blitz.
|
inline |
Definition at line 547 of file volumebase_d_inline.h.
References _blitz.
|
inline |
Definition at line 554 of file volumebase_d_inline.h.
References _blitz.
|
inline |
Definition at line 562 of file volumebase_d_inline.h.
References _blitz.
|
inline |
Definition at line 526 of file volumebase_d_inline.h.
|
inline |
Definition at line 533 of file volumebase_d_inline.h.
|
inline |
Definition at line 471 of file volumebase_d_inline.h.
References _blitz.
|
inline |
Definition at line 465 of file volumebase_d_inline.h.
References _blitz.
|
inline |
Definition at line 483 of file volumebase_d_inline.h.
References _blitz.
|
inline |
Definition at line 477 of file volumebase_d_inline.h.
References _blitz.
|
inline |
Definition at line 495 of file volumebase_d_inline.h.
|
inline |
Definition at line 489 of file volumebase_d_inline.h.
References _blitz.
|
inline |
Definition at line 507 of file volumebase_d_inline.h.
References _blitz.
|
inline |
Definition at line 501 of file volumebase_d_inline.h.
References _blitz.
|
inline |
Definition at line 519 of file volumebase_d_inline.h.
|
inline |
Definition at line 513 of file volumebase_d_inline.h.
|
inline |
Definition at line 134 of file volumebase_d_inline.h.
References at().
|
inline |
Definition at line 118 of file volumebase_d_inline.h.
References at().
|
inline |
Definition at line 301 of file volumebase_d_inline.h.
|
inline |
Definition at line 149 of file volumebase_d_inline.h.
References _blitz.
|
inline |
Definition at line 76 of file volumebase_d_inline.h.
|
inline |
Definition at line 48 of file volumebase_d_inline.h.
References _blitz, and _start.
Referenced by carto::VolumeUtil< T >::accumulate(), carto::volumeutil::accumulate(), carto::volumeutil::applyTowards(), carto::volumeutil::applyTowards(), carto::volumeutil::applyTowards(), carto::volumeutil::applyTowards(), carto::volumeutil::applyTowards(), at(), at(), carto::VolumeRef< T >::at(), copySubVolume(), flipToOrientation(), flipToOrientation(), carto::matrix_product(), carto::max(), carto::min(), operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), soma::VolumeUtilIO< T >::readPartial(), carto::LightResampler< T >::resampleVolume(), carto::sort(), carto::transpose(), and soma::VolumeFormatWriter< T >::write().
|
inline |
Definition at line 587 of file volumebase_d_inline.h.
References _blitz.
|
inline |
Definition at line 570 of file volumebase_d_inline.h.
References _blitz.
| 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 910 of file volumebase_d.h.
References _blitz.
Referenced by carto::VolumeRef< T >::begin(), and carto::VolumeRef< T >::begin().
| Volume< T >::const_iterator carto::Volume< T >::begin | ( | ) | const |
Definition at line 928 of file volumebase_d.h.
References _blitz.
|
protected |
Definition at line 105 of file volumebase_d.h.
References _blitz, _refvol, carto::VolumeProxy< T >::_size, _start, allocate(), allocatorContext(), and Volume().
Referenced by allocateBorders(), and carto::Position4Di< T >::operator=().
|
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 298 of file volumebase_d_operators.h.
References Volume().
Referenced by flipToOrientation().
|
inline |
Definition at line 306 of file volumebase_d_operators.h.
References Volume().
|
inline |
Copy the full data structure without copying the actual data.
Definition at line 328 of file volumebase_d_operators.h.
References Volume().
|
inline |
Copy the full data structure without copying the actual data.
Definition at line 336 of file volumebase_d_operators.h.
References Volume().
| 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 903 of file volumebase_d.h.
References copySubVolume(), and Volume().
| 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 870 of file volumebase_d.h.
References at(), carto::NDIterator_base::ended(), carto::VolumeProxy< T >::getSize(), getStrides(), carto::const_line_NDIterator< typename T >::inc_line_ptr(), carto::line_NDIterator< typename T >::inc_line_ptr(), carto::line_NDIterator< typename T >::line_length(), and Volume().
Referenced by allocateBorders(), and copySubVolume().
|
inline |
Copy the full data structure.
This is similar to what the copy constructor does.
Definition at line 313 of file volumebase_d_operators.h.
References Volume().
Referenced by carto::operator++(), and carto::operator--().
|
inline |
Definition at line 321 of file volumebase_d_operators.h.
References Volume().
| Volume< T >::iterator carto::Volume< T >::end | ( | ) |
Definition at line 919 of file volumebase_d.h.
References _blitz.
Referenced by carto::VolumeRef< T >::end(), and carto::VolumeRef< T >::end().
| Volume< T >::const_iterator carto::Volume< T >::end | ( | ) | const |
Definition at line 937 of file volumebase_d.h.
References _blitz.
|
inline |
Fills the volume with a given value.
Definition at line 191 of file volumebase_d_operators.h.
References carto::volumeutil::selfApply().
Referenced by operator=().
|
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 207 of file volumebase_d_operators.h.
References carto::VolumeProxy< T >::getSize(), posInRefVolume(), and refVolume().
| 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 1377 of file volumebase_d.h.
References _blitz, _items, _referential, _start, at(), carto::Headered::blockSignals(), DIM_MAX, carto::VolumeProxy< T >::getSize(), carto::Headered::header(), soma::AffineTransformationBase::inverse(), referential(), reorientedHeader(), soma::Transformation::transformVector(), and carto::Headered::uuid().
Referenced by carto::Creator< Volume< T > >::create(), and flipToOrientation().
| 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 1454 of file volumebase_d.h.
References at(), carto::copy(), copy(), carto::NDIterator_base::ended(), flipToOrientation(), carto::VolumeProxy< T >::getSize(), getStrides(), carto::Headered::header(), carto::line_NDIterator< typename T >::inc_line_ptr(), soma::AffineTransformationBase::inverse(), carto::line_NDIterator_base::line_direction(), carto::line_NDIterator< typename T >::line_length(), carto::NDIterator_base::position(), referential(), soma::AffineTransformationBase::transform(), and soma::Transformation::transformVector().
|
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.
Definition at line 796 of file volumebase_d.h.
References _pos, _refvol, and carto::VolumeProxy< T >::_size.
Referenced by carto::matrix_product(), carto::setBorders(), carto::setBorders(), carto::setMinBorders(), carto::setMinBorders(), and carto::transpose().
|
inline |
Get levels count in volume hierarchy from the current volume to the topmost volume.
Definition at line 628 of file volumebase_d.h.
References carto::const_ref< class T >::isNull(), and Volume().
Referenced by refLevel().
|
inline |
Get strides for the volume.
Strides contain the number of voxels for
each dimension including.
Definition at line 815 of file volumebase_d.h.
References _blitz, and carto::VolumeProxy< T >::_size.
Referenced by carto::VolumeUtil< T >::accumulate(), carto::volumeutil::accumulate(), allocate(), carto::volumeutil::applyTowards(), carto::volumeutil::applyTowards(), carto::volumeutil::applyTowards(), carto::volumeutil::applyTowards(), carto::volumeutil::applyTowards(), copySubVolume(), flipToOrientation(), memoryLayoutOrientation(), soma::VolumeUtilIO< T >::readPartial(), carto::LightResampler< T >::resampleVolume(), and carto::transpose().
|
virtual |
Initializes header info.
Reimplemented from carto::Headered.
Definition at line 946 of file volumebase_d.h.
References carto::Headered::addPropertyFilter(), carto::Headered::connect(), carto::Headered::initialize(), and slotSizeChanged().
Referenced by operator=().
|
inline |
Definition at line 171 of file volumebase_d_operators.h.
References carto::volumebaseinternal::select_is_scalar< T, is_scalar >::max().
| 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 1630 of file volumebase_d.h.
References carto::VolumeProxy< T >::getSize(), getStrides(), and referential().
|
inline |
Definition at line 164 of file volumebase_d_operators.h.
References carto::volumebaseinternal::select_is_scalar< T, is_scalar >::min().
|
inline |
Implicit cast to bool returns all()
Definition at line 157 of file volumebase_d_operators.h.
References carto::volumebaseinternal::select_has_bool_conversion< T, has_bool_conversion >::all(), and Volume().
|
inline |
Cast to Volume of different datatype.
Definition at line 344 of file volumebase_d_operators.h.
References Volume().
|
inline |
Definition at line 142 of file volumebase_d_inline.h.
References at().
|
inline |
Definition at line 126 of file volumebase_d_inline.h.
References at().
|
inline |
Definition at line 459 of file volumebase_d_inline.h.
References at().
|
inline |
Definition at line 452 of file volumebase_d_inline.h.
References at().
|
inline |
Definition at line 110 of file volumebase_d_inline.h.
References at().
|
inline |
Warning: this operator is not virtual, so may not have the expected result on inherited classes (see old VolumeView)
Definition at line 68 of file volumebase_d_inline.h.
References at().
|
inline |
Definition at line 597 of file volumebase_d_inline.h.
References at().
|
inline |
Definition at line 579 of file volumebase_d_inline.h.
References at().
|
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:
Definition at line 198 of file volumebase_d_operators.h.
| Volume< T > & carto::Volume< T >::operator= | ( | const Volume< T > & | other | ) |
Definition at line 828 of file volumebase_d.h.
References _blitz, _items, _pos, _referential, _refvol, carto::VolumeProxy< T >::_size, _start, allocatorContext(), carto::Headered::blockSignals(), DIM_MAX, initialize(), carto::VolumeProxy< T >::operator=(), carto::Headered::signalsBlocked(), and Volume().
|
inline |
Get position in parent volume.
Definition at line 621 of file volumebase_d.h.
References _pos.
Referenced by carto::Position4Di< T >::allocate(), carto::copyStructure(), carto::deepcopy(), fillBorder(), carto::VolumeRef< T >::posInRefVolume(), soma::VolumeFormatReader< T >::read(), and soma::VolumeFormatWriter< T >::write().
|
inline |
Get position relatively to parent volume at specified level.
Definition at line 673 of file volumebase_d.h.
References carto::VolumeProxy< T >::getSize(), carto::const_ref< class T >::isNull(), refLevel(), and Volume().
Referenced by carto::VolumeRef< T >::posInRefVolumeAtLevel().
|
virtual |
Definition at line 1294 of file volumebase_d.h.
References reallocate().
|
virtual |
Definition at line 1308 of file volumebase_d.h.
References carto::VolumeProxy< T >::_size, allocate(), carto::PropertySet::changeBuiltinProperty(), and carto::Headered::header().
|
virtual |
allows resizing and changing allocator
Definition at line 1267 of file volumebase_d.h.
References carto::VolumeProxy< T >::_size, and allocate().
Referenced by reallocate(), carto::setBorders(), carto::setMinBorders(), and carto::Creator< Volume< T > >::setup().
| Referential & carto::Volume< T >::referential | ( | ) |
Referential and orientation information.
Definition at line 774 of file volumebase_d_inline.h.
References _referential.
| const Referential & carto::Volume< T >::referential | ( | ) | const |
Referential and orientation information.
Definition at line 767 of file volumebase_d_inline.h.
References _referential.
Referenced by carto::Creator< Volume< T > >::create(), flipToOrientation(), flipToOrientation(), memoryLayoutOrientation(), reorientedHeader(), storageLayoutOrientation(), Volume(), and soma::VolumeFormatWriter< T >::write().
|
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 640 of file volumebase_d.h.
References getLevelsCount(), and carto::toString().
Referenced by posInRefVolumeAtLevel(), and refVolumeAtLevel().
|
inline |
Get parent volume.
Definition at line 615 of file volumebase_d.h.
References _refvol.
Referenced by carto::copyStructure(), carto::deepcopy(), fillBorder(), soma::VolumeFormatReader< T >::read(), and soma::VolumeFormatWriter< T >::write().
|
inline |
Get parent volume at a specified level in volume hierarchy.
Definition at line 658 of file volumebase_d.h.
References carto::const_ref< class T >::isNull(), refLevel(), and Volume().
| Object carto::Volume< T >::reorientedHeader | ( | const std::string & | orient | ) | const |
used by flipToOrientation(), reorient header information
Definition at line 1536 of file volumebase_d.h.
References _referential, carto::PropertySet::getProperty(), carto::VolumeProxy< T >::getSize(), carto::VolumeProxy< T >::getVoxelSize(), carto::PropertySet::hasProperty(), carto::Headered::header(), soma::AffineTransformationBase::inverse(), soma::AffineTransformationBase::order(), carto::Object::reference(), referential(), soma::AffineTransformationBase::squeezeOrder(), soma::Transformation::transformVector(), and carto::Object::value().
Referenced by flipToOrientation(), and soma::VolumeFormatWriter< T >::write().
|
inline |
Definition at line 777 of file volumebase_d.h.
References _pos, and updateItemsBuffer().
|
inline |
Set position in parent volume.
Definition at line 766 of file volumebase_d.h.
References _pos, carto::Volume< T >::Position4Di::toVector(), and updateItemsBuffer().
Referenced by carto::copyStructure(), carto::deepcopy(), carto::setBorders(), carto::setMinBorders(), and carto::VolumeRef< T >::setPosInRefVolume().
|
inline |
Set parent volume.
Definition at line 788 of file volumebase_d.h.
References _refvol, updateItemsBuffer(), and Volume().
Referenced by carto::copyStructure(), carto::deepcopy(), carto::setBorders(), and carto::setMinBorders().
|
protected |
Definition at line 1215 of file volumebase_d.h.
References _items, carto::VolumeProxy< T >::_size, allocate(), allocatorContext(), carto::PropertyFilter::getOldValue(), and carto::PropertyFilter::hasOldValue().
Referenced by initialize().
| 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 1666 of file volumebase_d.h.
References carto::VolumeProxy< T >::getSize(), carto::Headered::header(), soma::AffineTransformationBase::inverse(), and referential().
|
inline |
To avoid overflow, the biggest possible type (intmax_t, uintmax_t, double...) is used for computation and returned.
Definition at line 178 of file volumebase_d_operators.h.
References carto::volumebaseinternal::select_is_scalar< T, is_scalar >::sum().
|
inlineprotected |
Definition at line 694 of file volumebase_d.h.
References _blitz, _items, _pos, _refvol, carto::VolumeProxy< T >::_size, _start, allocatorContext(), DIM_MAX, and carto::Headered::header().
Referenced by setPosInRefVolume(), setPosInRefVolume(), and setRefVolume().
|
protected |
Definition at line 583 of file volumebase.h.
Referenced by allocate(), at(), at(), at(), at(), at(), at(), at(), at(), at(), at(), at(), at(), at(), at(), at(), at(), at(), at(), at(), at(), begin(), begin(), constructBorders(), end(), end(), flipToOrientation(), getStrides(), operator=(), updateItemsBuffer(), and Volume().
|
protected |
Definition at line 580 of file volumebase.h.
Referenced by allocate(), allocatorContext(), flipToOrientation(), operator=(), slotSizeChanged(), updateItemsBuffer(), Volume(), Volume(), Volume(), Volume(), Volume(), Volume(), Volume(), Volume(), Volume(), Volume(), and Volume().
|
protected |
Definition at line 585 of file volumebase.h.
Referenced by allocateBorders(), getBorders(), operator=(), posInRefVolume(), setPosInRefVolume(), setPosInRefVolume(), updateItemsBuffer(), Volume(), Volume(), Volume(), Volume(), and Volume().
|
protected |
Definition at line 586 of file volumebase.h.
Referenced by allocate(), flipToOrientation(), operator=(), referential(), referential(), reorientedHeader(), Volume(), Volume(), Volume(), Volume(), and Volume().
|
protected |
Definition at line 584 of file volumebase.h.
Referenced by allocateBorders(), constructBorders(), getBorders(), operator=(), refVolume(), setRefVolume(), updateItemsBuffer(), Volume(), and Volume().
|
protected |
Definition at line 582 of file volumebase.h.
Referenced by allocate(), at(), at(), constructBorders(), flipToOrientation(), operator=(), updateItemsBuffer(), Volume(), Volume(), Volume(), and Volume().