FAST  3.2.0
Framework for Heterogeneous Medical Image Computing and Visualization
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
fast::Image Class Reference

#include <Image.hpp>

+ Inheritance diagram for fast::Image:
+ Collaboration diagram for fast::Image:

Public Member Functions

void createFromImage (Image::pointer image)
 
void create (VectorXui size, DataType type, uint nrOfChannels)
 
void create (uint width, uint height, DataType type, uint nrOfChannels)
 
void create (uint width, uint height, uint depth, DataType type, uint nrOfChannels)
 
void create (VectorXui size, DataType type, uint nrOfChannels, ExecutionDevice::pointer device, const void *const data)
 
void create (uint width, uint height, DataType type, uint nrOfChannels, ExecutionDevice::pointer device, const void *const data)
 
void create (uint width, uint height, uint depth, DataType type, uint nrOfChannels, ExecutionDevice::pointer device, const void *const data)
 
void create (VectorXui size, DataType type, uint nrOfChannels, const void *const data)
 
void create (uint width, uint height, DataType type, uint nrOfChannels, const void *const data)
 
void create (uint width, uint height, uint depth, DataType type, uint nrOfChannels, const void *const data)
 
template<class T >
void create (uint width, uint height, DataType type, uint nrOfChannels, ExecutionDevice::pointer device, std::unique_ptr< T > data)
 
template<class T >
void create (uint width, uint height, uint depth, DataType type, uint nrOfChannels, ExecutionDevice::pointer device, std::unique_ptr< T > data)
 
template<class T >
void create (VectorXui, DataType type, uint nrOfChannels, ExecutionDevice::pointer device, std::unique_ptr< T > ptr)
 
template<class T >
void create (uint width, uint height, DataType type, uint nrOfChannels, std::unique_ptr< T > ptr)
 
template<class T >
void create (uint width, uint height, uint depth, DataType type, uint nrOfChannels, std::unique_ptr< T > ptr)
 
template<class T >
void create (VectorXui, DataType type, uint nrOfChannels, std::unique_ptr< T > ptr)
 
OpenCLImageAccess::pointer getOpenCLImageAccess (accessType type, OpenCLDevice::pointer)
 
OpenCLBufferAccess::pointer getOpenCLBufferAccess (accessType type, OpenCLDevice::pointer)
 
ImageAccess::pointer getImageAccess (accessType type)
 
 ~Image ()
 
int getWidth () const
 
int getHeight () const
 
int getDepth () const
 
int getNrOfVoxels () const
 
Vector3ui getSize () const
 
uchar getDimensions () const
 
DataType getDataType () const
 
int getNrOfChannels () const
 
Vector3f getSpacing () const
 
void setSpacing (Vector3f spacing)
 
void setSpacing (float x, float y, float z)
 
float calculateMaximumIntensity ()
 
float calculateMinimumIntensity ()
 
float calculateAverageIntensity ()
 
Image::pointer copy (ExecutionDevice::pointer device)
 
Image::pointer crop (VectorXi offset, VectorXi size, bool allowOutOfBoundsCropping=false)
 
void fill (float value)
 
DataBoundingBox getTransformedBoundingBox () const override
 
DataBoundingBox getBoundingBox () const override
 
void free (ExecutionDevice::pointer device) override
 
void freeAll () override
 
- Public Member Functions inherited from fast::SpatialDataObject
 SpatialDataObject ()
 
SceneGraphNode::pointer getSceneGraphNode () const
 
- Public Member Functions inherited from fast::DataObject
 DataObject ()
 
void setMetadata (std::string name, std::string value)
 
void setMetadata (std::unordered_map< std::string, std::string > metadata)
 
std::string getMetadata (std::string name) const
 
std::unordered_map< std::string, std::string > getMetadata () const
 
void deleteMetadata (std::string name)
 
uint64_t getTimestamp () const
 
void updateModifiedTimestamp ()
 
virtual ~DataObject ()
 
