feat: add default layout open function from PACS
This commit is contained in:
@@ -141,6 +141,12 @@ enum SeriesOpenMode {
|
|||||||
DIR_OPEN_MODE
|
DIR_OPEN_MODE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum SeriesType {
|
||||||
|
UNKNOWN_SIDE,
|
||||||
|
LEFT_SIDE,
|
||||||
|
RIGHT_SIDE
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
//typedef std::shared_ptr<DicomTagInfo_t> DicomTagInfo_t*;
|
//typedef std::shared_ptr<DicomTagInfo_t> DicomTagInfo_t*;
|
||||||
//typedef std::shared_ptr<UniqueIDInfo_t> UniqueIDInfo_t*;
|
//typedef std::shared_ptr<UniqueIDInfo_t> UniqueIDInfo_t*;
|
||||||
|
|||||||
@@ -368,6 +368,17 @@ void ImageViewManager::viewReload(const std::string &unique_info) {
|
|||||||
reloadCurrentView(currentView);
|
reloadCurrentView(currentView);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ImageViewManager::viewReloadWithID(int aID, const std::string &unique_info)
|
||||||
|
{
|
||||||
|
if (!getView(aID)) return;
|
||||||
|
auto selectView = getView(aID);
|
||||||
|
selectView->unloadFusion();
|
||||||
|
ImageSetStore *helper = ImageSetStore::GetInstance();
|
||||||
|
selectView->loadSeries(helper->getSeriesImageSet(unique_info));
|
||||||
|
selectView->render();
|
||||||
|
reloadCurrentView(selectView);
|
||||||
|
}
|
||||||
|
|
||||||
void ImageViewManager::viewCleared(DicomImageView* view) {
|
void ImageViewManager::viewCleared(DicomImageView* view) {
|
||||||
smartDo([](auto v, auto callData) {
|
smartDo([](auto v, auto callData) {
|
||||||
auto src = (DicomImageView*)callData;
|
auto src = (DicomImageView*)callData;
|
||||||
|
|||||||
@@ -73,6 +73,9 @@ public:
|
|||||||
|
|
||||||
void viewReload(const std::string &unique_info);
|
void viewReload(const std::string &unique_info);
|
||||||
|
|
||||||
|
void viewReloadWithID(int aID, const std::string &unique_info);
|
||||||
|
|
||||||
|
|
||||||
void viewCleared(DicomImageView* view);
|
void viewCleared(DicomImageView* view);
|
||||||
|
|
||||||
void clearCurrentView();
|
void clearCurrentView();
|
||||||
|
|||||||
@@ -295,7 +295,7 @@ void QDicomViewer::Slot_ToolbarVisibilityChanged(bool visible) {
|
|||||||
|
|
||||||
void QDicomViewer::openDICOMFromPACS(int err, std::string dirName) {
|
void QDicomViewer::openDICOMFromPACS(int err, std::string dirName) {
|
||||||
if (err == NOERROR) {
|
if (err == NOERROR) {
|
||||||
openDICOM(dirName, DIR_OPEN_MODE);
|
openDICOMWithLayout(dirName, LEFT_SIDE);
|
||||||
} else {
|
} else {
|
||||||
//pop out msg box
|
//pop out msg box
|
||||||
QMessageBox::warning(this, tr("Warning"), tr("open DICOM Images From PACS Fail"));
|
QMessageBox::warning(this, tr("Warning"), tr("open DICOM Images From PACS Fail"));
|
||||||
@@ -325,7 +325,7 @@ void QDicomViewer::openDICOM(const std::string &dicomName, SeriesOpenMode openMo
|
|||||||
int count = 0;
|
int count = 0;
|
||||||
std::vector<ExtendMedicalImageProperties*> vector;
|
std::vector<ExtendMedicalImageProperties*> vector;
|
||||||
if (openMode == SeriesOpenMode::DIR_OPEN_MODE){
|
if (openMode == SeriesOpenMode::DIR_OPEN_MODE){
|
||||||
DicomLoader::readPropertiesFromDir(dicomName, vector,count);
|
DicomLoader::readPropertiesFromDir(dicomName, vector, count);
|
||||||
}else{
|
}else{
|
||||||
DicomLoader::readPropertiesFromFile(dicomName, vector, count);
|
DicomLoader::readPropertiesFromFile(dicomName, vector, count);
|
||||||
}
|
}
|
||||||
@@ -338,4 +338,54 @@ void QDicomViewer::openDICOM(const std::string &dicomName, SeriesOpenMode openMo
|
|||||||
ui->thumbnailBar->updateThumbnailBar();
|
ui->thumbnailBar->updateThumbnailBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QDicomViewer::openDICOMWithLayout(const std::string &dicomName, SeriesType aSeriesType)
|
||||||
|
{
|
||||||
|
displayThumbnailBar(true);
|
||||||
|
ui->viewContainer->viewLayoutChanged(2,2);
|
||||||
|
|
||||||
|
//reset store
|
||||||
|
ImageSetStore *helper = ImageSetStore::GetInstance();
|
||||||
|
helper->reset();
|
||||||
|
|
||||||
|
int count = 0;
|
||||||
|
std::vector<ExtendMedicalImageProperties*> vector;
|
||||||
|
DicomLoader::readPropertiesFromDir(dicomName, vector, count);
|
||||||
|
QString selectSide = "L";
|
||||||
|
if (aSeriesType == UNKNOWN_SIDE)
|
||||||
|
{
|
||||||
|
bool canload = false;
|
||||||
|
for (int i = 0; i < count; ++i) {
|
||||||
|
QString des = vector[i]->GetSeriesDescription();
|
||||||
|
if (des.count() < 6) continue;
|
||||||
|
//default use Left side
|
||||||
|
if (des.left(4).toUpper() == "REFL" && des.right(1) == "L")
|
||||||
|
canload = true;
|
||||||
|
}
|
||||||
|
if (!canload) selectSide = "R";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
selectSide = aSeriesType == LEFT_SIDE ? "L" : "R";
|
||||||
|
}
|
||||||
|
for (int i = 0; i < count; ++i)
|
||||||
|
{
|
||||||
|
helper->addImageSet(vector[i]);
|
||||||
|
QString des = vector[i]->GetSeriesDescription();
|
||||||
|
if (des.count() < 6)
|
||||||
|
continue;
|
||||||
|
if (des.left(4).toUpper() == "REFL" && des.right(1) == selectSide)
|
||||||
|
{
|
||||||
|
ui->viewContainer->getViewManager()->viewReloadWithID(0, vector[i]->GetUniqueID());
|
||||||
|
ui->viewContainer->getViewManager()->getView(0)->setReconPlane(0);
|
||||||
|
ui->viewContainer->getViewManager()->viewReloadWithID(1, vector[i]->GetUniqueID());
|
||||||
|
ui->viewContainer->getViewManager()->getView(1)->setReconPlane(1);
|
||||||
|
ui->viewContainer->getViewManager()->viewReloadWithID(2, vector[i]->GetUniqueID());
|
||||||
|
ui->viewContainer->getViewManager()->getView(02)->setReconPlane(2);
|
||||||
|
|
||||||
|
}
|
||||||
|
if (des.left(7).toUpper() == "CORONAL" && des.right(1) == selectSide)
|
||||||
|
{
|
||||||
|
ui->viewContainer->getViewManager()->viewReloadWithID(3, vector[i]->GetUniqueID());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ui->thumbnailBar->updateThumbnailBar();
|
||||||
|
}
|
||||||
|
|||||||
@@ -70,6 +70,9 @@ private:
|
|||||||
*/
|
*/
|
||||||
void openDICOM(const std::string &dicomName, SeriesOpenMode openMode);
|
void openDICOM(const std::string &dicomName, SeriesOpenMode openMode);
|
||||||
|
|
||||||
|
void openDICOMWithLayout(const std::string &dicomName, SeriesType aSeriesType = UNKNOWN_SIDE);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置部分空间的槽函数连接
|
* 设置部分空间的槽函数连接
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user