fw4spl
|
Helpers for medical image. More...
#include <MedicalImageAdaptor.hpp>
Public Types | |
enum | Orientation { X_AXIS = 0, Y_AXIS, Z_AXIS } |
Image orientation. | |
Public Member Functions | |
virtual bool | isA (const std::string &type) const |
virtual FWDATATOOLS_API | ~MedicalImageAdaptor () |
Destructor. Do nothing. | |
virtual FWDATATOOLS_API void | setOrientation (Orientation orientation) |
Set the image orientation. | |
Orientation | getOrientation () const |
Return the image orientation. | |
FWDATATOOLS_API void | setTransferFunction (const ::fwData::TransferFunction::sptr &tf) |
Set the current TransferFunction. | |
Static Public Member Functions | |
static bool | isTypeOf (const std::string &type) |
Protected Member Functions | |
FWDATATOOLS_API | MedicalImageAdaptor () |
Constructor. Do nothing. | |
FWDATATOOLS_API void | setOrientation (int orientation) |
Set the orientation of the image. More... | |
FWDATATOOLS_API void | getImageSpacing (double spacing[3]) const |
Get the image spacing. More... | |
FWDATATOOLS_API void | getImageOrigin (double origin[3]) const |
Get the image origin. More... | |
FWDATATOOLS_API void | getImageDataSize (int size[3]) const |
Get the image data size (number of slices). More... | |
FWDATATOOLS_API void | getImageSize (double size[3]) const |
Get the image size ( = dataSize * spacing ). More... | |
FWDATATOOLS_API void | getCurrentSliceCenter (double center[3]) |
Get the slice center. More... | |
FWDATATOOLS_API void | worldToSliceIndex (const double world[3], int index[3]) |
Convert world coordinates to slice index coordinates. More... | |
FWDATATOOLS_API void | worldToImageSliceIndex (const double world[3], int index[3]) |
Convert coordinates in the world to coordinates in the image. More... | |
FWDATATOOLS_API void | sliceIndexToWorld (const int index[3], double world[3]) |
Convert from world coordinates system to image coordinates system. More... | |
FWDATATOOLS_API::fwData::Image::sptr | getImage () const |
Return the image. | |
template<typename FLOAT_ARRAY_3 > | |
void | getImageSpacing (FLOAT_ARRAY_3 spacing) |
Get the image spacing. More... | |
template<typename INT_INDEX > | |
void | getImageDataSize (INT_INDEX size) |
Get the image data size (number of slices). More... | |
template<typename WORLD , typename INT_INDEX > | |
void | worldToSliceIndex (const WORLD world, INT_INDEX *index) |
Convert world coordinates to slice index coordinates. More... | |
template<typename WORLD , typename INT_INDEX > | |
void | worldToImageSliceIndex (const WORLD world, INT_INDEX *index) |
Convert coordinates in the world to coordinates in the image. More... | |
FWDATATOOLS_API void | getPlane (double points[4][3], int sliceNumber) |
Return the 4 points of the image plane. More... | |
FWDATATOOLS_API bool | setSliceIndex (const int index[3]) |
Set the slice index. | |
FWDATATOOLS_API void | getSliceIndex (::fwData::Integer::sptr index[3]) |
Get the slice index. | |
FWDATATOOLS_API void | updateImageInfos (::fwData::Image::sptr image) |
Update the image information (slice index, min/max,...) | |
FWDATATOOLS_API void | createTransferFunction (::fwData::Image::sptr image) |
Create and set the default transfer function. More... | |
FWDATATOOLS_API void | setOrCreateTF (const ::fwData::TransferFunction::sptr &_tf, const fwData::Image::sptr &_image) |
Sets the transfer function, creates one if _tf is null (. More... | |
FWDATATOOLS_API::fwData::TransferFunction::sptr | getTransferFunction () const |
Get the current transfer function. | |
Protected Attributes | |
Orientation | m_orientation |
Image orientation. | |
::fwData::Integer::sptr | m_axialIndex |
Axial slice index. | |
::fwData::Integer::sptr | m_frontalIndex |
Frontal slice index. | |
::fwData::Integer::sptr | m_sagittalIndex |
Sagittal slice index. | |
Demangling methods | |
virtual const std::string & | getLeafClassname () const |
return object's classname without its namespace, i.e. BaseObject | |
virtual const std::string & | getClassname () const |
return full object's classname with its namespace, i.e. fwCore::BaseObject | |
static const std::string & | leafClassname () |
return object's classname without its namespace, i.e. BaseObject | |
static const std::string & | classname () |
return object's classname without its namespace, i.e. BaseObject | |
Connections to transfer function | |
typedef ::fwCom::Slot< void()> | UpdateTFPointsSlotType |
Slot called when transfer function points are modified. | |
typedef ::fwCom::Slot< void(double, double)> | UpdateTFWindowingSlotType |
Slot called when transfer function points are modified. | |
UpdateTFPointsSlotType::sptr | m_slotUpdateTFPoints |
Slot called when transfer function points are modified. | |
UpdateTFWindowingSlotType::sptr | m_slotUpdateTFWindowing |
Slot called when transfer function windowing is modified. | |
FWDATATOOLS_API void | installTFConnections () |
Install connections to listen TF modifications. | |
FWDATATOOLS_API void | removeTFConnections () |
Remove the TF connections. | |
FWDATATOOLS_API void | installTFSlots (::fwCom::HasSlots *hasslots) |
Install the slots to managed TF modifications. More... | |
virtual FWDATATOOLS_API void | updateTFPoints () |
Slot: called when transfer function points are modified. | |
virtual FWDATATOOLS_API void | updateTFWindowing (double window, double level) |
Slot: called when transfer function windowing is modified. | |
Helpers for medical image.
The two slots must be reimplemented by the services managing transfer function
Definition at line 39 of file MedicalImageAdaptor.hpp.
|
protected |
Create and set the default transfer function.
Create the image's transfer function pool if if does not exist and then create the defaut transfer function. Set the current transfer function to the default grey-level if no transfer function was set (using setTransferFunction() ).
Definition at line 263 of file MedicalImageAdaptor.cpp.
References fwDataTools::helper::Composite::add(), fwDataTools::fieldHelper::MedicalImageHelpers::checkImageValidity(), fwDataTools::fieldHelper::MedicalImageHelpers::getMinMax(), fwDataTools::fieldHelper::Image::m_transferFunctionCompositeId, fwDataTools::helper::Composite::notify(), and fwData::TransferFunction::s_DEFAULT_TF_NAME.
Referenced by setOrCreateTF(), and scene2D::adaptor::SNegato::starting().
|
protected |
Get the slice center.
[out] | center | : the slice center |
Definition at line 91 of file MedicalImageAdaptor.cpp.
References getImage(), getImageOrigin(), getImageSize(), getImageSpacing(), getSliceIndex(), and m_orientation.
Referenced by visuVTKAdaptor::SSliceFollowerCamera::stopping().
|
protected |
Get the image data size (number of slices).
[out] | size | : the image size |
Definition at line 65 of file MedicalImageAdaptor.cpp.
References getImage().
Referenced by worldToImageSliceIndex().
|
protected |
Get the image data size (number of slices).
[out] | size | : the image size |
Definition at line 271 of file MedicalImageAdaptor.hpp.
|
protected |
Get the image origin.
[out] | origin | : the image origin |
Definition at line 56 of file MedicalImageAdaptor.cpp.
References getImage().
Referenced by getCurrentSliceCenter(), sliceIndexToWorld(), visuVTKAdaptor::SSliceFollowerCamera::stopping(), and worldToSliceIndex().
|
protected |
Get the image size ( = dataSize * spacing ).
[out] | size | : the image size |
Definition at line 75 of file MedicalImageAdaptor.cpp.
References getImage(), and getImageSpacing().
Referenced by getCurrentSliceCenter(), and visuVTKAdaptor::SSliceFollowerCamera::stopping().
|
protected |
Get the image spacing.
[out] | spacing | : the image spacing |
Definition at line 46 of file MedicalImageAdaptor.cpp.
References getImage().
Referenced by getCurrentSliceCenter(), getImageSize(), sliceIndexToWorld(), and worldToSliceIndex().
|
protected |
Get the image spacing.
[out] | spacing | : the image spacing |
Definition at line 261 of file MedicalImageAdaptor.hpp.
|
protected |
Return the 4 points of the image plane.
Definition at line 140 of file MedicalImageAdaptor.cpp.
References getImage(), and m_orientation.
|
protected |
Install the slots to managed TF modifications.
Creates slots to listen TF selection Composite and TransferFunction signals.
Definition at line 368 of file MedicalImageAdaptor.cpp.
References m_slotUpdateTFPoints, m_slotUpdateTFWindowing, updateTFPoints(), and updateTFWindowing().
Referenced by uiImageQt::WindowLevel::WindowLevel().
|
protected |
Sets the transfer function, creates one if _tf is null (.
Connects the TF's signals to the updateTFPoints and updateTFWindowing slots.
Definition at line 307 of file MedicalImageAdaptor.cpp.
References createTransferFunction(), installTFConnections(), removeTFConnections(), and setTransferFunction().
Referenced by visuVTKAdaptor::SImageText::starting(), uiImageQt::WindowLevel::starting(), visuVTKAdaptor::SImage::starting(), visuVTKAdaptor::SImageText::swapping(), scene2D::adaptor::SNegato::swapping(), uiImageQt::WindowLevel::swapping(), and visuVTKAdaptor::SImage::swapping().
|
protected |
Set the orientation of the image.
[in] | orientation | must be 0 (X_AXIS), 1 (Y_AXIS) or 2 (Z_AXIS). |
Definition at line 125 of file MedicalImageAdaptor.cpp.
References OSLM_ASSERT, and setOrientation().
|
protected |
Convert from world coordinates system to image coordinates system.
[in] | index | : coordinate in the image |
[out] | world | : coordinate in the world |
Definition at line 164 of file MedicalImageAdaptor.cpp.
References getImageOrigin(), and getImageSpacing().
Referenced by visuVTKAdaptor::SImage3DCursor::swapping(), and visuVTKAdaptor::SImage3DCursor::updating().
|
protected |
Convert coordinates in the world to coordinates in the image.
[in] | world | : coordinate in the world |
[out] | index | : coordinate in the image |
Definition at line 195 of file MedicalImageAdaptor.cpp.
References getImageDataSize(), and worldToSliceIndex().
Referenced by visuVTKAdaptor::SImagesProbeCursor::stopping().
|
protected |
Convert coordinates in the world to coordinates in the image.
[in] | world | : coordinate in the world |
[out] | index | : coordinate in the image |
Definition at line 299 of file MedicalImageAdaptor.hpp.
|
protected |
Convert world coordinates to slice index coordinates.
[in] | world | : coordinate in the world |
[out] | index | : coordinate in the slice index |
Definition at line 178 of file MedicalImageAdaptor.cpp.
References getImageOrigin(), and getImageSpacing().
Referenced by worldToImageSliceIndex().
|
protected |
Convert world coordinates to slice index coordinates.
[in] | world | : coordinate in the world |
[out] | index | : coordinate in the slice index |
Definition at line 282 of file MedicalImageAdaptor.hpp.