fw4spl
fwDataTools::fieldHelper::MedicalImageHelpers Class Reference

This class contains helpers for medical image fields. More...

#include <MedicalImageHelpers.hpp>

Public Member Functions

template<typename T >
std::shared_ptr< ::fwData::Image::BufferType > getPixelBufferInImageSpace (::fwData::Image::sptr image, T &value)
 

Static Public Member Functions

static FWDATATOOLS_API bool checkLandmarks (::fwData::Image::sptr _pImg)
 Check if the image has a landmark field. More...
 
static FWDATATOOLS_API bool checkImageValidity (::fwData::Image::csptr _pImg)
 Check if the image is valid. More...
 
static FWDATATOOLS_API bool checkImageSliceIndex (::fwData::Image::sptr _pImg)
 Check if the image has slice index fields. More...
 
static FWDATATOOLS_API::fwData::Point::sptr getImageSliceIndices (::fwData::Image::sptr _pImg)
 Get the X,Y,Z slice position. More...
 
static FWDATATOOLS_API bool checkComment (::fwData::Image::sptr _pImg)
 Check if the image has a comment field. More...
 
static FWDATATOOLS_API::fwData::Image::sptr initialize (::fwData::Image::sptr imgSrc,::fwData::Image::sptr imgToInitialize=::fwData::Image::sptr())
 Initialized an image to 0 from image source (same field, pixel type, buffer size...). More...
 
template<typename INT_INDEX >
static bool isPixelNull (::fwData::Image::sptr image, INT_INDEX &point)
 Return true if the pixel value is null. More...
 
static FWDATATOOLS_API bool isBufNull (const ::fwData::Image::BufferType *buf, const unsigned int len)
 
template<typename T , typename INT_INDEX >
static void setPixel (::fwData::Image::sptr image, INT_INDEX &point, T &value)
 Set a pixel value. More...
 
template<typename T >
static void setPixel (::fwData::Image::sptr pImage,::fwData::Point::sptr point, T &value)
 Set a pixel value. More...
 
template<typename T >
static std::shared_ptr< ::fwData::Image::BufferType > getPixelBufferInImageSpace (::fwData::Image::sptr image, T &value)
 Return a buffer of image type's size, containing 'value' casted to image data type. More...
 
template<typename MINMAXTYPE >
static void getMinMax (const ::fwData::Image::csptr _img, MINMAXTYPE &_min, MINMAXTYPE &_max)
 Return minimum and maximum values contained in image. If image min or max value is out of MINMAXTYPE range, they are clamped to MINMAXTYPE capacity. More...
 

Detailed Description

This class contains helpers for medical image fields.

Definition at line 43 of file MedicalImageHelpers.hpp.

Member Function Documentation

bool fwDataTools::fieldHelper::MedicalImageHelpers::checkComment ( ::fwData::Image::sptr  _pImg)
static

Check if the image has a comment field.

If the image has no comment field, this is added with default name ("Original image").

Parameters
[in]_pImgimage which contains the comment field.
Returns
true if the comment field is added.

Definition at line 147 of file MedicalImageHelpers.cpp.

References fwDataTools::fieldHelper::Image::m_commentId, and SLM_ASSERT.

bool fwDataTools::fieldHelper::MedicalImageHelpers::checkImageSliceIndex ( ::fwData::Image::sptr  _pImg)
static

Check if the image has slice index fields.

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

Parameters
_pImgimage which must contains the field.
Returns
true if the fields are added.

Definition at line 67 of file MedicalImageHelpers.cpp.

References fwData::Object::getField(), fwDataTools::fieldHelper::Image::m_axialSliceIndexId, fwDataTools::fieldHelper::Image::m_frontalSliceIndexId, fwDataTools::fieldHelper::Image::m_sagittalSliceIndexId, and SLM_ASSERT.

Referenced by getImageSliceIndices().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool fwDataTools::fieldHelper::MedicalImageHelpers::checkImageValidity ( ::fwData::Image::csptr  _pImg)
static

Check if the image is valid.

The image size must be > 1 for each dimension.

Parameters
[in]_pImgimage checked.
Returns
true if the image is valid.

Definition at line 44 of file MedicalImageHelpers.cpp.

References SLM_TRACE_FUNC.

Referenced by visuVTKAdaptor::STexture::applyTexture(), visuVTKAdaptor::SImagesBlend::checkImageInformations(), scene2D::adaptor::SNegato::configuring(), fwDataTools::helper::MedicalImageAdaptor::createTransferFunction(), fwDataTools::helper::Image::createTransferFunctionPool(), initialize(), visuVTKAdaptor::SSliceFollowerCamera::stopping(), visuVTKAdaptor::SImagesProbeCursor::stopping(), uiImageQt::SliceIndexPositionEditor::updateSliceIndexFromImg(), uiMeasurement::action::AddLandmark::updating(), uiMeasurement::action::ShowLandmark::updating(), uiMeasurement::action::RemoveLandmark::updating(), uiMeasurement::action::LoadLandmark::updating(), uiMeasurement::action::SaveLandmark::updating(), uiMeasurement::action::RemoveDistance::updating(), visuVTKAdaptor::SVectorField::updating(), uiMeasurement::action::ShowDistance::updating(), uiMeasurement::action::SFocusLandmark::updating(), uiImageQt::ImageInfo::updating(), uiImageQt::ImageTransparency::updating(), scene2D::processing::SComputeHistogram::updating(), vtkSimpleNegato::SRenderer::updating(), uiImageQt::SliceIndexPositionEditor::updating(), visuVTKAdaptor::SSlicesCursor::updating(), visuVTKAdaptor::SImageText::updating(), uiImageQt::WindowLevel::updating(), visuVTKAdaptor::SImage::updating(), visuVTKAdaptor::SImageSlice::updating(), visuVTKVRAdaptor::SVolume::updating(), and visuVTKAdaptor::SNegatoMPR::updating().

