Replace UniqueIDInfo_t with std::string
This commit is contained in:
@@ -39,15 +39,13 @@ public:
|
||||
* @param openMode
|
||||
*/
|
||||
void preReadNewFile(const std::string &dir, SeriesOpenMode openMode);
|
||||
UniqueIDInfo_t* createUniqueID(const std::string &dicomName, SeriesOpenMode openMode);
|
||||
bool IsDuplicate(UniqueIDInfo_t* unique);
|
||||
|
||||
|
||||
SeriesImageSet *createSeries(UniqueIDInfo_t *uniqueID);
|
||||
AddDicomType getAddDicomType()const
|
||||
{
|
||||
return m_addType;
|
||||
const std::string& getDefaultUniqueID(){
|
||||
return defaultUniqueID;
|
||||
}
|
||||
|
||||
SeriesImageSet *createSeries(const std::string& uniqueID);
|
||||
const PatientsMapType &getPatientsList()
|
||||
{
|
||||
return m_patients;
|
||||
@@ -55,17 +53,13 @@ public:
|
||||
|
||||
|
||||
|
||||
SeriesImageSet* getSeriesImageSet(const UniqueIDInfo &uniqueID);
|
||||
SeriesImageSet* getSeriesImageSet(const std::string& uniqueID);
|
||||
|
||||
SeriesInfo_t* getSerieInfo(const UniqueIDInfo &uniqueID);
|
||||
SeriesImageSet* getFirstInstance(const UniqueIDInfo &uniqueID);
|
||||
InstancesVecType* getInstancesVec(const UniqueIDInfo &uniqueID);
|
||||
//for export use
|
||||
SeriesInfo_t* getSerieInfo(const std::string& seriesUnique);
|
||||
|
||||
//for export use
|
||||
void getOpenedInstancesVec(InstancesVecType& retVec);
|
||||
|
||||
//void deleteSeriesInstance(SeriesImageSet* instance,bool from_map = true);
|
||||
void deleteInstanceFromMap(UniqueIDInfo uniqueID);
|
||||
|
||||
private:
|
||||
explicit DicomLoader();
|
||||
~DicomLoader();
|
||||
@@ -86,7 +80,7 @@ private:
|
||||
std::vector<ExtendMedicalImageProperties*> imageProperties;
|
||||
vtkDICOMImageReader2 * reader = nullptr;
|
||||
ImageSetStore store;
|
||||
AddDicomType m_addType;
|
||||
std::string defaultUniqueID;
|
||||
PatientsMapType m_patients;
|
||||
vtkObject* placeHolder;
|
||||
};
|
||||
|
||||
@@ -17,15 +17,15 @@ class SeriesImageSet : public QObject
|
||||
|
||||
public:
|
||||
|
||||
SeriesImageSet::SeriesImageSet(const UniqueIDInfo_t& uniqueID,ExtendMedicalImageProperties* property, vtkImageData* imagedata);
|
||||
SeriesImageSet::SeriesImageSet(ExtendMedicalImageProperties* property, vtkImageData* imagedata);
|
||||
~SeriesImageSet() override;
|
||||
|
||||
|
||||
void setUpSeriesInstance();
|
||||
|
||||
//UniqueID
|
||||
UniqueIDInfo_t* getUniqueID() {
|
||||
return &m_pUniqueID;
|
||||
std::string const & getUniqueID() {
|
||||
return m_pUniqueID;
|
||||
};
|
||||
const char* getCurImageName()const;
|
||||
const char* getCurSeriesName() const;
|
||||
@@ -49,6 +49,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
|
||||
//camera config
|
||||
double GetExtent()
|
||||
{
|
||||
@@ -76,7 +77,7 @@ private:
|
||||
vtkSmartPointer <vtkImageData> m_image;
|
||||
ExtendMedicalImageProperties* m_property = nullptr;
|
||||
|
||||
UniqueIDInfo_t m_pUniqueID;
|
||||
std::string m_pUniqueID;
|
||||
|
||||
|
||||
static qint32 image_label_size;
|
||||
|
||||
@@ -200,32 +200,13 @@ enum SeriesOpenMode {
|
||||
DIR_OPEN_MODE
|
||||
};
|
||||
|
||||
typedef struct UniqueIDInfo
|
||||
{
|
||||
std::string patient_name;
|
||||
std::string study_uid;
|
||||
std::string series_uid;
|
||||
SeriesOpenMode open_mode;
|
||||
std::string instance_num;
|
||||
std::string dicom_name;
|
||||
//std::string series_modality;
|
||||
}UniqueIDInfo_t;
|
||||
|
||||
//typedef std::shared_ptr<DicomTagInfo_t> DicomTagInfo_t*;
|
||||
//typedef std::shared_ptr<UniqueIDInfo_t> UniqueIDInfo_t*;
|
||||
|
||||
namespace DicomUtil
|
||||
{
|
||||
//not include open_mode
|
||||
static bool EqualsUnique(const UniqueIDInfo &uid1, const UniqueIDInfo & uid2)
|
||||
{
|
||||
if (uid1.patient_name == uid2.patient_name &&
|
||||
uid1.study_uid == uid2.study_uid &&
|
||||
uid1.series_uid == uid2.series_uid) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class FlipExportHelper
|
||||
@@ -390,11 +371,11 @@ typedef struct SeriesInfo
|
||||
std::string instance_num;
|
||||
bool pixmap_valid;
|
||||
QPixmap series_pixmap;
|
||||
UniqueIDInfo_t* unique_info;
|
||||
std::string unique_id;
|
||||
DicomTagInfo_t* tag_info;
|
||||
thumbnailImage* thumb_nail;
|
||||
InstancesVecType* instances;
|
||||
SeriesInfo() :pixmap_valid(false), unique_info(nullptr),tag_info(nullptr),thumb_nail(nullptr), instances(nullptr) {}
|
||||
SeriesInfo() : pixmap_valid(false), unique_id(""), tag_info(nullptr), thumb_nail(nullptr), instances(nullptr) {}
|
||||
}SeriesInfo_t;
|
||||
typedef std::map<std::string, SeriesInfo_t*> SeriesMapType;
|
||||
|
||||
|
||||
@@ -22,13 +22,13 @@ public:
|
||||
DicomImageView* getCurrentView() const;
|
||||
DicomImageView* getNextView() const;
|
||||
QList<DicomImageView*> getViewList() const;
|
||||
void getRelevantViewList(const UniqueIDInfo& unique, QList<DicomImageView*> & viewList);
|
||||
|
||||
|
||||
|
||||
void setCurrentView(DicomImageView *view);
|
||||
void emptyCurrentView();
|
||||
|
||||
void replaceViewWithSerie(UniqueIDInfo_t* unique_info,
|
||||
void replaceViewWithSerie(const std::string& unique_info,
|
||||
DicomImageView* curV = nullptr);
|
||||
|
||||
//fusion
|
||||
|
||||
@@ -1010,28 +1010,7 @@ void QDicomViewer::openAndDrawDICOM(const std::string& dicomName, SeriesOpenMode
|
||||
|
||||
//load image and tag
|
||||
helper->preReadNewFile(dicomName, openMode);
|
||||
|
||||
|
||||
UniqueIDInfo_t *unique = helper->createUniqueID(dicomName, openMode);
|
||||
if (!unique) {
|
||||
this->statusBar()->showMessage(tr("Error unique data!"));
|
||||
return;
|
||||
}
|
||||
//判断是否重复,并设置AddDicomType
|
||||
if (helper->IsDuplicate(unique)) {
|
||||
this->statusBar()->showMessage(tr("Already Exists!"));
|
||||
|
||||
//need to delete UniqueID first
|
||||
//delete unique;
|
||||
return;
|
||||
}
|
||||
|
||||
//read tag of first series
|
||||
DicomTagInfo_t *tag_info = helper->createDicomTagsInfo();
|
||||
|
||||
//You have to judge AddDicomType first!
|
||||
AddDicomType type = helper->getAddDicomType();
|
||||
|
||||
auto unique = helper->getDefaultUniqueID();
|
||||
|
||||
ui->viewContainer->replaceViewWithSerie(unique);
|
||||
//view clicked will notify thumbnailbar update
|
||||
|
||||
@@ -103,14 +103,6 @@ void copyDicomTasInfo(DicomTagInfo_t* dicom, ExtendMedicalImageProperties* prope
|
||||
dicom->m_SliceNumber = itoa(properties->GetFileNames()->size(),buffer,10);
|
||||
}
|
||||
|
||||
void copyUniqueInfo(UniqueIDInfo_t* unique, ExtendMedicalImageProperties* properties){
|
||||
unique->series_uid = properties->GetSeriesUID();
|
||||
unique->patient_name = properties->GetPatientName();
|
||||
unique->study_uid = properties->GetStudyUID();
|
||||
char buffer[16]={};
|
||||
unique->instance_num=itoa(properties->GetFileNames()->size(),buffer,10);
|
||||
}
|
||||
|
||||
DicomLoader* DicomLoader::instance = new DicomLoader();
|
||||
DicomLoader* DicomLoader::GetInstance() {
|
||||
//lazy man
|
||||
@@ -121,7 +113,7 @@ DicomLoader* DicomLoader::GetInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
DicomLoader::DicomLoader():m_addType(AddDicomType::DUPLICATE_TYPE) {
|
||||
DicomLoader::DicomLoader(){
|
||||
|
||||
// m_itkSeriesReader = SeriesReaderType::New();
|
||||
// m_itkConnector = ConnectorType::New();
|
||||
@@ -132,6 +124,7 @@ DicomLoader::DicomLoader():m_addType(AddDicomType::DUPLICATE_TYPE) {
|
||||
//transfer to series after!
|
||||
m_patients.clear();
|
||||
placeHolder = vtkObject::New();
|
||||
defaultUniqueID = "";
|
||||
}
|
||||
DicomLoader::~DicomLoader() {
|
||||
|
||||
@@ -145,103 +138,38 @@ DicomLoader::~DicomLoader() {
|
||||
imageProperties.clear();
|
||||
}
|
||||
|
||||
// 废止该函数, 因为overridde也好,add模式也好,实际上都不需要判定一下内容
|
||||
// 其中的相关逻辑移动到readSeries中去
|
||||
bool DicomLoader::IsDuplicate(UniqueIDInfo_t* unique)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
SeriesImageSet* DicomLoader::getSeriesImageSet(const UniqueIDInfo &uniqueID)//, DicomTagInfo_t* tag_info)
|
||||
SeriesImageSet* DicomLoader::getSeriesImageSet(const std::string& uniqueID)//, DicomTagInfo_t* tag_info)
|
||||
{
|
||||
//only user key to the series level
|
||||
auto key = uniqueID.patient_name+uniqueID.study_uid+uniqueID.series_uid;
|
||||
if (store.count(key)>0)
|
||||
if (store.count(uniqueID)>0)
|
||||
{
|
||||
//use cache instead load
|
||||
return store[key];
|
||||
return store[uniqueID];
|
||||
}
|
||||
if (reader) reader->Delete();
|
||||
reader = vtkDICOMImageReader2::New();
|
||||
reader->SetFileNames(*(currentImageProperty->GetFileNames()));
|
||||
auto iter = std::find_if(imageProperties.begin(), imageProperties.end(),[&uniqueID](auto property){
|
||||
std::string id;
|
||||
id.append(property->GetPatientName());
|
||||
id.append("_");
|
||||
id.append(property->GetStudyUID());
|
||||
id.append("_");
|
||||
id.append(property->GetSeriesUID());
|
||||
return id == uniqueID;
|
||||
});
|
||||
if (iter==imageProperties.end()) return nullptr;
|
||||
|
||||
reader->SetFileNames(*(*iter)->GetFileNames());
|
||||
reader->Update();
|
||||
SeriesImageSet* result = new SeriesImageSet(uniqueID,currentImageProperty,reader->GetOutput());
|
||||
|
||||
SeriesImageSet* result = new SeriesImageSet((*iter),reader->GetOutput());
|
||||
reader->Delete();
|
||||
reader = nullptr;
|
||||
store[key] = result;
|
||||
store[uniqueID] = result;
|
||||
return result;
|
||||
}
|
||||
|
||||
// 无用函数
|
||||
void DicomLoader::deleteInstanceFromMap(UniqueIDInfo uniqueID)
|
||||
{
|
||||
//const UniqueIDInfo & uniqueID = instance->getUniqueID();
|
||||
|
||||
PatientsMapType::iterator cur_patient_iter = m_patients.find(uniqueID.patient_name);
|
||||
|
||||
StudiesMapType::iterator cur_study_iter = cur_patient_iter->second->studies->find(uniqueID.study_uid);
|
||||
|
||||
//in order
|
||||
SeriesInfo_t* the_series = cur_study_iter->second->series->at(uniqueID.series_uid);
|
||||
//SeriesImageSet *cur_series = cur_study_iter->second->series->at(uniqueID.series_uid);
|
||||
|
||||
|
||||
//delete all the instances assotiated with this series UID
|
||||
for (int i = 0; i < the_series->instances->size(); i++)
|
||||
{
|
||||
delete the_series->instances->at(i);
|
||||
}
|
||||
the_series->instances->clear();
|
||||
|
||||
|
||||
//erase series from study
|
||||
cur_study_iter->second->series->erase(uniqueID.series_uid);
|
||||
|
||||
//Recursively Delete
|
||||
|
||||
//if the study has no series
|
||||
if (cur_study_iter->second->series->empty())
|
||||
{
|
||||
cur_patient_iter->second->studies->erase(uniqueID.study_uid);
|
||||
}
|
||||
|
||||
//if the patient has no study
|
||||
if (cur_patient_iter->second->studies->empty())
|
||||
{
|
||||
m_patients.erase(uniqueID.patient_name);
|
||||
}
|
||||
|
||||
//cause you need uniqueID, therefore you have to delete series at last
|
||||
//delete cur_series;
|
||||
}
|
||||
|
||||
//无用函数2
|
||||
InstancesVecType* DicomLoader::getInstancesVec(const UniqueIDInfo &uniqueID)
|
||||
{
|
||||
PatientsMapType::iterator cur_patient_iter = m_patients.find(uniqueID.patient_name);
|
||||
if (cur_patient_iter == m_patients.end())
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
StudiesMapType::iterator cur_study_iter = cur_patient_iter->second->studies->find(uniqueID.study_uid);
|
||||
if (cur_study_iter == cur_patient_iter->second->studies->end())
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SeriesMapType::iterator the_series = cur_study_iter->second->series->find(uniqueID.series_uid);
|
||||
if (the_series == cur_study_iter->second->series->end())
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return the_series->second->instances;
|
||||
|
||||
}
|
||||
|
||||
void DicomLoader::getOpenedInstancesVec(InstancesVecType& retVec)
|
||||
{
|
||||
for (PatientsMapType::const_iterator cur_patient_iter = m_patients.begin(); cur_patient_iter !=
|
||||
@@ -267,44 +195,27 @@ void DicomLoader::getOpenedInstancesVec(InstancesVecType& retVec)
|
||||
}
|
||||
}
|
||||
|
||||
SeriesImageSet* DicomLoader::getFirstInstance(const UniqueIDInfo &uniqueID)
|
||||
SeriesInfo_t* DicomLoader::getSerieInfo(const std::string& seriesUnique)
|
||||
{
|
||||
PatientsMapType::iterator cur_patient_iter = m_patients.find(uniqueID.patient_name);
|
||||
auto idx = seriesUnique.find('_');
|
||||
std::string patient_name= seriesUnique.substr(0,idx);
|
||||
PatientsMapType::iterator cur_patient_iter = m_patients.find(patient_name);
|
||||
if (cur_patient_iter == m_patients.end())
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
StudiesMapType::iterator cur_study_iter = cur_patient_iter->second->studies->find(uniqueID.study_uid);
|
||||
auto begin = idx;
|
||||
idx = seriesUnique.find('_',begin);
|
||||
std::string study_uid= seriesUnique.substr(idx,idx);
|
||||
StudiesMapType::iterator cur_study_iter = cur_patient_iter->second->studies->find(study_uid);
|
||||
if (cur_study_iter == cur_patient_iter->second->studies->end())
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SeriesMapType::iterator the_series = cur_study_iter->second->series->find(uniqueID.series_uid);
|
||||
if (the_series == cur_study_iter->second->series->end())
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return *the_series->second->instances->begin();
|
||||
|
||||
}
|
||||
SeriesInfo_t* DicomLoader::getSerieInfo(const UniqueIDInfo &uniqueID)
|
||||
{
|
||||
PatientsMapType::iterator cur_patient_iter = m_patients.find(uniqueID.patient_name);
|
||||
if (cur_patient_iter == m_patients.end())
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
StudiesMapType::iterator cur_study_iter = cur_patient_iter->second->studies->find(uniqueID.study_uid);
|
||||
if (cur_study_iter == cur_patient_iter->second->studies->end())
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
SeriesMapType::iterator the_series = cur_study_iter->second->series->find(uniqueID.series_uid);
|
||||
begin = idx;
|
||||
idx = seriesUnique.find('_',begin);
|
||||
std::string series_uid= seriesUnique.substr(idx,idx);
|
||||
SeriesMapType::iterator the_series = cur_study_iter->second->series->find(series_uid);
|
||||
if (the_series == cur_study_iter->second->series->end())
|
||||
{
|
||||
return nullptr;
|
||||
@@ -335,33 +246,17 @@ void DicomLoader::preReadNewFile(const std::string &dir, SeriesOpenMode openMode
|
||||
}
|
||||
if ( imageProperties.size() > 0 ) {
|
||||
currentImageProperty = imageProperties[0];
|
||||
defaultUniqueID = "";
|
||||
defaultUniqueID.append(currentImageProperty->GetPatientName());
|
||||
defaultUniqueID.append("_");
|
||||
defaultUniqueID.append(currentImageProperty->GetStudyUID());
|
||||
defaultUniqueID.append("_");
|
||||
defaultUniqueID.append(currentImageProperty->GetSeriesUID());
|
||||
}
|
||||
|
||||
|
||||
readSeries();
|
||||
}
|
||||
|
||||
|
||||
UniqueIDInfo_t* DicomLoader::createUniqueID(const std::string &dicomName, SeriesOpenMode openMode)
|
||||
{
|
||||
if (!currentImageProperty) return nullptr;
|
||||
UniqueIDInfo_t* pUniqueID(new UniqueIDInfo_t());
|
||||
pUniqueID->open_mode = openMode;
|
||||
pUniqueID->dicom_name = dicomName;
|
||||
if (openMode == FILE_OPEN_MODE)
|
||||
{
|
||||
char buffer[16]={};
|
||||
pUniqueID->instance_num=itoa(currentImageProperty->GetFileNames()->size(),buffer,10);
|
||||
}
|
||||
pUniqueID->patient_name = currentImageProperty->GetPatientName();
|
||||
pUniqueID->study_uid = currentImageProperty->GetStudyUID();
|
||||
pUniqueID->series_uid = currentImageProperty->GetSeriesUID();
|
||||
|
||||
return pUniqueID;
|
||||
}
|
||||
|
||||
|
||||
|
||||
DicomTagInfo_t* DicomLoader::createDicomTagsInfo()
|
||||
{
|
||||
|
||||
@@ -403,10 +298,10 @@ DicomTagInfo_t* DicomLoader::createDicomTagsInfo()
|
||||
}
|
||||
|
||||
|
||||
SeriesImageSet* DicomLoader::createSeries(UniqueIDInfo_t* uniqueID)
|
||||
SeriesImageSet* DicomLoader::createSeries(const std::string& uniqueID)
|
||||
{
|
||||
|
||||
SeriesImageSet* series = instance->getSeriesImageSet(*uniqueID);
|
||||
SeriesImageSet* series = instance->getSeriesImageSet(uniqueID);
|
||||
|
||||
series->setUpSeriesInstance();
|
||||
return series;
|
||||
@@ -416,14 +311,20 @@ void DicomLoader::readSeries() {
|
||||
|
||||
for (ExtendMedicalImageProperties* property: imageProperties){
|
||||
|
||||
UniqueIDInfo_t *unique = new UniqueIDInfo_t;
|
||||
copyUniqueInfo(unique, property);
|
||||
|
||||
std::string unique = "";
|
||||
std::string patient_name = property->GetPatientName();
|
||||
std::string study_uid = property->GetStudyUID();
|
||||
std::string series_uid = property->GetSeriesUID();
|
||||
unique.append(patient_name);
|
||||
unique.append("_");
|
||||
unique.append(study_uid);
|
||||
unique.append("_");
|
||||
unique.append(series_uid);
|
||||
//patient level
|
||||
PatientInfo_t* patient = nullptr;
|
||||
//get from store
|
||||
if (m_patients.count(unique->patient_name)>0){
|
||||
patient = m_patients[unique->patient_name];
|
||||
if (m_patients.count(patient_name)>0){
|
||||
patient = m_patients[patient_name];
|
||||
}
|
||||
else{
|
||||
//create new
|
||||
@@ -431,34 +332,34 @@ void DicomLoader::readSeries() {
|
||||
patient->patient_name = property->GetPatientName();
|
||||
patient->birth_date = property->GetPatientBirthDate();
|
||||
patient->studies = new StudiesMapType();
|
||||
m_patients[unique->patient_name] = patient;
|
||||
m_patients[patient_name] = patient;
|
||||
}
|
||||
StudyInfo_t* study = nullptr;
|
||||
//get from store
|
||||
if (patient->studies->count(unique->study_uid)>0){
|
||||
study = patient->studies->at(unique->study_uid);
|
||||
if (patient->studies->count(study_uid)>0){
|
||||
study = patient->studies->at(study_uid);
|
||||
}
|
||||
else{
|
||||
//create new
|
||||
study = new StudyInfo_t();
|
||||
patient->studies->insert({unique->study_uid, study});
|
||||
patient->studies->insert({study_uid, study});
|
||||
study->study_description = property->GetStudyDescription();
|
||||
study->study_date = property->GetStudyDate();
|
||||
study->study_time = property->GetStudyTime();
|
||||
study->series = new SeriesMapType();
|
||||
}
|
||||
SeriesInfo_t* series = nullptr;
|
||||
if (study->series->count(unique->series_uid)>0){
|
||||
series = study->series->at(unique->series_uid);
|
||||
if (study->series->count(series_uid)>0){
|
||||
series = study->series->at(series_uid);
|
||||
//TODO:need to add override logic!!
|
||||
}
|
||||
else {
|
||||
series = new SeriesInfo_t();
|
||||
study->series->insert({unique->series_uid,series});
|
||||
study->series->insert({series_uid,series});
|
||||
DicomTagInfo_t *dicom = new DicomTagInfo_t;
|
||||
copyDicomTasInfo(dicom, property);
|
||||
series->tag_info = dicom;
|
||||
series->unique_info = unique;
|
||||
series->unique_id = unique;
|
||||
double *wlww = property->GetNthWindowLevelPreset(0);
|
||||
int ww = wlww ? ((int) wlww[0]) : (512);
|
||||
int wl = wlww ? ((int) wlww[1]) : (256);
|
||||
|
||||
@@ -9,16 +9,19 @@
|
||||
qint32 SeriesImageSet::image_label_size = 100;
|
||||
|
||||
//----------------------------------------------------------------
|
||||
SeriesImageSet::SeriesImageSet(const UniqueIDInfo& uniqueID,ExtendMedicalImageProperties* property, vtkImageData* imagedata) :
|
||||
m_pUniqueID(uniqueID)
|
||||
SeriesImageSet::SeriesImageSet(ExtendMedicalImageProperties* property, vtkImageData* imagedata)
|
||||
{
|
||||
m_image = imagedata;
|
||||
m_property = property;
|
||||
m_pUniqueID.append(property->GetPatientName());
|
||||
m_pUniqueID.append("_");
|
||||
m_pUniqueID.append(property->GetStudyUID());
|
||||
m_pUniqueID.append("_");
|
||||
m_pUniqueID.append(property->GetSeriesUID());
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
SeriesImageSet::~SeriesImageSet() {
|
||||
if (m_property) m_property->Delete();
|
||||
m_property = nullptr;
|
||||
}
|
||||
|
||||
@@ -54,7 +57,6 @@ const char* SeriesImageSet::getCurImageName() const
|
||||
|
||||
const char* SeriesImageSet::getCurSeriesName() const
|
||||
{
|
||||
if (m_pUniqueID.dicom_name.empty())
|
||||
return nullptr;
|
||||
return m_pUniqueID.dicom_name.c_str();
|
||||
if (!m_property) return nullptr;
|
||||
return m_property->GetSeriesNumber();
|
||||
}
|
||||
@@ -221,7 +221,7 @@ void ThumbnailBarWidget::Slot_setCurrentThumbnail(DicomImageView *view)
|
||||
SeriesImageSet *series = view->getSeriesInstance();
|
||||
//set to another
|
||||
DicomLoader *helper = DicomLoader::GetInstance();
|
||||
SeriesInfo_t* cur_serie = helper->getSerieInfo(*series->getUniqueID());
|
||||
SeriesInfo_t* cur_serie = helper->getSerieInfo(series->getUniqueID());
|
||||
if (cur_serie)
|
||||
{
|
||||
thumbnailImage *thumb = cur_serie->thumb_nail;
|
||||
|
||||
@@ -73,21 +73,6 @@ SeriesImageSet* ViewContainerWidget::getCurrentSeries() const
|
||||
}
|
||||
|
||||
|
||||
void ViewContainerWidget::getRelevantViewList(const UniqueIDInfo& unique, QList<DicomImageView*> & viewList)
|
||||
{
|
||||
for (auto *v : view_list_) {
|
||||
if (v->HasSeries())
|
||||
{
|
||||
UniqueIDInfo_t* exist = v->getSeriesInstance()->getUniqueID();
|
||||
if (DicomUtil::EqualsUnique(*exist, unique))
|
||||
{
|
||||
viewList.push_back(v);
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ViewContainerWidget::Slot_SyncEvent(DicomImageView *view, int interactionMode, void* calldata)
|
||||
{
|
||||
|
||||
@@ -395,7 +380,7 @@ void ViewContainerWidget::Slot_DragDropEvent(DicomImageView *view, thumbnailImag
|
||||
{
|
||||
old = view->getSeriesInstance();
|
||||
}
|
||||
replaceViewWithSerie(serie_info->unique_info, view);
|
||||
replaceViewWithSerie(serie_info->unique_id, view);
|
||||
setCurrentView(view);
|
||||
}
|
||||
|
||||
@@ -407,11 +392,11 @@ void ViewContainerWidget::Slot_ThumbnailClickEvent(thumbnailImage* tb)
|
||||
return;
|
||||
}
|
||||
SeriesInfo_t* serie_info = tb->getSeriesInfo();
|
||||
replaceViewWithSerie(serie_info->unique_info, view);
|
||||
replaceViewWithSerie(serie_info->unique_id, view);
|
||||
setCurrentView(view);
|
||||
}
|
||||
|
||||
void ViewContainerWidget::replaceViewWithSerie(UniqueIDInfo_t* unique_info, DicomImageView* curV)
|
||||
void ViewContainerWidget::replaceViewWithSerie(const std::string& uniqueid, DicomImageView* curV)
|
||||
{
|
||||
if (!curV)
|
||||
{
|
||||
@@ -419,7 +404,7 @@ void ViewContainerWidget::replaceViewWithSerie(UniqueIDInfo_t* unique_info, Dico
|
||||
}
|
||||
curV->removeViewWithFusion();
|
||||
DicomLoader *helper = DicomLoader::GetInstance();
|
||||
curV->setDicomImageView(helper->createSeries(unique_info));
|
||||
curV->setDicomImageView(helper->createSeries(uniqueid));
|
||||
curV->Render();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user