Medical Imaging Interaction Toolkit  2018.4.99-3e3f1a6e
Medical Imaging Interaction Toolkit
mitk::pa::Volume Class Reference

The Volume class is designed to encapsulate volumetric information and to provide convenience methods for data access and image conversions. More...

#include <mitkPAVolume.h>

Inheritance diagram for mitk::pa::Volume:
Collaboration diagram for mitk::pa::Volume:

Public Member Functions

 mitkClassMacroItkParent (Volume, itk::LightObject)
 
double GetData (unsigned int x, unsigned int y, unsigned int z)
 GetData. Returns data at wanted position. For performance reasons, this method will not check, if the specified position it within the array. Please use the GetXDim(), GetYDim() and GetZDim() methods to check for yourself if necessary. More...
 
double * GetData () const
 
void SetData (double data, unsigned int x, unsigned int y, unsigned int z)
 SetData. More...
 
unsigned int GetXDim ()
 GetXDim. More...
 
unsigned int GetYDim ()
 GetYDim. More...
 
unsigned int GetZDim ()
 GetZDim. More...
 
Image::Pointer AsMitkImage ()
 returns the Volume instance as an mitk image More...
 
Volume::Pointer DeepCopy ()
 DeepCopy. More...
 
long long GetIndex (unsigned int x, unsigned int y, unsigned int z)
 convenience method to enable consistent access to the dat array More...
 
double GetSpacing ()
 
void SetSpacing (double spacing)
 

Static Public Member Functions

static Volume::Pointer New (double *data, unsigned int xDim, unsigned int yDim, unsigned int zDim, double spacing)
 returns smartpointer reference to a new instance of this objects. The given data array will be freed upon calling this constructor. More...
 
static Volume::Pointer New (mitk::Image::Pointer image)
 

Protected Member Functions

 Volume (double *data, unsigned int xDim, unsigned int yDim, unsigned int zDim, double spacing)
 Initialize initializes this volume with the given pointer to the data array. It is assumed, that the array is of dimension xDim|yDim|zDim. The Photoacoustic3DVolume will handle memory management of the array and delete it on constructor call. More...
 
 Volume (mitk::Image::Pointer image)
 
 ~Volume () override
 

Protected Attributes

const int NUMBER_OF_SPATIAL_DIMENSIONS
 
Image::Pointer m_InternalMitkImage
 
unsigned int m_XDim
 
unsigned int m_YDim
 
unsigned int m_ZDim
 
double * m_FastAccessDataPointer
 

Detailed Description

The Volume class is designed to encapsulate volumetric information and to provide convenience methods for data access and image conversions.

Definition at line 30 of file mitkPAVolume.h.

Constructor & Destructor Documentation

◆ Volume() [1/2]

mitk::pa::Volume::Volume ( double *  data,
unsigned int  xDim,
unsigned int  yDim,
unsigned int  zDim,
double  spacing 
)
protected

Initialize initializes this volume with the given pointer to the data array. It is assumed, that the array is of dimension xDim|yDim|zDim. The Photoacoustic3DVolume will handle memory management of the array and delete it on constructor call.

Parameters
dataa pointer to the data array
xDimx dimension of the data
yDimy dimension of the data
zDimz dimension of the data

Definition at line 18 of file mitkPAVolume.cpp.

References GetData(), m_FastAccessDataPointer, m_InternalMitkImage, m_XDim, m_YDim, m_ZDim, MITK_INFO, mitkThrow, mitk::Image::New(), NUMBER_OF_SPATIAL_DIMENSIONS, and SetSpacing().

◆ Volume() [2/2]

mitk::pa::Volume::Volume ( mitk::Image::Pointer  image)
protected

◆ ~Volume()

mitk::pa::Volume::~Volume ( )
overrideprotected

Definition at line 73 of file mitkPAVolume.cpp.

References m_InternalMitkImage.

Member Function Documentation

◆ AsMitkImage()

mitk::Image::Pointer mitk::pa::Volume::AsMitkImage ( )

returns the Volume instance as an mitk image

Definition at line 92 of file mitkPAVolume.cpp.

References m_InternalMitkImage.

◆ DeepCopy()

mitk::pa::Volume::Pointer mitk::pa::Volume::DeepCopy ( )

DeepCopy.

Returns
a deep copy of this Volume. the old volume remains intact and memory is NOT shared between the objects.

Definition at line 97 of file mitkPAVolume.cpp.

References GetData(), GetSpacing(), GetXDim(), GetYDim(), GetZDim(), and New().

◆ GetData() [1/2]

double mitk::pa::Volume::GetData ( unsigned int  x,
unsigned int  y,
unsigned int  z 
)