+ Here is the caller graph for this function:

bool fwDataTools::fieldHelper::MedicalImageHelpers::checkLandmarks ( ::fwData::Image::sptr  _pImg)
static

Check if the image has a landmark field.

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

Parameters
[in]_pImgimage which must contains the field.
Returns
true if the field is added.

Definition at line 27 of file MedicalImageHelpers.cpp.

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

Referenced by uiMeasurement::action::LoadLandmark::stopping(), and uiMeasurement::action::AddLandmark::updating().

+ Here is the caller graph for this function:

fwData::Point::sptr fwDataTools::fieldHelper::MedicalImageHelpers::getImageSliceIndices ( ::fwData::Image::sptr  _pImg)
static

Get the X,Y,Z slice position.

Parameters
[in]_pImgcurrent image.
Returns
X,Y,Z slice position of the current image if exist field exist else install field and return (imgSizeX/2,imgSizeY/2,imgSizeZ/2).

Definition at line 127 of file MedicalImageHelpers.cpp.

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

Referenced by uiMeasurement::action::AddLandmark::updating().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename MINMAXTYPE >
void fwDataTools::fieldHelper::MedicalImageHelpers::getMinMax ( const ::fwData::Image::csptr  _img,
MINMAXTYPE &  _min,
MINMAXTYPE &  _max 
)
static

Return minimum and maximum values contained in image. If image min or max value is out of MINMAXTYPE range, they are clamped to MINMAXTYPE capacity.

Parameters
[in]_img: image
[out]_min: minimum value
[out]_max: maximum value

Definition at line 391 of file MedicalImageHelpers.hpp.

Referenced by fwDataTools::helper::MedicalImageAdaptor::createTransferFunction(), fwDataTools::helper::Image::createTransferFunctionPool(), uiImageQt::WindowLevel::info(), and uiImageQt::WindowLevel::updating().

+ Here is the caller graph for this function:

template<typename T >
static std::shared_ptr< ::fwData::Image::BufferType > fwDataTools::fieldHelper::MedicalImageHelpers::getPixelBufferInImageSpace ( ::fwData::Image::sptr  image,
T &  value 
)
static

Return a buffer of image type's size, containing 'value' casted to image data type.

Parameters
[in]image: reference image
[in]value: value to map

Referenced by setPixel().

+ Here is the caller graph for this function:

fwData::Image::sptr fwDataTools::fieldHelper::MedicalImageHelpers::initialize ( ::fwData::Image::sptr  imgSrc,
::fwData::Image::sptr  imgToInitialize = ::fwData::Image::sptr() 
)
static

Initialized an image to 0 from image source (same field, pixel type, buffer size...).

Parameters
[in]imgSrcimage which gives information (field, pixel type, buffer size...).
[in]imgToInitializeimage to initialized (if not null).
Returns
Returns initialized image.

Definition at line 166 of file MedicalImageHelpers.cpp.

References checkImageValidity(), fwData::Object::copy(), and SLM_ASSERT.

+ Here is the call graph for this function:

template<typename INT_INDEX >
bool fwDataTools::fieldHelper::MedicalImageHelpers::isPixelNull ( ::fwData::Image::sptr  image,
INT_INDEX &  point 
)
static

Return true if the pixel value is null.

Parameters
[in]image: image containing the pixel
[in]point: the coordinate of the pixel in the image.

Definition at line 311 of file MedicalImageHelpers.hpp.

References fwDataTools::helper::Image::getPixelBuffer().

+ Here is the call graph for this function:

template<typename T , typename INT_INDEX >
void fwDataTools::fieldHelper::MedicalImageHelpers::setPixel ( ::fwData::Image::sptr  image,
INT_INDEX &  point,
T &  value 
)
static

Set a pixel value.

Parameters
[in]image: image containing the pixel
[in]point: coordinate of the pixel
[in]value: the pixel value

Definition at line 247 of file MedicalImageHelpers.hpp.

References getPixelBufferInImageSpace(), and SPTR.

+ Here is the call graph for this function:

template<typename T >
void fwDataTools::fieldHelper::MedicalImageHelpers::setPixel ( ::fwData::Image::sptr  pImage,
::fwData::Point::sptr  point,
T &  value 
)
static

Set a pixel value.

Parameters
[in]pImage: image containing the pixel
[in]point: coordinate of the pixel
[in]value: the pixel value

Definition at line 239 of file MedicalImageHelpers.hpp.


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