7 #include "fwMedData/DicomSeries.hpp" 9 #include <fwData/Exception.hpp> 10 #include <fwData/registry/macros.hpp> 12 #include <fwMemory/stream/in/Raw.hpp> 14 #include <boost/filesystem/operations.hpp> 23 m_numberOfInstances(0),
24 m_firstInstanceNumber(0)
38 DicomSeries::csptr other = DicomSeries::dynamicConstCast(_source);
40 "Unable to copy" + (_source ? _source->getClassname() : std::string(
"<NULL>"))
56 DicomSeries::csptr other = DicomSeries::dynamicConstCast(_source);
58 "Unable to copy" + (_source ? _source->getClassname() : std::string(
"<NULL>"))
69 for(
const auto& elt : other->m_dicomContainer)
71 const ::fwMemory::BufferObject::sptr& bufferSrc = elt.second;
74 if( !bufferSrc->isEmpty() )
76 ::fwMemory::BufferObject::sptr bufferDest = ::fwMemory::BufferObject::New();
79 bufferDest->allocate(bufferSrc->getSize());
81 char* buffDest =
static_cast< char*
>( lockerDest.
getBuffer() );
82 char* buffSrc =
static_cast< char*
>( lockerSource.
getBuffer() );
83 std::copy(buffSrc, buffSrc + bufferSrc->getSize(), buffDest );
94 ::fwMemory::BufferObject::sptr buffer = ::fwMemory::BufferObject::New();
95 const size_t buffSize = ::boost::filesystem::file_size(path);
96 buffer->setIStreamFactory( std::make_shared< ::fwMemory::stream::in::Raw >(path),
97 buffSize, path, ::fwMemory::RAW);
FWMEDDATA_API void addSOPClassUID(const std::string &sopClassUID)
Add a SOPClassUID that is used by this series.
std::size_t m_firstInstanceNumber
First instance number (0 or 1) - Used for PACS preview.
FWMEDDATA_API void addComputedTagValue(const std::string &tagName, const std::string &value)
Add a computed value to the specified tag.
Namespace containing medical data.
FWMEDDATA_API void shallowCopy(const ::fwData::Object::csptr &_source) override
Defines shallow copy.
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
Implements data exception class.
FWMEDDATA_API void cachedDeepCopy(const ::fwData::Object::csptr &_source, DeepCopyCacheType &cache) override
Defines deep copy.
size_t m_numberOfInstances
Number of instances in the series (0020,1209)
ComputedTagValueContainerType m_computedTagValues
Computed tag values.
base class for BufferObject Lock
virtual const std::string & getClassname() const override
return full object's classname with its namespace, i.e. fwCore::BaseObject
FWMEDDATA_API void addBinary(std::size_t instanceIndex, const ::fwMemory::BufferObject::sptr &buffer)
Add binary buffer.
DicomContainerType m_dicomContainer
Dicom container.
virtual FWMEDDATA_API ~DicomSeries() override
Destructor.
LockBase< T >::BufferType getBuffer() const
Returns BufferObject's buffer pointer.
SOPClassUIDContainerType m_SOPClassUIDs
SOP Class UIDs.
FWMEDDATA_API void addDicomPath(std::size_t instanceIndex, const ::boost::filesystem::path &path)
Add dicom path.
FWMEDDATA_API void cachedDeepCopy(const ::fwData::Object::csptr &_source, DeepCopyCacheType &cache) override
Defines deep copy.
FWMEDDATA_API bool isInstanceAvailable(std::size_t instanceIndex) const
Return true if the instance is available on the local computer.
FWMEDDATA_API void shallowCopy(const ::fwData::Object::csptr &_source) override
Defines shallow copy.
Holds series information.
FWMEDDATA_API DicomSeries(::fwData::Object::Key key)
Constructor.
FWMEDDATA_API bool hasComputedValues(const std::string &tagName) const
Return true if there is a computed value for the specified tag.