Image Utilities (IU)
 All Data Structures Namespaces Functions Variables Typedefs Enumerations Friends Groups Pages
Public Types | Public Member Functions
iu::VolumeCpu< PixelType, Allocator > Class Template Reference

Host 3D volume class (pitched memory). More...

#include <volume_cpu.h>

Inheritance diagram for iu::VolumeCpu< PixelType, Allocator >:
iu::Volume

Public Types

typedef PixelType pixel_type
 

Public Member Functions

 VolumeCpu ()
 
virtual ~VolumeCpu ()
 
 VolumeCpu (unsigned int _width, unsigned int _height, unsigned int _depth)
 
 VolumeCpu (const iu::Size< 3 > &size)
 
 VolumeCpu (PixelType *_data, unsigned int _width, unsigned int _height, unsigned int _depth, size_t _pitch, bool ext_data_pointer=false)
 
size_t bytes () const
 
size_t pitch () const
 
size_t slice_pitch () const
 
size_t stride () const
 
size_t slice_stride () const
 
virtual unsigned int bitDepth () const
 
virtual bool onDevice () const
 
PixelType * data (int ox=0, int oy=0, int oz=0)
 
const PixelType * data (int ox=0, int oy=0, int oz=0) const
 
ImageCpu< PixelType,
iuprivate::ImageAllocatorCpu
< PixelType > > 
getSlice (int oz)
 
PixelType getPixel (unsigned int x, unsigned int y, unsigned int z)
 
thrust::pointer< PixelType,
thrust::host_system_tag > 
begin (void)
 
thrust::pointer< PixelType,
thrust::host_system_tag > 
end (void)
 
ndarray_ref< PixelType, 3 > ref () const
 
 VolumeCpu (const ndarray_ref< PixelType, 3 > &x)
 
- Public Member Functions inherited from iu::Volume
 Volume ()
 
virtual ~Volume ()
 
 Volume (unsigned int width, unsigned int height, unsigned int depth)
 
 Volume (const iu::Size< 3 > &size)
 
bool sameType (const Volume &from)
 
iu::Size< 3 > size () const
 
unsigned int width () const
 
unsigned int height () const
 
unsigned int depth () const
 
size_t numel () const
 

Detailed Description

template<typename PixelType, class Allocator>
class iu::VolumeCpu< PixelType, Allocator >

Host 3D volume class (pitched memory).

Member Typedef Documentation

template<typename PixelType, class Allocator>
typedef PixelType iu::VolumeCpu< PixelType, Allocator >::pixel_type

Define the current pixel type.

Constructor & Destructor Documentation

template<typename PixelType, class Allocator>
iu::VolumeCpu< PixelType, Allocator >::VolumeCpu ( )
inline

Constructor.

template<typename PixelType, class Allocator>
virtual iu::VolumeCpu< PixelType, Allocator >::~VolumeCpu ( )
inlinevirtual

Destructor.

template<typename PixelType, class Allocator>
iu::VolumeCpu< PixelType, Allocator >::VolumeCpu ( unsigned int  _width,
unsigned int  _height,
unsigned int  _depth 
)
inline

Special constructor.

Parameters
_widthWidth of the Volume
_heightHeight of the Volume
_depthDepth of the Volume
template<typename PixelType, class Allocator>
iu::VolumeCpu< PixelType, Allocator >::VolumeCpu ( const iu::Size< 3 > &  size)
inline

Special constructor.

Parameters
sizeSize of the Volume
template<typename PixelType, class Allocator>
iu::VolumeCpu< PixelType, Allocator >::VolumeCpu ( PixelType *  _data,
unsigned int  _width,
unsigned int  _height,
unsigned int  _depth,
size_t  _pitch,
bool  ext_data_pointer = false 
)
inline

Special constructor.

Parameters
_dataHost data pointer
_widthWidth of the Volume
_heightHeight of the Volume
_depthHeight of the Volume
_pitchDistance in bytes between starts of consecutive rows.
ext_data_pointerUse external data pointer as internal data pointer
template<typename PixelType, class Allocator>
iu::VolumeCpu< PixelType, Allocator >::VolumeCpu ( const ndarray_ref< PixelType, 3 > &  x)

