fw4spl
core/fwDataTools/include/fwDataTools/helper/Image.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2017.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWDATATOOLS_HELPER_IMAGE_HPP__
8 #define __FWDATATOOLS_HELPER_IMAGE_HPP__
9 
10 #include "fwDataTools/config.hpp"
11 
12 #include <fwData/Image.hpp>
13 
14 namespace fwDataTools
15 {
16 namespace helper
17 {
18 
23 class FWDATATOOLS_CLASS_API Image
24 {
25 
26 public:
27  fwCoreClassFactoryMacro((Image), (((::fwData::Image::sptr))), new Image )
28 
29  typedef ::fwData::Image::SizeType SizeType;
30  typedef ::fwData::Image::IndexType IndexType;
31  typedef ::fwData::Image::BufferType BufferType;
32  typedef ::fwData::Image::BufferIndexType BufferIndexType;
33 
35  FWDATATOOLS_API Image( ::fwData::Image::sptr image );
36 
38  FWDATATOOLS_API virtual ~Image();
39 
47  FWDATATOOLS_API bool createLandmarks();
48 
55  FWDATATOOLS_API bool createTransferFunctionPool();
56 
64  FWDATATOOLS_API bool createImageSliceIndex();
65 
67  FWDATATOOLS_API void notify();
68 
70  FWDATATOOLS_API void* getBuffer();
71 
75  FWDATATOOLS_API void* getPixelBuffer( SizeType::value_type x, SizeType::value_type y, SizeType::value_type z );
76 
77  FWDATATOOLS_API void* getPixelBuffer( IndexType index );
78 
79  FWDATATOOLS_API void setPixelBuffer( IndexType index, Image::BufferType* pixBuf);
80 
81  FWDATATOOLS_API const std::string getPixelAsString(SizeType::value_type x,
82  SizeType::value_type y,
83  SizeType::value_type z );
84  // @}
85 
87  FWDATATOOLS_API ::fwMemory::BufferObject::Lock getLock() const;
88 
89 private:
90 
91  ::fwData::Image::sptr m_image;
92 
94 
96  bool m_sliceModified;
97 };
98 
99 } // helper
100 } // fwDataTools
101 
102 #endif // __FWDATATOOLS_HELPER_IMAGE_HPP__
103 
The namespace fwDataTools contains classes which provide helpers to manipulate fwData::Object. *.
base class for BufferObject Lock
Defines an helper to modify an fwData::Image by adding few medical fields and create in parallel the ...
#define fwCoreClassFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate methods for classes with one factory.