virtual std::string getNameOfClass () const =0
 
uint64_t getCreationTimestamp () const
 
void setCreationTimestamp (uint64_t timestamp)
 
void setLastFrame (std::string streamer)
 
bool isLastFrame ()
 
bool isLastFrame (std::string streamer)
 
std::unordered_set< std::string > getLastFrame ()
 
void setFrameData (std::string name, std::string value)
 
std::string getFrameData (std::string name)
 
std::unordered_map< std::string, std::string > getFrameData ()
 
void accessFinished ()
 
- Public Member Functions inherited from fast::Object
 Object ()
 
virtual ~Object ()
 
ReportergetReporter ()
 

Protected Member Functions

 Image ()
 
void setData (ExecutionDevice::pointer device, void *data)
 
void copyData (ExecutionDevice::pointer device, const void *const data)
 
void findDeviceWithUptodateData (ExecutionDevice::pointer &device, bool &isOpenCLImage)
 
void setAllDataToOutOfDate ()
 
bool isInitialized () const
 
void updateOpenCLImageData (OpenCLDevice::pointer device)
 
void transferCLImageFromHost (OpenCLDevice::pointer device)
 
void transferCLImageToHost (OpenCLDevice::pointer device)
 
void updateOpenCLBufferData (OpenCLDevice::pointer device)
 
void transferCLBufferFromHost (OpenCLDevice::pointer device)
 
void transferCLBufferToHost (OpenCLDevice::pointer device)
 
void updateHostData ()
 
bool hasAnyData ()
 
uint getBufferSize () const
 
void calculateMaxAndMinIntensity ()
 
- Protected Member Functions inherited from fast::DataObject
void blockIfBeingWrittenTo ()
 
void blockIfBeingAccessed ()
 
- Protected Member Functions inherited from fast::Object
ReporterreportError ()
 
ReporterreportWarning ()
 
ReporterreportInfo ()
 
ReporterEnd reportEnd () const
 

Protected Attributes

std::unordered_map< OpenCLDevice::pointer, cl::Image * > mCLImages
 
std::unordered_map< OpenCLDevice::pointer, bool > mCLImagesIsUpToDate
 
std::unordered_map< OpenCLDevice::pointer, cl::Buffer * > mCLBuffers
 
std::unordered_map< OpenCLDevice::pointer, bool > mCLBuffersIsUpToDate
 
unique_pixel_ptr mHostData
 
bool mHostHasData
 
bool mHostDataIsUpToDate
 
uint mWidth
 
uint mHeight
 
uint mDepth
 
uchar mDimensions
 
DataType mType
 
uint mChannels
 
bool mIsInitialized
 
Vector3f mSpacing
 
float mMaximumIntensity
 
float mMinimumIntensity
 
float mAverageIntensity
 
unsigned long mMaxMinTimestamp
 
unsigned long mAverageIntensityTimestamp
 
bool mMaxMinInitialized
 
bool mAverageInitialized
 
- Protected Attributes inherited from fast::SpatialDataObject
DataBoundingBox mBoundingBox
 
- Protected Attributes inherited from fast::DataObject
std::mutex mDataIsBeingWrittenToMutex
 
std::condition_variable mDataIsBeingWrittenToCondition
 
bool mDataIsBeingWrittenTo
 
std::mutex mDataIsBeingAccessedMutex
 
std::condition_variable mDataIsBeingAccessedCondition
 
bool mDataIsBeingAccessed
 
- Protected Attributes inherited from fast::Object
std::weak_ptr< ObjectmPtr
 

Friends

class ImageAccess
 
class OpenCLBufferAccess
 
class OpenCLImageAccess
 

Additional Inherited Members

- Public Types inherited from fast::SpatialDataObject
typedef std::shared_ptr< SpatialDataObjectpointer
 
- Public Types inherited from fast::DataObject
typedef std::shared_ptr< DataObjectpointer
 
- Public Types inherited from fast::Object
typedef std::shared_ptr< Objectpointer
 
