fw4spl
fwDataTools::helper::Image Class Reference

Defines an helper to modify an fwData::Image by adding few medical fields and create in parallel the message to announce these modifications. More...

#include <Image.hpp>

Public Types

typedef ::fwData::Image::SizeType SizeType
 
typedef ::fwData::Image::IndexType IndexType
 
typedef ::fwData::Image::BufferType BufferType
 
typedef ::fwData::Image::BufferIndexType BufferIndexType
 

Public Member Functions

FWDATATOOLS_API Image (::fwData::Image::sptr image)
 Constructor. Initialize parameters.
 
virtual FWDATATOOLS_API ~Image ()
 Destrucotr. Do nothing.
 
FWDATATOOLS_API bool createLandmarks ()
 Create landmark fields if not exist, NOT GENERATE MESSAGE. More...
 
FWDATATOOLS_API bool createTransferFunctionPool ()
 Create transfer function pool if the pool is not present, NOT GENERATE MESSAGE. More...
 
FWDATATOOLS_API bool createImageSliceIndex ()
 Create slice index if indexes are not present, NOT GENERATE MESSAGE. More...
 
FWDATATOOLS_API void notify ()
 Send the message of modification.
 
FWDATATOOLS_API void * getBuffer ()
 Returns image buffer.
 
FWDATATOOLS_API::fwMemory::BufferObject::Lock getLock () const
 Returns a copy of current lock on image.
 
FWDATATOOLS_API void * getPixelBuffer (SizeType::value_type x, SizeType::value_type y, SizeType::value_type z)
 Helpers for 3D images.
 
FWDATATOOLS_API void * getPixelBuffer (IndexType index)
 Helpers for 3D images.
 
FWDATATOOLS_API void setPixelBuffer (IndexType index, Image::BufferType *pixBuf)
 Helpers for 3D images.
 
FWDATATOOLS_API const std::string getPixelAsString (SizeType::value_type x, SizeType::value_type y, SizeType::value_type z)
 Helpers for 3D images.
 

Friends

class ::boost::serialization::access
 
template<class , class >
struct ::boost::python::objects::pointer_holder
 
template<class , class , class >
class ::fwTools::ClassFactory
 
class ::fwTools::Factory
 

Detailed Description

Defines an helper to modify an fwData::Image by adding few medical fields and create in parallel the message to announce these modifications.

Definition at line 23 of file core/fwDataTools/include/fwDataTools/helper/Image.hpp.

Member Function Documentation

bool fwDataTools::helper::Image::createImageSliceIndex ( )

Create slice index if indexes are not present, NOT GENERATE MESSAGE.

If the image hasn't frontal, axial and sagittal slice index fields, they are added.

Returns
true if the fields are added.

Definition at line 112 of file core/fwDataTools/src/fwDataTools/helper/Image.cpp.

References fwDataTools::fieldHelper::Image::m_axialSliceIndexId, fwDataTools::fieldHelper::Image::m_frontalSliceIndexId, fwDataTools::fieldHelper::Image::m_sagittalSliceIndexId, and SLM_ASSERT.

bool fwDataTools::helper::Image::createLandmarks ( )

Create landmark fields if not exist, NOT GENERATE MESSAGE.

If the image hasn't landmark field, it is added and the method return true.

Returns
true if the field is added.

Definition at line 47 of file core/fwDataTools/src/fwDataTools/helper/Image.cpp.

References fwDataTools::fieldHelper::Image::m_imageLandmarksId.

bool fwDataTools::helper::Image::createTransferFunctionPool ( )

Create transfer function pool if the pool is not present, NOT GENERATE MESSAGE.

If the image has not transfer functions, the pool is created and a grey level transfer function is added.

Definition at line 64 of file core/fwDataTools/src/fwDataTools/helper/Image.cpp.

References fwDataTools::helper::Composite::add(), fwDataTools::fieldHelper::MedicalImageHelpers::checkImageValidity(), fwDataTools::fieldHelper::MedicalImageHelpers::getMinMax(), fwDataTools::fieldHelper::Image::m_transferFunctionCompositeId, fwDataTools::helper::Composite::notify(), fwDataTools::helper::Field::notify(), fwData::TransferFunction::s_DEFAULT_TF_NAME, and fwDataTools::helper::Field::setField().

+ Here is the call graph for this function:


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