7 #ifndef __FWDATA_IMAGE_HPP__ 8 #define __FWDATA_IMAGE_HPP__ 10 #include "fwData/Array.hpp" 11 #include "fwData/factory/new.hpp" 12 #include "fwData/Object.hpp" 14 #include <fwCom/Signal.hpp> 15 #include <fwCom/Signals.hpp> 17 #include <fwTools/DynamicType.hpp> 18 #include <fwTools/Type.hpp> 20 #include <boost/filesystem/path.hpp> 21 #include <boost/shared_array.hpp> 25 fwCampAutoDeclareDataMacro((
fwData)(Image), FWDATA_API);
48 typedef ::fwData::Array::SizeType
SizeType;
60 typedef SizeType::value_type IndexType;
61 typedef size_t BufferIndexType;
62 typedef std::uint8_t BufferType;
63 typedef ::boost::shared_array< BufferType > SharedArray;
74 FWDATA_API
virtual ~
Image() noexcept;
77 FWDATA_API
void shallowCopy( const
Object::csptr& _source ) override;
80 FWDATA_API
void cachedDeepCopy(const
Object::csptr& _source, DeepCopyCacheType& cache) override;
83 FWDATA_API
void copyInformation(
Image::csptr _source );
86 FWDATA_API
size_t getNumberOfDimensions() const;
92 FWDATA_API const SpacingType& getSpacing() const;
93 FWDATA_API
void setSpacing(const SpacingType& spacing);
99 FWDATA_API const OriginType& getOrigin() const;
100 FWDATA_API
void setOrigin(const OriginType& origin);
106 FWDATA_API const SizeType& getSize() const;
107 FWDATA_API
void setSize(const SizeType& size);
113 double getWindowCenter () const;
115 void setWindowCenter (
double val);
121 double getWindowWidth () const;
122 void setWindowWidth (
double val);
128 size_t getNumberOfComponents() const;
130 void setNumberOfComponents(
size_t val);
140 FWDATA_API
void setDataArray(::
fwData::
Array::sptr array,
bool copyArrayInfo = true);
143 FWDATA_API ::
fwData::
Array::sptr getDataArray() const;
148 FWDATA_API
void setType(::
fwTools::Type type);
149 FWDATA_API
void setType(const
std::
string& type);
150 FWDATA_API ::
fwTools::Type getType() const;
154 FWDATA_API ::
fwTools::DynamicType getPixelType() const;
166 FWDATA_API
size_t allocate();
167 FWDATA_API
size_t allocate(SizeType::value_type
x, SizeType::value_type y, SizeType::value_type z,
168 const ::
fwTools::Type& type,
size_t numberOfComponents = 1);
169 FWDATA_API
size_t allocate(const SizeType& size, const ::
fwTools::Type& type,
size_t numberOfComponents = 1);
173 FWDATA_API
size_t getSizeInBytes() const;
175 FWDATA_API
size_t getAllocatedSizeInBytes() const;
183 FWDATA_API static const ::
fwCom::Signals::SignalKeyType s_BUFFER_MODIFIED_SIG;
187 FWDATA_API static const ::
fwCom::Signals::SignalKeyType s_LANDMARK_ADDED_SIG;
191 FWDATA_API static const ::
fwCom::Signals::SignalKeyType s_LANDMARK_REMOVED_SIG;
195 FWDATA_API static const ::
fwCom::Signals::SignalKeyType s_LANDMARK_DISPLAYED_SIG;
199 FWDATA_API static const ::
fwCom::Signals::SignalKeyType s_DISTANCE_DISPLAYED_SIG;
203 FWDATA_API static const ::
fwCom::Signals::SignalKeyType s_DISTANCE_ADDED_SIG;
207 FWDATA_API static const ::
fwCom::Signals::SignalKeyType s_DISTANCE_REMOVED_SIG;
211 FWDATA_API static const ::
fwCom::Signals::SignalKeyType s_SLICE_INDEX_MODIFIED_SIG;
215 FWDATA_API static const ::
fwCom::Signals::SignalKeyType s_SLICE_TYPE_MODIFIED_SIG;
219 FWDATA_API static const ::
fwCom::Signals::SignalKeyType s_VISIBILITY_MODIFIED_SIG;
223 FWDATA_API static const ::
fwCom::Signals::SignalKeyType s_TRANSPARENCY_MODIFIED_SIG;
238 SpacingType m_spacing;
245 double m_windowCenter;
246 double m_windowWidth;
250 size_t m_numberOfComponents;
258 inline
double Image::getWindowCenter ()
const 260 return m_windowCenter;
267 m_windowCenter = val;
274 return m_windowWidth;
288 return m_numberOfComponents;
295 m_numberOfComponents = val;
302 #endif // __FWDATA_IMAGE_HPP__
void setWindowWidth(double val)
Get/set preferred window width.
Namespace containing fw4spl communication tools.
This class define a 3D point.
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
size_t getNumberOfComponents() const
Get/set preferred window center.
Provides a way to manage a view on a multidimentionnal array.
#define fwCoreClassDefinitionsWithFactoryMacro(_classinfo_, _parameters_, _factory_)
Generate common construction methods for classes with one factory.
double getWindowWidth() const
Get/set preferred window width.
void setNumberOfComponents(size_t val)
Get/set preferred window center.
Base class for each data object.
This class defines a list of points.
#define fwCoreAllowSharedFromThis()
Generate getSptr and getConstSptr methods.
std::vector< double > SpacingType
Image spacing type.
Contains the representation of the data objects used in the framework.
This class defines an image.
void setWindowCenter(double val)
Get/set preferred window center.
::fwData::Array::SizeType SizeType
Image size type.
std::vector< double > OriginType
Image origin type.