- Static Public Member Functions inherited from fast::SpatialDataObject
static std::string getStaticNameOfClass ()
 
- Static Public Member Functions inherited from fast::DataObject
static std::string getStaticNameOfClass ()
 
- Static Public Member Functions inherited from fast::Object
static std::string getStaticNameOfClass ()
 

Constructor & Destructor Documentation

◆ ~Image()

fast::Image::~Image ( )

◆ Image()

fast::Image::Image ( )
protected

Member Function Documentation

◆ calculateAverageIntensity()

float fast::Image::calculateAverageIntensity ( )

◆ calculateMaxAndMinIntensity()

void fast::Image::calculateMaxAndMinIntensity ( )
protected

◆ calculateMaximumIntensity()

float fast::Image::calculateMaximumIntensity ( )

◆ calculateMinimumIntensity()

float fast::Image::calculateMinimumIntensity ( )

◆ copy()

Image::pointer fast::Image::copy ( ExecutionDevice::pointer  device)

Copy image and put contents to specific device

◆ copyData()

void fast::Image::copyData ( ExecutionDevice::pointer  device,
const void *const  data 
)
protected

Copy data to appropriate device

Parameters
device
data

◆ create() [1/15]

void fast::Image::create ( uint  width,
uint  height,
DataType  type,
uint  nrOfChannels 
)

Setup a 2D image object, but does not allocate any memory

Parameters
width
height
type
nrOfChannels

◆ create() [2/15]

void fast::Image::create ( uint  width,
uint  height,
DataType  type,
uint  nrOfChannels,
const void *const  data 
)

Copies 2D data to default device

Parameters
width
height
type
nrOfChannels
data

◆ create() [3/15]

void fast::Image::create ( uint  width,
uint  height,
DataType  type,
uint  nrOfChannels,
ExecutionDevice::pointer  device,
const void *const  data 
)

Copies 2D data to given device

Parameters
width
height
type
nrOfChannels
device
data

◆ create() [4/15]

template<class T >
void fast::Image::create ( uint  width,
uint  height,
DataType  type,
uint  nrOfChannels,
ExecutionDevice::pointer  device,
std::unique_ptr< T >  data 
)

Moves the 2D data pointer to the given device

Parameters
width
height
type
nrOfChannels
device
data

◆ create() [5/15]

template<class T >
void fast::Image::create ( uint  width,
uint  height,
DataType  type,
uint  nrOfChannels,
std::unique_ptr< T >  ptr 
)

Moves the 2D data pointer to the default device

Parameters
width
height
type
nrOfChannels
data

◆ create() [6/15]

void fast::Image::create ( uint  width,
uint  height,
uint  depth,
DataType  type,
uint  nrOfChannels 
)

Setup a 3D image object, but does not allocate any memory.

Parameters
width
height
depth
type
nrOfChannels

◆ create() [7/15]

void fast::Image::create ( uint  width,
uint  height,
uint  depth,
DataType  type,
uint  nrOfChannels,
const void *const  data 
)

Copies 3D data to default device

Parameters
width
height
depth
type
nrOfChannels
data

◆ create() [8/15]

void fast::Image::create ( uint  width,
uint  height,
uint  depth,
DataType  type,
uint  nrOfChannels,
ExecutionDevice::pointer  device,
const void *const  data 
)

Copies 3D data to given device

Parameters
width
height
depth
type
nrOfChannels
device
data

◆ create() [9/15]

template<class T >
void fast::Image::create ( uint  width,
uint  height,
uint  depth,
DataType  type,
uint  nrOfChannels,
ExecutionDevice::pointer  device,
std::unique_ptr< T >  data 
)

Moves the 3D pointer to the given device

Parameters
width
height
depth
type
nrOfChannels
device
data

◆ create() [10/15]

template<class T >
void fast::Image::create ( uint  width,
uint  height,
uint  depth,
DataType  type,
uint  nrOfChannels,
std::unique_ptr< T >  ptr 
)

