Use DICOMTypes.h instead of QGlobals.h in DICOM object store reference classes.

This commit is contained in:
Krad
2022-09-21 09:56:10 +08:00
parent 5c854017d8
commit e74292c361
6 changed files with 67 additions and 47 deletions

View File

@@ -6,7 +6,6 @@
#include "SeriesImageSet.h" #include "SeriesImageSet.h"
#include "IO/DICOM/DicomLoader.h" #include "IO/DICOM/DicomLoader.h"
#include "IO/DICOM/ExtendMedicalImageProperties.h"
SeriesImageSet *ImageSetStore::getSeriesImageSet(const string &uniqueID) { SeriesImageSet *ImageSetStore::getSeriesImageSet(const string &uniqueID) {
//only user key to the series level //only user key to the series level
@@ -81,10 +80,13 @@ void ImageSetStore::addImageSet(ExtendMedicalImageProperties* property) {
} }
//TODO:need add Image set logic //TODO:need add Image set logic
if (study->series->count(series_uid)>0){ if (study->series->count(series_uid)>0){
study->series->at(series_uid)->insert({property->GetUniqueID(),property});
imageProperties.push_back(property);
} }
else { else {
study->series->insert({series_uid,property}); ImageSetMapType* v = new ImageSetMapType;
v->insert({property->GetUniqueID(),property});
study->series->insert({series_uid,v});
imageProperties.push_back(property); imageProperties.push_back(property);
} }
} }

View File

@@ -5,7 +5,10 @@
#ifndef OMEGAV_IMAGESETSTORE_H #ifndef OMEGAV_IMAGESETSTORE_H
#define OMEGAV_IMAGESETSTORE_H #define OMEGAV_IMAGESETSTORE_H
#include "Common/QGlobals.h" #include <vector>
#include <vtkObject.h>
#include "IO/Common/DICOMTypes.h"
class SeriesImageSet; class SeriesImageSet;
class ExtendMedicalImageProperties; class ExtendMedicalImageProperties;
typedef std::map<std::string, SeriesImageSet*> StoreMap; typedef std::map<std::string, SeriesImageSet*> StoreMap;

View File

@@ -340,37 +340,5 @@ private:
}; };
typedef std::map<std::string, ExtendMedicalImageProperties*> SeriesMapType;
typedef struct StudyInfo
{
std::string study_date;
std::string study_time;
std::string study_description;
QPushButton *study_label;
SeriesMapType *series;
StudyInfo():study_label(nullptr), series(nullptr) {}
~StudyInfo(){
delete series;
}
}StudyInfo_t;
typedef std::map<std::string, StudyInfo_t*> StudiesMapType;
typedef struct PatientInfo
{
std::string patient_name;
std::string birth_date;
QPushButton *patient_label;
StudiesMapType *studies;
PatientInfo():patient_label(nullptr), studies(nullptr){
}
~PatientInfo(){
for(auto item: *studies){
delete item.second;
}
delete studies;
}
}PatientInfo_t;
typedef std::map<std::string, PatientInfo_t*> PatientsMapType;
#endif OMEGAV_QGLOBALS_H #endif OMEGAV_QGLOBALS_H

View File

@@ -1,12 +1,12 @@
#include "SeriesImageSet.h" #include "SeriesImageSet.h"
#include <vtkRendererCollection.h>
#include "UI/Widget/ImageView/dicomimageview.h"
#include "IO/DICOM/DicomLoader.h"
#include <QPainter> #include <QPainter>
#include <QDebug> #include <QDebug>
#include "IO/DICOM/ExtendMedicalImageProperties.h"
#include <vtkBoundingBox.h> #include <vtkBoundingBox.h>
#include "UI/Widget/ImageView/dicomimageview.h"
#include "IO/DICOM/DicomLoader.h"
//---------------------------------------------------------------- //----------------------------------------------------------------

View File

@@ -0,0 +1,44 @@
//
// Created by Krad on 2022/9/21.
//
#ifndef OMEGAV_DICOMTYPES_H
#define OMEGAV_DICOMTYPES_H
#include <map>
#include <string>
class ExtendMedicalImageProperties;
typedef std::map<std::string, ExtendMedicalImageProperties*> ImageSetMapType;
typedef std::map<std::string, ImageSetMapType*> SeriesMapType;
typedef struct StudyInfo
{
std::string study_date;
std::string study_time;
std::string study_description;
SeriesMapType *series;
StudyInfo(): series(nullptr) {}
~StudyInfo(){
delete series;
}
}StudyInfo_t;
typedef std::map<std::string, StudyInfo_t*> StudiesMapType;
typedef struct PatientInfo
{
std::string patient_name;
std::string birth_date;
StudiesMapType *studies;
PatientInfo(): studies(nullptr){
}
~PatientInfo(){
for(auto item: *studies){
delete item.second;
}
delete studies;
}
}PatientInfo_t;
typedef std::map<std::string, PatientInfo_t*> PatientsMapType;
#endif //OMEGAV_DICOMTYPES_H

View File

@@ -118,15 +118,18 @@ void ThumbnailBarWidget::updateThumbnailBar()
DicomLoader::InitCodecs(); DicomLoader::InitCodecs();
for (SeriesMapType::const_iterator it_se = series->cbegin(); it_se != series->cend(); it_se++) { for (SeriesMapType::const_iterator it_se = series->cbegin(); it_se != series->cend(); it_se++) {
thumbnailImage *thumbnail = createThumbnailImage(seriesPanel, it_se->second); auto imageSetMap = (*it_se).second;
for(ImageSetMapType::const_iterator it_is = imageSetMap->cbegin(); it_is != imageSetMap->cend(); it_is++ ){
thumbnailImage *thumbnail = createThumbnailImage(seriesPanel, it_is->second);
seriesPanel->layout()->addWidget(thumbnail); seriesPanel->layout()->addWidget(thumbnail);
if (firstThumbnail){ if (firstThumbnail){
setCurrentImageLabel(thumbnail); setCurrentImageLabel(thumbnail);
firstThumbnail = false; firstThumbnail = false;
}
//save all thumbnail in one list
LabelList << thumbnail;
} }
//save all thumbnail in one list
LabelList << thumbnail;
} }
DicomLoader::FinalizeCodecs(); DicomLoader::FinalizeCodecs();
} }