7 #ifndef __FWDATATOOLS_HELPER_MEDICALIMAGEADAPTOR_HPP__ 8 #define __FWDATATOOLS_HELPER_MEDICALIMAGEADAPTOR_HPP__ 10 #include "fwDataTools/config.hpp" 11 #include "fwDataTools/helper/ImageGetter.hpp" 13 #include <fwCom/helper/SigSlotConnection.hpp> 14 #include <fwCom/Slot.hpp> 15 #include <fwCom/Slots.hpp> 17 #include <fwData/Composite.hpp> 18 #include <fwData/Integer.hpp> 19 #include <fwData/String.hpp> 20 #include <fwData/TransferFunction.hpp> 57 FWDATATOOLS_API
virtual void setOrientation( Orientation orientation );
66 FWDATATOOLS_API
void setTransferFunction( const ::fwData::TransferFunction::sptr& tf );
77 FWDATATOOLS_API
void setOrientation(
int orientation );
83 FWDATATOOLS_API
void getImageSpacing(
double spacing[3])
const;
89 FWDATATOOLS_API
void getImageOrigin(
double origin[3])
const;
95 FWDATATOOLS_API
void getImageDataSize(
int size[3])
const;
101 FWDATATOOLS_API
void getImageSize(
double size[3])
const;
107 FWDATATOOLS_API
void getCurrentSliceCenter(
double center[3]);
114 FWDATATOOLS_API
void worldToSliceIndex(
const double world[3],
int index[3] );
121 FWDATATOOLS_API
void worldToImageSliceIndex(
const double world[3],
int index[3] );
128 FWDATATOOLS_API
void sliceIndexToWorld(
const int index[3],
double world[3] );
131 FWDATATOOLS_API ::fwData::Image::sptr getImage()
const;
137 template<
typename FLOAT_ARRAY_3 >
138 void getImageSpacing(FLOAT_ARRAY_3 spacing);
144 template<
typename INT_INDEX >
145 void getImageDataSize(INT_INDEX size);
152 template<
typename WORLD,
typename INT_INDEX >
153 void worldToSliceIndex(
const WORLD world, INT_INDEX* index );
160 template<
typename WORLD,
typename INT_INDEX >
161 void worldToImageSliceIndex(
const WORLD world, INT_INDEX* index );
170 FWDATATOOLS_API
void getPlane(
double points[4][3],
int sliceNumber );
173 FWDATATOOLS_API
bool setSliceIndex(
const int index[3]);
175 FWDATATOOLS_API
void getSliceIndex(::fwData::Integer::sptr index[3]);
178 FWDATATOOLS_API
void updateImageInfos( ::fwData::Image::sptr image );
187 FWDATATOOLS_API
void createTransferFunction( ::fwData::Image::sptr image );
194 FWDATATOOLS_API
void setOrCreateTF(const ::fwData::TransferFunction::sptr& _tf,
const fwData::Image::sptr& _image);
197 FWDATATOOLS_API ::fwData::TransferFunction::sptr getTransferFunction()
const;
204 FWDATATOOLS_API
void installTFConnections();
208 FWDATATOOLS_API
void removeTFConnections();
220 FWDATATOOLS_API
virtual void updateTFPoints();
223 FWDATATOOLS_API
virtual void updateTFWindowing(
double window,
double level);
237 Orientation m_orientation;
250 ::fwData::Image::wptr m_weakImage;
253 ::fwData::TransferFunction::wptr m_transferFunction;
260 template<
typename FLOAT_ARRAY_3 >
263 ::fwData::Image::sptr image = this->getImage();
265 const ::fwData::Image::SpacingType imSpacing = image->getSpacing();
266 std::copy(imSpacing.begin(), imSpacing.end(), spacing);
270 template<
typename INT_INDEX >
273 ::fwData::Image::sptr image = this->getImage();
275 const ::fwData::Image::SizeType imSize = image->getSize();
276 std::copy(imSize.begin(), imSize.end(), size);
281 template<
typename WORLD,
typename INT_INDEX >
285 this->getImageSpacing(spacing);
287 this->getImageOrigin(origin);
288 for (
int i = 0; i < 3; ++i )
291 static_cast< INT_INDEX
>( ( (world[i] - origin[i])/spacing[i] ) +
292 ( ( (world[i] - origin[i])/spacing[i] ) >= 0 ? 0.5 : -0.5 ) );
298 template<
typename WORLD,
typename INT_INDEX >
301 INT_INDEX imageSize[3];
302 this->getImageDataSize(imageSize);
303 this->worldToSliceIndex(world, index);
306 for (
int i = 0; i < 3; i++)
308 INT_INDEX max = imageSize[i]-1;
314 else if (idval > max)
325 #endif // __FWDATATOOLS_HELPER_MEDICALIMAGEADAPTOR_HPP__
This class proposes a mapping between a SlotKeyType and a SlotBase.
This class provides few tools to ease connect/disconnect between a signal emitter and a slot receiver...
#define fwCoreBaseClassDefinitionsMacro(_classinfo_)
Generate common code for a base class (Interfaces, Abstract classes, ...)