fw4spl
reader/ie/Document.cpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
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 #include "fwGdcmIO/reader/ie/Document.hpp"
8 
9 #include "fwGdcmIO/container/DicomCodedAttribute.hpp"
10 #include "fwGdcmIO/container/sr/DicomSRContainerNode.hpp"
11 #include "fwGdcmIO/helper/StructuredReport.hpp"
12 #include "fwGdcmIO/reader/tid/MeasurementReport.hpp"
13 
14 namespace fwGdcmIO
15 {
16 namespace reader
17 {
18 namespace ie
19 {
20 
21 //------------------------------------------------------------------------------
22 
23 Document::Document(const ::fwMedData::DicomSeries::csptr& dicomSeries,
24  const SPTR(::gdcm::Reader)& reader,
25  const ::fwGdcmIO::container::DicomInstance::sptr& instance,
26  const ::fwData::Image::sptr& image,
27  const ::fwLog::Logger::sptr& logger,
28  ProgressCallback progress,
29  CancelRequestedCallback cancel) :
30  ::fwGdcmIO::reader::ie::InformationEntity< ::fwData::Image >(dicomSeries, reader, instance, image,
31  logger, progress, cancel)
32 {
33 }
34 
35 //------------------------------------------------------------------------------
36 
37 Document::~Document()
38 {
39 }
40 
41 //------------------------------------------------------------------------------
42 
43 void Document::readSR() throw (::fwGdcmIO::exception::Failed)
44 {
45  // Retrieve dataset
46  const ::gdcm::DataSet& datasetRoot = m_reader->GetFile().GetDataSet();
47 
48  // Create SR from Dataset
51 
52  if(rootContainerNode)
53  {
54  // Try to read a measurement report
55  ::fwGdcmIO::reader::tid::MeasurementReport report(m_dicomSeries, m_reader, m_instance, m_object, m_logger);
56  report.readSR(rootContainerNode);
57  }
58 
59 }
60 
61 //------------------------------------------------------------------------------
62 
63 } // namespace ie
64 } // namespace reader
65 } // namespace fwGdcmIO
#define SPTR(_cls_)
FWGDCMIO_API Document(const std::shared_ptr< const ::fwMedData::DicomSeries > &dicomSeries, const std::shared_ptr< ::gdcm::Reader > &reader, const std::shared_ptr< ::fwGdcmIO::container::DicomInstance > &instance, const ::fwData::Image::sptr &image, const ::fwLog::Logger::sptr &logger=nullptr, ProgressCallback progress=nullptr, CancelRequestedCallback cancel=nullptr)
Constructor.
Measurement Report TID - This a root template.
The namespace fwGdcmIO contains reader, writer and helper for dicom data.
This class defines a CONTAINER node in a SR document.
static FWGDCMIO_API std::shared_ptr< ::fwGdcmIO::container::sr::DicomSRContainerNode > readSR(const ::gdcm::DataSet &dataset)
Read a Structured Report.
virtual FWGDCMIO_API void readSR(const std::shared_ptr< ::fwGdcmIO::container::sr::DicomSRNode > &root)
Create Measurement Report template root node.
Contains the representation of the data objects used in the framework.