construct from ndarray_ref – include ndarray/ndarray_iu.h

Member Function Documentation

template<typename PixelType, class Allocator>
thrust::pointer<PixelType, thrust::host_system_tag> iu::VolumeCpu< PixelType, Allocator >::begin ( void  )
inline

Returns a thrust pointer that can be used in custom operators

Returns
Thrust pointer of the begin of the host memory
template<typename PixelType, class Allocator>
virtual unsigned int iu::VolumeCpu< PixelType, Allocator >::bitDepth ( ) const
inlinevirtual

Returns the bit depth of the data pointer.

Reimplemented from iu::Volume.

template<typename PixelType, class Allocator>
size_t iu::VolumeCpu< PixelType, Allocator >::bytes ( ) const
inlinevirtual

Returns the total amount of bytes saved in the data buffer.

Reimplemented from iu::Volume.

template<typename PixelType, class Allocator>
PixelType* iu::VolumeCpu< PixelType, Allocator >::data ( int  ox = 0,
int  oy = 0,
int  oz = 0 
)
inline

Returns a pointer to the pixel data. The pointer can be offset to position (ox/oy).

Parameters
oxHorizontal offset of the pointer array.
oyVertical offset of the pointer array.
Returns
Pointer to the pixel array.
template<typename PixelType, class Allocator>
const PixelType* iu::VolumeCpu< PixelType, Allocator >::data ( int  ox = 0,
int  oy = 0,
int  oz = 0 
) const
inline

Returns a const pointer to the pixel data. The pointer can be offset to position (ox/oy).

Parameters
oxHorizontal offset of the pointer array.
oyVertical offset of the pointer array.
Returns
Const pointer to the pixel array.
template<typename PixelType, class Allocator>
thrust::pointer<PixelType, thrust::host_system_tag> iu::VolumeCpu< PixelType, Allocator >::end ( void  )
inline

Returns a thrust pointer that can be used in custom operators

Returns
Thrust pointer of the end of the host memory
template<typename PixelType, class Allocator>
PixelType iu::VolumeCpu< PixelType, Allocator >::getPixel ( unsigned int  x,
unsigned int  y,
unsigned int  z 
)
inline

Get Pixel value at position x,y,z.

template<typename PixelType, class Allocator>
ImageCpu<PixelType, iuprivate::ImageAllocatorCpu<PixelType> > iu::VolumeCpu< PixelType, Allocator >::getSlice ( int  oz)
inline

Returns a volume slice given by a z-offset as ImageCpu

Parameters
[in]ozz-offset into the volume
Returns
volume slice at depth z as ImageCpu. Note, the ImageCpu merely holds a pointer to the volume data at depth z, i.e. it does not manage its own data -> changes to the Image are transparent to the volume and vice versa.
template<typename PixelType, class Allocator>
virtual bool iu::VolumeCpu< PixelType, Allocator >::onDevice ( ) const
inlinevirtual

Returns flag if the volume data resides on the device/GPU (TRUE) or host/GPU (FALSE)

Reimplemented from iu::Volume.

template<typename PixelType, class Allocator>
size_t iu::VolumeCpu< PixelType, Allocator >::pitch ( ) const
inlinevirtual

Returns the distance in bytes between starts of consecutive rows.

Reimplemented from iu::Volume.

template<typename PixelType, class Allocator>
ndarray_ref<PixelType,3> iu::VolumeCpu< PixelType, Allocator >::ref ( ) const

convert to ndarray_ref – include ndarray/ndarray_iu.h

template<typename PixelType, class Allocator>
size_t iu::VolumeCpu< PixelType, Allocator >::slice_pitch ( ) const
inline

Returns the distance in bytes between starts of consecutive slices.

template<typename PixelType, class Allocator>
size_t iu::VolumeCpu< PixelType, Allocator >::slice_stride ( ) const
inlinevirtual

Returns the distnace in pixels between starts of consecutive slices.

Reimplemented from iu::Volume.

template<typename PixelType, class Allocator>
size_t iu::VolumeCpu< PixelType, Allocator >::stride ( ) const
inlinevirtual

Returns the distance in pixels between starts of consecutive rows.

Reimplemented from iu::Volume.


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