Moves the 3D data pointer to the default device

Parameters
width
height
depth
type
nrOfChannels
data

◆ create() [11/15]

void fast::Image::create ( VectorXui  size,
DataType  type,
uint  nrOfChannels 
)

Setup a 2D/3D image object, but does not allocate any memory

Parameters
size
type
nrOfChannels

◆ create() [12/15]

void fast::Image::create ( VectorXui  size,
DataType  type,
uint  nrOfChannels,
const void *const  data 
)

Copies 2D/3D data to default device

Parameters
size
type
nrOfChannels
data

◆ create() [13/15]

void fast::Image::create ( VectorXui  size,
DataType  type,
uint  nrOfChannels,
ExecutionDevice::pointer  device,
const void *const  data 
)

Copies 2D/3D data to given device

Parameters
size
type
nrOfChannels
device
data

◆ create() [14/15]

template<class T >
void fast::Image::create ( VectorXui  size,
DataType  type,
uint  nrOfChannels,
ExecutionDevice::pointer  device,
std::unique_ptr< T >  ptr 
)

Moves the 2D/3D pointer to the given device

Template Parameters
T
Parameters
type
nrOfChannels
device
ptr

◆ create() [15/15]

template<class T >
void fast::Image::create ( VectorXui  size,
DataType  type,
uint  nrOfChannels,
std::unique_ptr< T >  ptr 
)

Moves the 2D/3D data pointer to the default device

Template Parameters
T
Parameters
type
nrOfChannels
ptr

◆ createFromImage()

void fast::Image::createFromImage ( Image::pointer  image)

Setup an image object with the same size, data type and pixel spacing as the given image. Does not allocate any memory.

Parameters
imageto copy size and pixel spacing from

◆ crop()

Image::pointer fast::Image::crop ( VectorXi  offset,
VectorXi  size,
bool  allowOutOfBoundsCropping = false 
)

Create a new image which is a cropped version of this image

◆ fill()

void fast::Image::fill ( float  value)

Fill entire image with a value

Parameters
value

◆ findDeviceWithUptodateData()

void fast::Image::findDeviceWithUptodateData ( ExecutionDevice::pointer device,
bool &  isOpenCLImage 
)
protected

◆ free()

void fast::Image::free ( ExecutionDevice::pointer  device)
overridevirtual

Implements fast::DataObject.

◆ freeAll()

void fast::Image::freeAll ( )
overridevirtual

Implements fast::DataObject.

◆ getBoundingBox()

DataBoundingBox fast::Image::getBoundingBox ( ) const
overridevirtual

Reimplemented from fast::SpatialDataObject.

◆ getBufferSize()

uint fast::Image::getBufferSize ( ) const
protected

◆ getDataType()

DataType fast::Image::getDataType ( ) const

◆ getDepth()

int fast::Image::getDepth ( ) const

◆ getDimensions()

uchar fast::Image::getDimensions ( ) const

◆ getHeight()

int fast::Image::getHeight ( ) const

◆ getImageAccess()

ImageAccess::pointer fast::Image::getImageAccess ( accessType  type)

◆ getNrOfChannels()

int fast::Image::getNrOfChannels ( ) const

◆ getNrOfVoxels()

int fast::Image::getNrOfVoxels ( ) const
Returns
the number of pixels/voxels width*height*depth

◆ getOpenCLBufferAccess()

OpenCLBufferAccess::pointer fast::Image::getOpenCLBufferAccess ( accessType  type,
OpenCLDevice::pointer   
)

◆ getOpenCLImageAccess()

OpenCLImageAccess::pointer fast::Image::getOpenCLImageAccess ( accessType  type,
OpenCLDevice::pointer   
)

◆ getSize()

Vector3ui fast::Image::getSize ( ) const

◆ getSpacing()

Vector3f fast::Image::getSpacing ( ) const

◆ getTransformedBoundingBox()

DataBoundingBox fast::Image::getTransformedBoundingBox ( ) const
overridevirtual

