feat: Add real progress to down loading image from PACS
This commit is contained in:
@@ -14,6 +14,7 @@ struct PACSStudyInfo {
|
|||||||
QString studyInstanceUID;
|
QString studyInstanceUID;
|
||||||
QString studyID;
|
QString studyID;
|
||||||
QString requestingPhysician;
|
QString requestingPhysician;
|
||||||
|
QString relatedInstanceNumber;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PACSSeriesInfo {
|
struct PACSSeriesInfo {
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
#include "MoveStoreScp.h"
|
#include "MoveStoreScp.h"
|
||||||
|
|
||||||
namespace
|
|
||||||
{
|
|
||||||
const int USCT_IMAGE_COUNT = 270 + 73 + 73;
|
|
||||||
}
|
|
||||||
|
|
||||||
MoveStoreScp::MoveStoreScp()
|
MoveStoreScp::MoveStoreScp()
|
||||||
: QObject()
|
: QObject()
|
||||||
, DcmStorageSCP()
|
, DcmStorageSCP()
|
||||||
, mCount(0)
|
, mCount(0)
|
||||||
|
, mImageTotalCount(0)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -21,7 +17,7 @@ bool MoveStoreScp::stopAfterCurrentAssociation()
|
|||||||
OFCondition MoveStoreScp::handleIncomingCommand(T_DIMSE_Message *incomingMsg, const DcmPresentationContextInfo &presInfo)
|
OFCondition MoveStoreScp::handleIncomingCommand(T_DIMSE_Message *incomingMsg, const DcmPresentationContextInfo &presInfo)
|
||||||
{
|
{
|
||||||
mCount++;
|
mCount++;
|
||||||
double progress = (double)mCount / (double)USCT_IMAGE_COUNT;
|
double progress = (double)mCount / (double)mImageTotalCount;
|
||||||
emit movePorgress(progress);
|
emit movePorgress(progress);
|
||||||
return DcmStorageSCP::handleIncomingCommand(incomingMsg, presInfo);
|
return DcmStorageSCP::handleIncomingCommand(incomingMsg, presInfo);
|
||||||
}
|
}
|
||||||
@@ -30,3 +26,8 @@ void MoveStoreScp::clearCount()
|
|||||||
{
|
{
|
||||||
mCount = 0;
|
mCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MoveStoreScp::SetImageTotalCount(int aValue)
|
||||||
|
{
|
||||||
|
mImageTotalCount = aValue;
|
||||||
|
}
|
||||||
|
|||||||
@@ -12,12 +12,14 @@ public:
|
|||||||
bool stopAfterCurrentAssociation();
|
bool stopAfterCurrentAssociation();
|
||||||
virtual OFCondition handleIncomingCommand(T_DIMSE_Message *incomingMsg, const DcmPresentationContextInfo &presInfo);
|
virtual OFCondition handleIncomingCommand(T_DIMSE_Message *incomingMsg, const DcmPresentationContextInfo &presInfo);
|
||||||
void clearCount();
|
void clearCount();
|
||||||
|
void SetImageTotalCount(int aValue);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void movePorgress(double aPorgress);
|
void movePorgress(double aPorgress);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int mCount;
|
int mCount;
|
||||||
|
int mImageTotalCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MOVESTORESCP_H
|
#endif // MOVESTORESCP_H
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ MoveStoreThread::MoveStoreThread(const std::string aAETitle, unsigned short aPor
|
|||||||
, mAETitle(aAETitle)
|
, mAETitle(aAETitle)
|
||||||
, mPort(aPort)
|
, mPort(aPort)
|
||||||
, mScp(new MoveStoreScp())
|
, mScp(new MoveStoreScp())
|
||||||
|
, mImageTotalCount(0)
|
||||||
{
|
{
|
||||||
mScp->setVerbosePCMode(false);
|
mScp->setVerbosePCMode(false);
|
||||||
OFList<OFString> syntaxes;
|
OFList<OFString> syntaxes;
|
||||||
@@ -24,6 +25,7 @@ MoveStoreThread::~MoveStoreThread()
|
|||||||
void MoveStoreThread::run()
|
void MoveStoreThread::run()
|
||||||
{
|
{
|
||||||
mScp->clearCount();
|
mScp->clearCount();
|
||||||
|
mScp->SetImageTotalCount(mImageTotalCount);
|
||||||
mScp->setAETitle(mAETitle);
|
mScp->setAETitle(mAETitle);
|
||||||
mScp->setPort(mPort);
|
mScp->setPort(mPort);
|
||||||
mScp->setOutputDirectory(mOutputPath);
|
mScp->setOutputDirectory(mOutputPath);
|
||||||
@@ -40,3 +42,7 @@ void MoveStoreThread::setOutputPath(const std::string& aOutputPath)
|
|||||||
{
|
{
|
||||||
mOutputPath = aOutputPath;
|
mOutputPath = aOutputPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MoveStoreThread::setImageTotalCount(int aValue){
|
||||||
|
mImageTotalCount = aValue;
|
||||||
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ public:
|
|||||||
void run();
|
void run();
|
||||||
void setScpConfig(const std::string aAETitle, unsigned short aPort);
|
void setScpConfig(const std::string aAETitle, unsigned short aPort);
|
||||||
void setOutputPath(const std::string& aOutputPath);
|
void setOutputPath(const std::string& aOutputPath);
|
||||||
|
void setImageTotalCount(int aValue);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void moveProgress(double aPorgress);
|
void moveProgress(double aPorgress);
|
||||||
@@ -23,6 +24,7 @@ private:
|
|||||||
unsigned short mPort;
|
unsigned short mPort;
|
||||||
std::string mOutputPath;
|
std::string mOutputPath;
|
||||||
MoveStoreScp* mScp;
|
MoveStoreScp* mScp;
|
||||||
|
int mImageTotalCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MOVESTORETHREAD_H
|
#endif // MOVESTORETHREAD_H
|
||||||
|
|||||||
@@ -47,6 +47,11 @@ void MoveWorker::setPacsInfo(const std::string& peerIP, unsigned long peerPort,
|
|||||||
mStrPeerTitle = peerTitle;
|
mStrPeerTitle = peerTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MoveWorker::setImageTotalCount(int aValue)
|
||||||
|
{
|
||||||
|
mMoveStoreThread->setImageTotalCount(aValue);
|
||||||
|
}
|
||||||
|
|
||||||
bool MoveWorker::initDcmSCU()
|
bool MoveWorker::initDcmSCU()
|
||||||
{
|
{
|
||||||
mScu = new DcmSCU();
|
mScu = new DcmSCU();
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ public:
|
|||||||
~MoveWorker();
|
~MoveWorker();
|
||||||
void setOutputDirectory(const QString& outputDir);
|
void setOutputDirectory(const QString& outputDir);
|
||||||
void setPacsInfo(const std::string& peerIP, unsigned long peerPort, const std::string& peerTitle);
|
void setPacsInfo(const std::string& peerIP, unsigned long peerPort, const std::string& peerTitle);
|
||||||
|
void setImageTotalCount(int aValue);
|
||||||
|
|
||||||
void setListenInfo(const std::string& aOurTitle, unsigned long aOurPort);
|
void setListenInfo(const std::string& aOurTitle, unsigned long aOurPort);
|
||||||
Q_INVOKABLE void moveByStudyInstanceUID(const QString& studyInstanceUID);
|
Q_INVOKABLE void moveByStudyInstanceUID(const QString& studyInstanceUID);
|
||||||
|
|
||||||
|
|||||||
@@ -71,6 +71,8 @@ void QueryWorker::initQueryDataSet()
|
|||||||
m_QueryDataSet->putAndInsertOFStringArray(DCM_SeriesInstanceUID,"");
|
m_QueryDataSet->putAndInsertOFStringArray(DCM_SeriesInstanceUID,"");
|
||||||
m_QueryDataSet->putAndInsertOFStringArray(DCM_Modality,"");
|
m_QueryDataSet->putAndInsertOFStringArray(DCM_Modality,"");
|
||||||
m_QueryDataSet->putAndInsertOFStringArray(DCM_SeriesNumber,"");
|
m_QueryDataSet->putAndInsertOFStringArray(DCM_SeriesNumber,"");
|
||||||
|
m_QueryDataSet->putAndInsertOFStringArray(DCM_NumberOfStudyRelatedInstances,"");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QueryWorker::executeCFind(DcmDataset* aQueryKeys)
|
void QueryWorker::executeCFind(DcmDataset* aQueryKeys)
|
||||||
@@ -217,7 +219,8 @@ void QueryWorker::onFoundResult(int index, DcmDataset *response)
|
|||||||
{
|
{
|
||||||
std::string studyDate_, patientName_, patientID_, accessionNumber_,
|
std::string studyDate_, patientName_, patientID_, accessionNumber_,
|
||||||
patientBirthDate_, patientSex_, studyInstanceUID_,
|
patientBirthDate_, patientSex_, studyInstanceUID_,
|
||||||
studyID_, requestingPhysician_, seriesUid_, modality_, seriesNumber_;
|
studyID_, requestingPhysician_, seriesUid_, modality_, seriesNumber_,
|
||||||
|
instanceNumber_;
|
||||||
response->findAndGetOFString(DCM_StudyDate, studyDate_);
|
response->findAndGetOFString(DCM_StudyDate, studyDate_);
|
||||||
response->findAndGetOFString(DCM_PatientName, patientName_);
|
response->findAndGetOFString(DCM_PatientName, patientName_);
|
||||||
response->findAndGetOFString(DCM_PatientID, patientID_);
|
response->findAndGetOFString(DCM_PatientID, patientID_);
|
||||||
@@ -230,6 +233,8 @@ void QueryWorker::onFoundResult(int index, DcmDataset *response)
|
|||||||
response->findAndGetOFString(DCM_SeriesInstanceUID, seriesUid_);
|
response->findAndGetOFString(DCM_SeriesInstanceUID, seriesUid_);
|
||||||
response->findAndGetOFString(DCM_Modality, modality_);
|
response->findAndGetOFString(DCM_Modality, modality_);
|
||||||
response->findAndGetOFString(DCM_SeriesNumber, seriesNumber_);
|
response->findAndGetOFString(DCM_SeriesNumber, seriesNumber_);
|
||||||
|
response->findAndGetOFString(DCM_NumberOfStudyRelatedInstances, instanceNumber_);
|
||||||
|
|
||||||
|
|
||||||
if (m_iQueryLevel == 0)
|
if (m_iQueryLevel == 0)
|
||||||
{
|
{
|
||||||
@@ -243,6 +248,8 @@ void QueryWorker::onFoundResult(int index, DcmDataset *response)
|
|||||||
study.studyInstanceUID = QString::fromStdString(studyInstanceUID_);
|
study.studyInstanceUID = QString::fromStdString(studyInstanceUID_);
|
||||||
study.studyID = QString::fromStdString(studyID_);
|
study.studyID = QString::fromStdString(studyID_);
|
||||||
study.requestingPhysician = QString::fromStdString(requestingPhysician_);
|
study.requestingPhysician = QString::fromStdString(requestingPhysician_);
|
||||||
|
study.relatedInstanceNumber = QString::fromStdString(instanceNumber_);
|
||||||
|
|
||||||
emit sendStudyItemFound(study);
|
emit sendStudyItemFound(study);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -509,7 +509,7 @@ void ImportWidget::updateStudyView()
|
|||||||
QStandardItem* performPhy = new QStandardItem(""); performPhy->setEditable(false);
|
QStandardItem* performPhy = new QStandardItem(""); performPhy->setEditable(false);
|
||||||
QStandardItem* readingPhysician = new QStandardItem(itr->requestingPhysician); readingPhysician->setEditable(false);
|
QStandardItem* readingPhysician = new QStandardItem(itr->requestingPhysician); readingPhysician->setEditable(false);
|
||||||
QStandardItem* inst = new QStandardItem(""); inst->setEditable(false);
|
QStandardItem* inst = new QStandardItem(""); inst->setEditable(false);
|
||||||
QStandardItem* image = new QStandardItem(""); image->setEditable(false);
|
QStandardItem* image = new QStandardItem(itr->relatedInstanceNumber); image->setEditable(false);
|
||||||
QStandardItem* source = new QStandardItem(m_pPacsComboBox->currentText()); source->setEditable(false);
|
QStandardItem* source = new QStandardItem(m_pPacsComboBox->currentText()); source->setEditable(false);
|
||||||
|
|
||||||
QList<QStandardItem*> list;
|
QList<QStandardItem*> list;
|
||||||
@@ -620,8 +620,9 @@ void ImportWidget::executeCMove(const QModelIndex ¤t)
|
|||||||
{
|
{
|
||||||
m_pProgressBar->setValue(0);
|
m_pProgressBar->setValue(0);
|
||||||
}
|
}
|
||||||
|
bool toIntFlag = false;
|
||||||
//std::string seriesNumber = m_pSeriesModel->index(row, 1).data().toString().toStdString();
|
int imageCount = m_pStudyModel->index(row, 12).data().toInt(&toIntFlag);
|
||||||
|
if (!toIntFlag) imageCount = 0;
|
||||||
std::string studyInstanceUID = m_pStudyModel->index(row, 6).data().toString().toStdString();
|
std::string studyInstanceUID = m_pStudyModel->index(row, 6).data().toString().toStdString();
|
||||||
std::string studyID = m_pStudyModel->index(row, 5).data().toString().toStdString();
|
std::string studyID = m_pStudyModel->index(row, 5).data().toString().toStdString();
|
||||||
//std::string seriesUID = m_pSeriesModel->index(row, 6).data().toString().toStdString();
|
//std::string seriesUID = m_pSeriesModel->index(row, 6).data().toString().toStdString();
|
||||||
@@ -645,6 +646,7 @@ void ImportWidget::executeCMove(const QModelIndex ¤t)
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
mMoveWorker->setImageTotalCount(imageCount);
|
||||||
mMoveWorker->setPacsInfo(peerIP,peerPort,peerTitle);
|
mMoveWorker->setPacsInfo(peerIP,peerPort,peerTitle);
|
||||||
mMoveWorker->setListenInfo(ourTitle, ourPort);
|
mMoveWorker->setListenInfo(ourTitle, ourPort);
|
||||||
mMoveWorker->setOutputDirectory(QString::fromStdString(outDirectory));
|
mMoveWorker->setOutputDirectory(QString::fromStdString(outDirectory));
|
||||||
|
|||||||
Reference in New Issue
Block a user