fw4spl
|
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... | |
This class contains helpers for medical image fields.
Definition at line 43 of file MedicalImageHelpers.hpp.
|
static |
Check if the image has a comment field.
If the image has no comment field, this is added with default name ("Original image").
[in] | _pImg | image which contains the comment field. |
Definition at line 147 of file MedicalImageHelpers.cpp.
References fwDataTools::fieldHelper::Image::m_commentId, and SLM_ASSERT.
|
static |
Check if the image has slice index fields.
If the image hasn't frontal, axial and sagittal slice index fields, they are added.
_pImg | image which must contains the field. |
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().
|
static |
Check if the image is valid.
The image size must be > 1 for each dimension.
[in] | _pImg | image checked. |
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().
|
static |
Check if the image has a landmark field.
If the image hasn't landmark field, it is added and the method return true.
[in] | _pImg | image which must contains the field. |
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().
|
static |
Get the X,Y,Z slice position.
[in] | _pImg | current image. |
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().
|
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.
[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().
|
static |
Return a buffer of image type's size, containing 'value' casted to image data type.
[in] | image | : reference image |
[in] | value | : value to map |
Referenced by setPixel().
|
static |
Initialized an image to 0 from image source (same field, pixel type, buffer size...).
[in] | imgSrc | image which gives information (field, pixel type, buffer size...). |
[in] | imgToInitialize | image to initialized (if not null). |
Definition at line 166 of file MedicalImageHelpers.cpp.
References checkImageValidity(), fwData::Object::copy(), and SLM_ASSERT.
|
static |
Return true if the pixel value is null.
[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().
|
static |
Set a pixel value.
[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.
|
static |
Set a pixel value.
[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.