Reimplemented from fast::SpatialDataObject.

◆ getWidth()

int fast::Image::getWidth ( ) const

◆ hasAnyData()

bool fast::Image::hasAnyData ( )
protected

◆ isInitialized()

bool fast::Image::isInitialized ( ) const
protected

◆ setAllDataToOutOfDate()

void fast::Image::setAllDataToOutOfDate ( )
protected

◆ setData()

void fast::Image::setData ( ExecutionDevice::pointer  device,
void *  data 
)
protected

Give data to appropriate device

Parameters
device
data

◆ setSpacing() [1/2]

void fast::Image::setSpacing ( float  x,
float  y,
float  z 
)

◆ setSpacing() [2/2]

void fast::Image::setSpacing ( Vector3f  spacing)

◆ transferCLBufferFromHost()

void fast::Image::transferCLBufferFromHost ( OpenCLDevice::pointer  device)
protected

◆ transferCLBufferToHost()

void fast::Image::transferCLBufferToHost ( OpenCLDevice::pointer  device)
protected

◆ transferCLImageFromHost()

void fast::Image::transferCLImageFromHost ( OpenCLDevice::pointer  device)
protected

◆ transferCLImageToHost()

void fast::Image::transferCLImageToHost ( OpenCLDevice::pointer  device)
protected

◆ updateHostData()

void fast::Image::updateHostData ( )
protected

◆ updateOpenCLBufferData()

void fast::Image::updateOpenCLBufferData ( OpenCLDevice::pointer  device)
protected

◆ updateOpenCLImageData()

void fast::Image::updateOpenCLImageData ( OpenCLDevice::pointer  device)
protected

Friends And Related Function Documentation

◆ ImageAccess

friend class ImageAccess
friend

◆ OpenCLBufferAccess

friend class OpenCLBufferAccess
friend

◆ OpenCLImageAccess

friend class OpenCLImageAccess
friend

Member Data Documentation

◆ mAverageInitialized

bool fast::Image::mAverageInitialized
protected

◆ mAverageIntensity

float fast::Image::mAverageIntensity
protected

◆ mAverageIntensityTimestamp

unsigned long fast::Image::mAverageIntensityTimestamp
protected

◆ mChannels

uint fast::Image::mChannels
protected

◆ mCLBuffers

std::unordered_map<OpenCLDevice::pointer, cl::Buffer*> fast::Image::mCLBuffers
protected

◆ mCLBuffersIsUpToDate

std::unordered_map<OpenCLDevice::pointer, bool> fast::Image::mCLBuffersIsUpToDate
protected

◆ mCLImages

std::unordered_map<OpenCLDevice::pointer, cl::Image*> fast::Image::mCLImages
protected

◆ mCLImagesIsUpToDate

std::unordered_map<OpenCLDevice::pointer, bool> fast::Image::mCLImagesIsUpToDate
protected

◆ mDepth

uint fast::Image::mDepth
protected

◆ mDimensions

uchar fast::Image::mDimensions
protected

◆ mHeight

uint fast::Image::mHeight
protected

◆ mHostData

unique_pixel_ptr fast::Image::mHostData
protected

◆ mHostDataIsUpToDate

bool fast::Image::mHostDataIsUpToDate
protected

◆ mHostHasData

bool fast::Image::mHostHasData
protected

◆ mIsInitialized

bool fast::Image::mIsInitialized
protected

◆ mMaximumIntensity

float fast::Image::mMaximumIntensity
protected

◆ mMaxMinInitialized

bool fast::Image::mMaxMinInitialized
protected

◆ mMaxMinTimestamp

unsigned long fast::Image::mMaxMinTimestamp
protected

◆ mMinimumIntensity

float fast::Image::mMinimumIntensity
protected

◆ mSpacing

Vector3f fast::Image::mSpacing
protected

◆ mType

DataType fast::Image::mType
protected

◆ mWidth

uint fast::Image::mWidth
protected

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