GetData. Returns data at wanted position. For performance reasons, this method will not check, if the specified position it within the array. Please use the GetXDim(), GetYDim() and GetZDim() methods to check for yourself if necessary.

Parameters
x
y
z
Returns
the data contained within the data array held by this Volume at positon x|y|z.

Definition at line 106 of file mitkPAVolume.cpp.

References GetIndex(), and m_FastAccessDataPointer.

◆ GetData() [2/2]

double * mitk::pa::Volume::GetData ( ) const

Returns a const reference to the data encapsuled by this class.

Definition at line 131 of file mitkPAVolume.cpp.

References mitk::ImageWriteAccessor::GetData(), and m_InternalMitkImage.

Referenced by DeepCopy(), and Volume().

◆ GetIndex()

long long mitk::pa::Volume::GetIndex ( unsigned int  x,
unsigned int  y,
unsigned int  z 
)

convenience method to enable consistent access to the dat array

Returns
a 1d index from 3d pixel coordinates

Definition at line 137 of file mitkPAVolume.cpp.

References GetXDim(), GetYDim(), GetZDim(), m_XDim, m_YDim, MITK_ERROR, and mitkThrow.

Referenced by GetData(), and SetData().

◆ GetSpacing()

double mitk::pa::Volume::GetSpacing ( )

Definition at line 62 of file mitkPAVolume.cpp.

References m_InternalMitkImage.

Referenced by DeepCopy().

◆ GetXDim()

unsigned int mitk::pa::Volume::GetXDim ( )

GetXDim.

Returns
size of x dimension of this Volume

Definition at line 116 of file mitkPAVolume.cpp.

References m_XDim.

Referenced by DeepCopy(), and GetIndex().

◆ GetYDim()

unsigned int mitk::pa::Volume::GetYDim ( )

GetYDim.

Returns
size of y dimension of this Volume

Definition at line 121 of file mitkPAVolume.cpp.

References m_YDim.

Referenced by DeepCopy(), and GetIndex().

◆ GetZDim()

unsigned int mitk::pa::Volume::GetZDim ( )

GetZDim.

Returns
size of z dimension of this Volume

Definition at line 126 of file mitkPAVolume.cpp.

References m_ZDim.

Referenced by DeepCopy(), and GetIndex().

◆ mitkClassMacroItkParent()

mitk::pa::Volume::mitkClassMacroItkParent ( Volume  ,
itk::LightObject   
)

◆ New() [1/2]

mitk::pa::Volume::Pointer mitk::pa::Volume::New ( double *  data,
unsigned int  xDim,
unsigned int  yDim,
unsigned int  zDim,
double  spacing 
)
static

◆ New() [2/2]

mitk::pa::Volume::Pointer mitk::pa::Volume::New ( mitk::Image::Pointer  image)
static

Definition at line 85 of file mitkPAVolume.cpp.

◆ SetData()

void mitk::pa::Volume::SetData ( double  data,
unsigned int  x,
unsigned int  y,
unsigned int  z 
)

SetData.

Parameters
data
x
y
z

Definition at line 111 of file mitkPAVolume.cpp.

References GetIndex(), and m_FastAccessDataPointer.

◆ SetSpacing()

void mitk::pa::Volume::SetSpacing ( double  spacing)

Definition at line 67 of file mitkPAVolume.cpp.

References m_InternalMitkImage.

Referenced by Volume().

Member Data Documentation

◆ m_FastAccessDataPointer

double* mitk::pa::Volume::m_FastAccessDataPointer
protected

Definition at line 141 of file mitkPAVolume.h.

Referenced by GetData(), SetData(), and Volume().

◆ m_InternalMitkImage

Image::Pointer mitk::pa::Volume::m_InternalMitkImage
protected

Definition at line 135 of file mitkPAVolume.h.

Referenced by AsMitkImage(), GetData(), GetSpacing(), SetSpacing(), Volume(), and ~Volume().

◆ m_XDim

unsigned int mitk::pa::Volume::m_XDim
protected

Definition at line 138 of file mitkPAVolume.h.

Referenced by GetIndex(), GetXDim(), and Volume().

◆ m_YDim

unsigned int mitk::pa::Volume::m_YDim
protected

Definition at line 139 of file mitkPAVolume.h.

Referenced by GetIndex(), GetYDim(), and Volume().

◆ m_ZDim

unsigned int mitk::pa::Volume::m_ZDim
protected

Definition at line 140 of file mitkPAVolume.h.

Referenced by GetZDim(), and Volume().

◆ NUMBER_OF_SPATIAL_DIMENSIONS

const int mitk::pa::Volume::NUMBER_OF_SPATIAL_DIMENSIONS
protected

Definition at line 133 of file mitkPAVolume.h.

Referenced by Volume().


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