Workspace 6.21.5
Public Types | Public Member Functions | List of all members
Array3dTypedAdaptor< ContainerType, T, Reader, Writer, DeepCopier > Class Template Reference

#include <DataAnalysis/DataStructures/array3dtyped.h>

Inheritance diagram for Array3dTypedAdaptor< ContainerType, T, Reader, Writer, DeepCopier >:
[legend]

Public Types

using container_type = ContainerType
 
- Public Types inherited from Array3dTyped< T >
typedef T value_type
 

Public Member Functions

 Array3dTypedAdaptor (const Array3dTypedAdaptor &adaptor)
 
 Array3dTypedAdaptor (const Reader &eval=Reader(), const Writer &writer=Writer())
 
 Array3dTypedAdaptor (ContainerType *data, bool ownsData, const Reader &eval=Reader(), const Writer &writer=Writer())
 
 ~Array3dTypedAdaptor ()
 
qint64 cacheKey () const override
 
Array3dTypedAdaptorclone () const override
 
unsigned dimension (unsigned i) const override
 
bool empty () const override
 
QVector3D getCellSpacing () const override
 
QVector3D getOrigin () const override
 
operator() (unsigned x, unsigned y, unsigned z=0) const override
 
void resize (unsigned x, unsigned y, unsigned z) override
 
void setCell (unsigned x, unsigned y, unsigned z, const T &value) override
 
void setCellSpacing (const QVector3D &size) override
 
void setData (ContainerType *d, bool ownsData)
 
void setOrigin (const QVector3D &origin) override
 
void setReader (const Reader &reader)
 
void setWriter (const Writer &writer)
 
unsigned size () const override
 
- Public Member Functions inherited from Array3dTyped< T >
 ~Array3dTyped () override=default
 
Array3dTypedclone () const override=0
 
virtual T getFillValue () const
 
virtual bool hasFillValue () const
 
virtual T operator() (unsigned x, unsigned y, unsigned z) const =0
 
virtual void resize (unsigned x, unsigned y, unsigned z)=0
 
virtual void setCell (unsigned x, unsigned y, unsigned z, const T &value)=0
 
- Public Member Functions inherited from Array3d
 ~Array3d () override=default
 
virtual qint64 cacheKey () const =0
 
Array3dclone () const override=0
 
virtual unsigned dimension (unsigned i) const =0
 
virtual bool empty () const =0
 
virtual QVector3D getCellSpacing () const
 
virtual QVector3D getOrigin () const
 
virtual void setCellSpacing (const QVector3D &size)
 
virtual void setOrigin (const QVector3D &origin)
 
virtual unsigned size () const =0
 
- Public Member Functions inherited from Clonable
virtual ~Clonable ()=default
 
virtual Clonableclone () const =0
 

Detailed Description

template<typename ContainerType, typename T, typename Reader = Array3dTypedReader<ContainerType, T>, typename Writer = Array3dTypedWriter<ContainerType, T>, typename DeepCopier = DeepCopy<ContainerType>>
class CSIRO::DataAnalysis::Array3dTypedAdaptor< ContainerType, T, Reader, Writer, DeepCopier >

Standard implementation of our Array3dTyped interface, which allows users to specify the type of container.

The container must implement the following functions:

See Array3dData for an example of a class that implements these functions.

Template Parameters
ContainerTypeThe container that stores data in some format (does not need to be T)
TThe type of data the adaptor will extract from its underlying container.
ReaderThe policy to be used to return the data from the container as an object of type T.
WriterThe policy to be used to write an object of type T to to the container as the type ContainreType::value_type.

Member Typedef Documentation

◆ container_type

using container_type = ContainerType

Constructor & Destructor Documentation

◆ Array3dTypedAdaptor() [1/3]

Array3dTypedAdaptor ( ContainerType *  data,
bool  ownsData,
const Reader &  eval = Reader(),
const Writer &  writer = Writer() 
)
inline

◆ Array3dTypedAdaptor() [2/3]

Array3dTypedAdaptor ( const Reader &  eval = Reader(),
const Writer &  writer = Writer() 
)
inline

◆ Array3dTypedAdaptor() [3/3]

Array3dTypedAdaptor ( const Array3dTypedAdaptor< ContainerType, T, Reader, Writer, DeepCopier > &  adaptor)
inline

◆ ~Array3dTypedAdaptor()

~Array3dTypedAdaptor ( )
inline

Member Function Documentation

◆ cacheKey()

qint64 cacheKey ( ) const
inlineoverridevirtual

Implements Array3d.

◆ clone()

Array3dTypedAdaptor * clone ( ) const
inlineoverridevirtual
Returns
A clone of this object.
Note
Subclasses would normally return their own type rather than the Clonable type. The C++ language rules allow a more derived type to be returned from a virtual function and the compiler will still treat it as a valid override.

Implements Array3dTyped< T >.

◆ dimension()

unsigned dimension ( unsigned  i) const
inlineoverridevirtual

Implements Array3d.

◆ empty()

bool empty ( ) const
inlineoverridevirtual

Implements Array3d.

◆ getCellSpacing()

QVector3D getCellSpacing ( ) const
inlineoverridevirtual
Returns
The spacing between voxels in the dataset in each dimension; i.e., the distance from the centre of each voxel to the centre of the next voxel.

Reimplemented from Array3d.

◆ getOrigin()

QVector3D getOrigin ( ) const
inlineoverridevirtual

The origin of the Array in world coordinates. This is useful if the array is not offset. Default value is [0,0,0].

Reimplemented from Array3d.

◆ operator()()

T operator() ( unsigned  x,
unsigned  y,
unsigned  z = 0 
) const
inlineoverridevirtual

Implements Array3dTyped< T >.

◆ resize()

void resize ( unsigned  x,
unsigned  y,
unsigned  z 
)
inlineoverridevirtual

Implements Array3dTyped< T >.

◆ setCell()

void setCell ( unsigned  x,
unsigned  y,
unsigned  z,
const T &  value 
)
inlineoverridevirtual

Implements Array3dTyped< T >.

◆ setCellSpacing()

void setCellSpacing ( const QVector3D &  size)
inlineoverridevirtual

Sets the cell spacing: the distance from the centre of one voxel to the centre of the next voxel in each dimension.

Reimplemented from Array3d.

◆ setData()

void setData ( ContainerType *  d,
bool  ownsData 
)
inline

◆ setOrigin()

void setOrigin ( const QVector3D &  origin)
inlineoverridevirtual
Parameters
originThe desired origin of the array in world coordinates. Default value is [0,0,0].

Useful alongside setCellSpacing to define the extent of the array's data in world coordinates. This is needed for some algorithms where the shape of each voxel and its location needs to be known prior to execution.

Reimplemented from Array3d.

◆ setReader()

void setReader ( const Reader &  reader)
inline

◆ setWriter()

void setWriter ( const Writer &  writer)
inline

◆ size()

unsigned size ( ) const
inlineoverridevirtual

Implements Array3d.