fw4spl
io/fwGdcmIO/include/fwGdcmIO/helper/DicomSeries.hpp
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 #pragma once
8 
9 #include "fwGdcmIO/config.hpp"
10 
11 #include <fwCore/macros.hpp>
12 
13 #include <boost/filesystem/path.hpp>
14 
15 #include <gdcmDataSet.h>
16 #include <gdcmScanner.h>
17 
18 #include <cstdint>
19 #include <vector>
20 
21 namespace fwMedData
22 {
23 class DicomSeries;
24 }
25 
26 namespace fwMedData
27 {
28 class Patient;
29 class Study;
30 class Equipment;
31 }
32 
33 namespace fwJobs
34 {
35 class Observer;
36 }
37 
38 namespace fwGdcmIO
39 {
40 namespace helper
41 {
42 
49 class FWGDCMIO_CLASS_API DicomSeries
50 {
51 public:
52 
53  typedef std::vector< ::boost::filesystem::path > FilenameContainerType;
54  typedef std::vector< SPTR(::fwMedData::DicomSeries) > DicomSeriesContainerType;
55 
57  FWGDCMIO_API DicomSeries();
58 
60  FWGDCMIO_API ~DicomSeries();
61 
69  FWGDCMIO_API DicomSeriesContainerType read(FilenameContainerType& filenames,
70  const SPTR(::fwJobs::Observer)& readerObserver = nullptr,
71  const SPTR(::fwJobs::Observer)& completeSeriesObserver = nullptr);
77  FWGDCMIO_API void complete(DicomSeriesContainerType& seriesDB,
78  const SPTR(::fwJobs::Observer)& completeSeriesObserver);
79 
80 protected:
81 
87  void fillSeries(DicomSeriesContainerType& seriesDB, const SPTR(::fwJobs::Observer)& completeSeriesObserver);
88 
95  DicomSeriesContainerType splitFiles(FilenameContainerType& filenames,
96  const SPTR(::fwJobs::Observer)& readerObserver);
97 
104  void createSeries(DicomSeriesContainerType& seriesDB,
105  const ::gdcm::Scanner& scanner,
106  const ::boost::filesystem::path& filename);
107 
112  SPTR(::fwMedData::Patient) createPatient(const ::gdcm::DataSet& dataset);
113 
118  SPTR(::fwMedData::Study) createStudy(const ::gdcm::DataSet& dataset);
119 
124  SPTR(::fwMedData::Equipment) createEquipment(const ::gdcm::DataSet& dataset);
125 
126  typedef std::map< std::string, SPTR(::fwMedData::Patient) > PatientMapType;
127  typedef std::map< std::string, SPTR(::fwMedData::Study) > StudyMapType;
128  typedef std::map< std::string, SPTR(::fwMedData::Equipment) > EquipmentMapType;
129 
131  PatientMapType m_patientMap;
132 
134  StudyMapType m_studyMap;
135 
137  EquipmentMapType m_equipmentMap;
138 };
139 
140 } //helper
141 } //fwGdcmIO
#define SPTR(_cls_)
This class contains helper to generate Medical Data (SeriesDB, ImageSeries, ...). ...
Namespace containing medical data.
This file defines fwCore base macros.
The namespace fwGdcmIO contains reader, writer and helper for dicom data.
DicomSeries Helper. This class is used to generate/fill DicomSeries.
This namespace fwJobs provides jobs management.
This class manages a job.
Definition: Observer.hpp:22