Computer Assited Medical Intervention Tool Kit  version 4.1
DicomParser.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2018 Univ. Grenoble Alpes, CNRS, TIMC-IMAG UMR 5525 (GMCAO)
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 
26 #ifndef DICOMPARSER_H
27 #define DICOMPARSER_H
28 
29 // CamiTK includes
30 #include <DicomSerie.h>
31 
32 // Qt includes
33 #include <QMap>
34 #include <QList>
35 #include <QString>
36 #include <QCoreApplication>
37 
38 // C++ includes
39 #include <cstdlib>
40 #include <vector>
41 
42 
51 class DicomParser {
52 
53  Q_DECLARE_TR_FUNCTIONS(DicomParser)
54 
55 public:
56 
57  DicomParser() = default;
58 
60  virtual ~DicomParser() = default;
61 
67  static QList<DicomSerie*> parseDirectory(const QString& directory);
68 
74  static double getZSpacing(const std::vector<std::string>& serieFileNames);
75 
76 private:
82  static QList<QString> stdListOfStringToQt(const std::vector< std::string >& inputList);
83 
89  static std::vector< std::string > qtListOfStringToStd(const QList<QString>& inputList);
90 
96  static QDate getAcquisitionDate(const std::vector<std::string>& serieFileNames);
97 
103  static QTime getAcquisitionTime(const std::vector<std::string>& serieFileNames);
104 
110  static QString getPatientName(const std::vector<std::string>& serieFileNames);
111 
117  static QString getSerieName(const std::vector<std::string>& serieFileNames);
118 
124  static QString getSerieDescription(const std::vector<std::string>& serieFileNames);
125 
131  static QString getStudyName(const std::vector<std::string>& serieFileNames);
132 
133 };
134 
135 #endif // DICOMPARSER_H
136 
static QList< DicomSerie * > parseDirectory(const QString &directory)
Parse the input directory for DICOM series.
Definition: DicomParser.cpp:36
static QDate getAcquisitionDate(const std::vector< std::string > &serieFileNames)
Retrieve the SERIES acquisition date.
Definition: DicomParser.cpp:124
static QString getStudyName(const std::vector< std::string > &serieFileNames)
Retrieve the study name.
Definition: DicomParser.cpp:187
static QString getSerieName(const std::vector< std::string > &serieFileNames)
Retrieve the series name.
Definition: DicomParser.cpp:163
static QList< QString > stdListOfStringToQt(const std::vector< std::string > &inputList)
Convert a simple std list of string into a QList of QString.
Definition: DicomParser.cpp:199
static std::vector< std::string > qtListOfStringToStd(const QList< QString > &inputList)
Convert a QList of QString into a std list of string.
Definition: DicomParser.cpp:209
static QString getPatientName(const std::vector< std::string > &serieFileNames)
Retrieve the patient name information from the input files.
Definition: DicomParser.cpp:150
static QTime getAcquisitionTime(const std::vector< std::string > &serieFileNames)
Retrieve the SERIES acquisition time.
Definition: DicomParser.cpp:137
DicomParser allows one to parse a directory of DICOM files looking for studies and series...
Definition: DicomParser.h:51
DicomParser()=default
virtual ~DicomParser()=default
Default Destructor.
static QString getSerieDescription(const std::vector< std::string > &serieFileNames)
Retrieve the series description.
Definition: DicomParser.cpp:175
static double getZSpacing(const std::vector< std::string > &serieFileNames)
Retrieve the DICOM image file Z spacing attribute (commonly known as spacing between slices) ...
Definition: DicomParser.cpp:219