CustusX  18.04
An IGT application
cxDicomConverter.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #ifndef CXDICOMCONVERTER_H_
13 #define CXDICOMCONVERTER_H_
14 
15 #include "cxImage.h"
16 #include "org_custusx_dicom_Export.h"
17 class ctkDICOMDatabase;
18 
19 namespace cx
20 {
21 typedef boost::shared_ptr<class DicomImageReader> DicomImageReaderPtr;
22 
31 class org_custusx_dicom_EXPORT DicomConverter
32 {
33 public:
35  virtual ~DicomConverter();
36 
37  void setDicomDatabase(ctkDICOMDatabase* database);
38  ImagePtr convertToImage(QString seriesUid);
39 
40 private:
41  QString generateUid(DicomImageReaderPtr reader);
42  QString generateName(DicomImageReaderPtr reader);
43  std::map<double, ImagePtr> sortImagesAlongDirection(std::vector<ImagePtr> images, Vector3D e_sort);
44  ImagePtr mergeSlices(std::map<double, ImagePtr> sorted) const;
45  double getMeanSliceDistance(std::map<double, ImagePtr> sorted) const;
46  bool slicesFormRegularGrid(std::map<double, ImagePtr> sorted, Vector3D e_sort) const;
47  // ignoreLocalizerImages is a tag to ignore special images. For now only localizer images are ignored
48  ImagePtr createCxImageFromDicomFile(QString filename, bool ignoreLocalizerImages);
49  std::vector<ImagePtr> createImages(QStringList files);
50  QString convertToValidName(QString text) const;
51 
52  ctkDICOMDatabase* mDatabase;
53 };
54 
55 } /* namespace cx */
56 #endif /* CXDICOMCONVERTER_H_ */
boost::shared_ptr< class Image > ImagePtr
Definition: cxDicomWidget.h:27
boost::shared_ptr< class DicomImageReader > DicomImageReaderPtr
Eigen::Vector3d Vector3D
Vector3D is a representation of a point or vector in 3D.
Definition: cxVector3D.h:42
Namespace for all CustusX production code.