Refactor dicomimageview. 2
This commit is contained in:
@@ -63,7 +63,7 @@ void ExportDialog::onBtnExportClicked()
|
|||||||
//export files
|
//export files
|
||||||
if (ui->rbCurrentImage->isChecked())//current image
|
if (ui->rbCurrentImage->isChecked())//current image
|
||||||
{
|
{
|
||||||
if (cur_view->HasSeries())
|
if (cur_view->hasSeries())
|
||||||
{
|
{
|
||||||
QString imageName(cur_view->getSeriesInstance()->getCurImageName());
|
QString imageName(cur_view->getSeriesInstance()->getCurImageName());
|
||||||
options.inputData.push_back(imageName);
|
options.inputData.push_back(imageName);
|
||||||
@@ -71,7 +71,7 @@ void ExportDialog::onBtnExportClicked()
|
|||||||
}
|
}
|
||||||
else if (ui->rbCurrentSeries->isChecked())//current series
|
else if (ui->rbCurrentSeries->isChecked())//current series
|
||||||
{
|
{
|
||||||
if (cur_view->HasSeries())
|
if (cur_view->hasSeries())
|
||||||
{
|
{
|
||||||
QString serieName(cur_view->getSeriesInstance()->getSeriesName());
|
QString serieName(cur_view->getSeriesInstance()->getSeriesName());
|
||||||
options.inputData.push_back(serieName);
|
options.inputData.push_back(serieName);
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ void ImageViewManager::smartDo(SmartDoCallback cb, DicomImageView *sourceView, v
|
|||||||
std::for_each(vList.begin(),vList.end(),[=](auto v){
|
std::for_each(vList.begin(),vList.end(),[=](auto v){
|
||||||
//check series
|
//check series
|
||||||
auto series = sourceView->getSeriesInstance();
|
auto series = sourceView->getSeriesInstance();
|
||||||
if (v->getSeriesInstance()==series && v->GetSliceOrientation() == sourceView->GetSliceOrientation()){
|
if (v->getSeriesInstance()==series && v->getSliceOrientation() == sourceView->getSliceOrientation()){
|
||||||
cb(v, callData);
|
cb(v, callData);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,14 +51,14 @@ void ImageViewManager::smartDo(SmartDoCallback cb, DicomImageView *sourceView, v
|
|||||||
case DoScope::EStudyEBoundsSeries:{
|
case DoScope::EStudyEBoundsSeries:{
|
||||||
std::for_each(vList.begin(),vList.end(),[=](auto v) {
|
std::for_each(vList.begin(),vList.end(),[=](auto v) {
|
||||||
if (v == sourceView) return;
|
if (v == sourceView) return;
|
||||||
if (!v->HasSeries()) return;
|
if (!v->hasSeries()) return;
|
||||||
//check series
|
//check series
|
||||||
auto series = sourceView->getSeriesInstance();
|
auto series = sourceView->getSeriesInstance();
|
||||||
auto currentSeries = v->getSeriesInstance();
|
auto currentSeries = v->getSeriesInstance();
|
||||||
//same series
|
//same series
|
||||||
if (series == currentSeries
|
if (series == currentSeries
|
||||||
//equal slice orientation
|
//equal slice orientation
|
||||||
&& v->GetSliceOrientation() == sourceView->GetSliceOrientation()) {
|
&& v->getSliceOrientation() == sourceView->getSliceOrientation()) {
|
||||||
cb(v, callData);
|
cb(v, callData);
|
||||||
}
|
}
|
||||||
//equal study
|
//equal study
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -32,7 +32,7 @@ public:
|
|||||||
|
|
||||||
~DicomImageView() override;
|
~DicomImageView() override;
|
||||||
|
|
||||||
void ShowMetaData();
|
void showMetaData();
|
||||||
|
|
||||||
QVTKOpenGLNativeWidget *getGLWidget() {
|
QVTKOpenGLNativeWidget *getGLWidget() {
|
||||||
return mGLWidget;
|
return mGLWidget;
|
||||||
@@ -44,12 +44,12 @@ public:
|
|||||||
|
|
||||||
void setHighlight(bool yes);
|
void setHighlight(bool yes);
|
||||||
|
|
||||||
void Render();
|
void render();
|
||||||
|
|
||||||
//Series
|
//Series
|
||||||
void setDicomImageView(SeriesImageSet *series);
|
void setDicomImageView(SeriesImageSet *series);
|
||||||
|
|
||||||
bool HasSeries();
|
bool hasSeries();
|
||||||
|
|
||||||
int getSeriesNumber();
|
int getSeriesNumber();
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Reset
|
//Reset
|
||||||
void ResetView();
|
void resetView();
|
||||||
|
|
||||||
|
|
||||||
//Corner Info
|
//Corner Info
|
||||||
@@ -67,50 +67,50 @@ public:
|
|||||||
void updateCornerInfoPrivacy();
|
void updateCornerInfoPrivacy();
|
||||||
|
|
||||||
//Window level
|
//Window level
|
||||||
void GetWindowLevel(double &level, double &width);
|
void getWindowLevel(double &level, double &width);
|
||||||
|
|
||||||
void SetWindowLevel(double level, double width);
|
void setWindowLevel(double level, double width);
|
||||||
|
|
||||||
//Transformation
|
//Transformation
|
||||||
void ClearTransformations();
|
void ClearTransformations();
|
||||||
|
|
||||||
void HFlip();
|
void hFlipImage();
|
||||||
|
|
||||||
void VFlip();
|
void vFlipImage();
|
||||||
|
|
||||||
void Rotate(double angle, TransFormType operation);
|
void rotateImage(double angle, TransFormType operation);
|
||||||
|
|
||||||
|
|
||||||
//Fusion
|
//Fusion
|
||||||
bool IsFusion();
|
bool isFusion();
|
||||||
|
|
||||||
void SetFusionOpacity(double percent);
|
void setFusionOpacity(double percent);
|
||||||
|
|
||||||
void SetFusionInput(DicomImageView *overlap);
|
void setFusionInput(DicomImageView *overlay);
|
||||||
|
|
||||||
void removeViewWithFusion();
|
void removeViewWithFusion();
|
||||||
|
|
||||||
|
|
||||||
//Measure
|
//Measure
|
||||||
void ActiveMeasure(Measure *m);
|
void activeMeasure(Measure *m);
|
||||||
|
|
||||||
void DeleteSelectedMeasure();
|
void deleteSelectedMeasure();
|
||||||
|
|
||||||
void DeleteCurrentSliceMeasure();
|
void deleteCurrentSliceMeasure();
|
||||||
|
|
||||||
void DeleteCurrentSeriesMeasure();
|
void deleteCurrentSeriesMeasure();
|
||||||
|
|
||||||
void removeViewWithMeasure();
|
void removeViewWithMeasure();
|
||||||
|
|
||||||
|
|
||||||
//Sync slice
|
//Sync slice
|
||||||
void AddSlice(int step);
|
void addSlice(int step);
|
||||||
|
|
||||||
void SetSlice(int slice);
|
void setSlice(int slice);
|
||||||
|
|
||||||
void SetZoomScale(double scale);
|
void setZoomScale(double scale);
|
||||||
|
|
||||||
void SetPanOffset(double *p);
|
void setPanOffset(double *p);
|
||||||
|
|
||||||
void SyncScrollBar();
|
void SyncScrollBar();
|
||||||
|
|
||||||
@@ -144,11 +144,11 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Negative
|
//Negative
|
||||||
void ToggleNegativeMode();
|
void negativeWindow();
|
||||||
|
|
||||||
void SetSliceOrientation(int orientation);
|
void getSliceOrientation(int orientation);
|
||||||
|
|
||||||
int GetSliceOrientation();
|
int getSliceOrientation();
|
||||||
|
|
||||||
bool CompareWorldSliceOrientation(DicomImageView *view) {
|
bool CompareWorldSliceOrientation(DicomImageView *view) {
|
||||||
return this->mImageViewer->GetWorldSliceOrientation() == view->mImageViewer->GetWorldSliceOrientation();
|
return this->mImageViewer->GetWorldSliceOrientation() == view->mImageViewer->GetWorldSliceOrientation();
|
||||||
@@ -177,17 +177,17 @@ signals:
|
|||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
//for title bar use
|
//for title bar use
|
||||||
void Slot_viewDoubleclicked();
|
void doubleClicked();
|
||||||
|
|
||||||
void Slot_ViewEmpty();
|
void viewCleared();
|
||||||
|
|
||||||
void Slot_scrollValueChanged(int);
|
void scrollBarValueChanged(int);
|
||||||
|
|
||||||
void Slot_WindowLevelEventForFusion(double level, double width);
|
void fusionWindowChanged(double level, double width);
|
||||||
|
|
||||||
void Slot_Transformation();
|
void imageTransformed();
|
||||||
|
|
||||||
void viewerClicked();
|
void clicked();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
@@ -255,11 +255,11 @@ private:
|
|||||||
|
|
||||||
|
|
||||||
//Callback
|
//Callback
|
||||||
void doubleclickedEventCb(vtkObject *sender, unsigned long eventId, void *calldata = nullptr);
|
void doubleclickedEventCb();
|
||||||
|
|
||||||
void scalarEventCb(vtkObject *sender, unsigned long eventId, void *calldata = nullptr);
|
void scalarEventCb(vtkObject *sender, unsigned long eventId, void *calldata = nullptr);
|
||||||
|
|
||||||
void updateWindowLevelCb(vtkObject *caller, unsigned long eid, void *calldata);
|
void updateWindowLevelCb();
|
||||||
|
|
||||||
void syncEventFunc(vtkObject *caller, unsigned long eid, void *calldata);
|
void syncEventFunc(vtkObject *caller, unsigned long eid, void *calldata);
|
||||||
|
|
||||||
@@ -272,31 +272,31 @@ private:
|
|||||||
*/
|
*/
|
||||||
MyTitleBar *createMyTitleBar();
|
MyTitleBar *createMyTitleBar();
|
||||||
|
|
||||||
void ResetPanZoom();
|
void resetPanZoom();
|
||||||
|
|
||||||
void initScrollbar();
|
void initScrollbar();
|
||||||
|
|
||||||
void LoadSeries(SeriesImageSet *series);
|
void loadSeries(SeriesImageSet *series);
|
||||||
|
|
||||||
vtkSmartPointer<vtkGenericOpenGLRenderWindow> mGLRenWin;
|
vtkSmartPointer<vtkGenericOpenGLRenderWindow> mGLRenWin;
|
||||||
|
|
||||||
infinitiViewer *mImageViewer = nullptr;
|
infinitiViewer *mImageViewer;
|
||||||
SeriesImageSet *mSeries = nullptr;
|
SeriesImageSet *mSeries;
|
||||||
ClickableScrollBar *mScrollBar = nullptr;
|
ClickableScrollBar *mScrollBar;
|
||||||
MyTitleBar *mTitleBar = nullptr;
|
MyTitleBar *mTitleBar;
|
||||||
QVTKOpenGLNativeWidget *mGLWidget = nullptr;
|
QVTKOpenGLNativeWidget *mGLWidget;
|
||||||
pqVCRToolbar *mVcrToolbar = nullptr;
|
pqVCRToolbar *mVcrToolbar ;
|
||||||
pqVCRController *mVcrController = nullptr;
|
pqVCRController *mVcrController;
|
||||||
QThread mVcrControlThread;
|
QThread mVcrControlThread;
|
||||||
DicomImageView *mOverlayView = nullptr;
|
DicomImageView *mOverlayView;
|
||||||
DicomImageView *mBaseView = nullptr;
|
DicomImageView *mBaseView;
|
||||||
|
|
||||||
int mSliceOrientation = 2;
|
int mSliceOrientation;
|
||||||
|
|
||||||
bool mIsCine = false;
|
bool mIsCine;
|
||||||
bool mIsNegative = false;
|
bool mIsNegative;
|
||||||
bool mIsOverlay = false;
|
bool mIsOverlay;
|
||||||
bool mIsSlotInited = false;
|
bool mIsSlotInited;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -173,7 +173,7 @@ void ThumbnailBarWidget::Slot_setCurrentThumbnail(DicomImageView *view)
|
|||||||
{
|
{
|
||||||
if (view != nullptr)
|
if (view != nullptr)
|
||||||
{
|
{
|
||||||
if (view->HasSeries()) {
|
if (view->hasSeries()) {
|
||||||
SeriesImageSet *series = view->getSeriesInstance();
|
SeriesImageSet *series = view->getSeriesInstance();
|
||||||
auto iter = std::find_if(LabelList.begin(),LabelList.end(),[=](QWidget* widget){
|
auto iter = std::find_if(LabelList.begin(),LabelList.end(),[=](QWidget* widget){
|
||||||
if(0 == strcmp(widget->metaObject()->className(),"thumbnailImage")){
|
if(0 == strcmp(widget->metaObject()->className(),"thumbnailImage")){
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ void ViewContainerWidget::Slot_SyncEvent(DicomImageView *view, int interactionMo
|
|||||||
if (SyncHelper::getSyncState() == AUTO_SYNC)
|
if (SyncHelper::getSyncState() == AUTO_SYNC)
|
||||||
{
|
{
|
||||||
manager.smartDo([](auto v,auto callData){
|
manager.smartDo([](auto v,auto callData){
|
||||||
if (v->HasSeries()) {
|
if (v->hasSeries()) {
|
||||||
double* r = (double*) callData;
|
double* r = (double*) callData;
|
||||||
v->SyncSlicePoint(r);
|
v->SyncSlicePoint(r);
|
||||||
v->SyncScrollBar();
|
v->SyncScrollBar();
|
||||||
@@ -80,10 +80,10 @@ void ViewContainerWidget::Slot_SyncEvent(DicomImageView *view, int interactionMo
|
|||||||
if (SyncHelper::getSyncState() == MANUAL_SYNC)
|
if (SyncHelper::getSyncState() == MANUAL_SYNC)
|
||||||
{
|
{
|
||||||
manager.smartDo([](auto v,auto callData){
|
manager.smartDo([](auto v,auto callData){
|
||||||
if (v->HasSeries()) {
|
if (v->hasSeries()) {
|
||||||
//disable global trigger slot
|
//disable global trigger slot
|
||||||
int *r = (int *) callData;
|
int *r = (int *) callData;
|
||||||
v->AddSlice(r[1]);
|
v->addSlice(r[1]);
|
||||||
}
|
}
|
||||||
},view, calldata,ImageViewManager::EStudyEBoundsSeries);
|
},view, calldata,ImageViewManager::EStudyEBoundsSeries);
|
||||||
}
|
}
|
||||||
@@ -94,10 +94,10 @@ void ViewContainerWidget::Slot_SyncEvent(DicomImageView *view, int interactionMo
|
|||||||
if (SyncHelper::getSyncItem(ZOOM_PAN))
|
if (SyncHelper::getSyncItem(ZOOM_PAN))
|
||||||
{
|
{
|
||||||
manager.smartDo([](auto v,auto callData){
|
manager.smartDo([](auto v,auto callData){
|
||||||
if (v->HasSeries()) {
|
if (v->hasSeries()) {
|
||||||
double *d = (double *)callData;
|
double *d = (double *)callData;
|
||||||
double vector[3] = { d[3] - d[0],d[4] - d[1],d[5] - d[2] };
|
double vector[3] = { d[3] - d[0],d[4] - d[1],d[5] - d[2] };
|
||||||
v->SetPanOffset(vector);
|
v->setPanOffset(vector);
|
||||||
}
|
}
|
||||||
},view, calldata,ImageViewManager::EStudyEBoundsSeries);
|
},view, calldata,ImageViewManager::EStudyEBoundsSeries);
|
||||||
}
|
}
|
||||||
@@ -106,9 +106,9 @@ void ViewContainerWidget::Slot_SyncEvent(DicomImageView *view, int interactionMo
|
|||||||
if (SyncHelper::getSyncItem(ZOOM_PAN))
|
if (SyncHelper::getSyncItem(ZOOM_PAN))
|
||||||
{
|
{
|
||||||
manager.smartDo([](auto v,auto callData){
|
manager.smartDo([](auto v,auto callData){
|
||||||
if (v->HasSeries()) {
|
if (v->hasSeries()) {
|
||||||
double *d = (double *)callData;
|
double *d = (double *)callData;
|
||||||
v->SetZoomScale(d[1]);
|
v->setZoomScale(d[1]);
|
||||||
}
|
}
|
||||||
},view, calldata,ImageViewManager::EStudyEBoundsSeries);
|
},view, calldata,ImageViewManager::EStudyEBoundsSeries);
|
||||||
}
|
}
|
||||||
@@ -117,9 +117,9 @@ void ViewContainerWidget::Slot_SyncEvent(DicomImageView *view, int interactionMo
|
|||||||
if (SyncHelper::getSyncItem(WIDTH_LEVEL))
|
if (SyncHelper::getSyncItem(WIDTH_LEVEL))
|
||||||
{
|
{
|
||||||
manager.smartDo([](auto v,auto callData){
|
manager.smartDo([](auto v,auto callData){
|
||||||
if (v->HasSeries()) {
|
if (v->hasSeries()) {
|
||||||
double *d = (double *)callData;
|
double *d = (double *)callData;
|
||||||
v->SetWindowLevel(d[1], d[0]);
|
v->setWindowLevel(d[1], d[0]);
|
||||||
}
|
}
|
||||||
},view, calldata,ImageViewManager::EStudyEBoundsSeries);
|
},view, calldata,ImageViewManager::EStudyEBoundsSeries);
|
||||||
}
|
}
|
||||||
@@ -287,7 +287,7 @@ void ViewContainerWidget::Slot_ViewEmpty(DicomImageView *view)
|
|||||||
{
|
{
|
||||||
if (view != nullptr)
|
if (view != nullptr)
|
||||||
{
|
{
|
||||||
view->ResetView();
|
view->resetView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -330,7 +330,7 @@ void ViewContainerWidget::replaceViewWithSerie(const std::string& uniqueid, Dico
|
|||||||
curV->removeViewWithFusion();
|
curV->removeViewWithFusion();
|
||||||
DicomLoader *helper = DicomLoader::GetInstance();
|
DicomLoader *helper = DicomLoader::GetInstance();
|
||||||
curV->setDicomImageView(helper->getSeriesImageSet(uniqueid));
|
curV->setDicomImageView(helper->getSeriesImageSet(uniqueid));
|
||||||
curV->Render();
|
curV->render();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewContainerWidget::toggleViewWithFusion()
|
void ViewContainerWidget::toggleViewWithFusion()
|
||||||
@@ -338,7 +338,7 @@ void ViewContainerWidget::toggleViewWithFusion()
|
|||||||
if (manager.getCurrentView())
|
if (manager.getCurrentView())
|
||||||
{
|
{
|
||||||
|
|
||||||
if (manager.getCurrentView()->HasSeries() && manager.getCurrentView()->IsFusion())
|
if (manager.getCurrentView()->hasSeries() && manager.getCurrentView()->isFusion())
|
||||||
{
|
{
|
||||||
removeCurrentViewWithFusion();
|
removeCurrentViewWithFusion();
|
||||||
}
|
}
|
||||||
@@ -358,10 +358,10 @@ void ViewContainerWidget::replaceViewWithFusion()
|
|||||||
if (checkFusionStatus(manager.getCurrentView(), overlap_view))
|
if (checkFusionStatus(manager.getCurrentView(), overlap_view))
|
||||||
{
|
{
|
||||||
connect(overlap_view, &DicomImageView::Signal_WindowLevelEventForFusion,
|
connect(overlap_view, &DicomImageView::Signal_WindowLevelEventForFusion,
|
||||||
manager.getCurrentView(), &DicomImageView::Slot_WindowLevelEventForFusion);
|
manager.getCurrentView(), &DicomImageView::fusionWindowChanged);
|
||||||
|
|
||||||
manager.getCurrentView()->SetFusionInput(overlap_view);
|
manager.getCurrentView()->setFusionInput(overlap_view);
|
||||||
manager.getCurrentView()->Render();
|
manager.getCurrentView()->render();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -380,7 +380,7 @@ bool ViewContainerWidget::checkFusionStatus(DicomImageView *base, DicomImageView
|
|||||||
SeriesImageSet* baseSeries = base->getSeriesInstance();
|
SeriesImageSet* baseSeries = base->getSeriesInstance();
|
||||||
SeriesImageSet* overlapSeries = overlap->getSeriesInstance();
|
SeriesImageSet* overlapSeries = overlap->getSeriesInstance();
|
||||||
// no data
|
// no data
|
||||||
if (!base->HasSeries() || !overlap->HasSeries()) return false;
|
if (!base->hasSeries() || !overlap->hasSeries()) return false;
|
||||||
// diff study
|
// diff study
|
||||||
if (baseSeries->getStudyUID() == nullptr ||
|
if (baseSeries->getStudyUID() == nullptr ||
|
||||||
strcmp(baseSeries->getStudyUID(), overlapSeries->getStudyUID())!=0) return false;
|
strcmp(baseSeries->getStudyUID(), overlapSeries->getStudyUID())!=0) return false;
|
||||||
@@ -391,7 +391,7 @@ bool ViewContainerWidget::checkFusionStatus(DicomImageView *base, DicomImageView
|
|||||||
|
|
||||||
void ViewContainerWidget::updateCornerInfoAll() {
|
void ViewContainerWidget::updateCornerInfoAll() {
|
||||||
manager.smartDo([](auto v, auto calldata) {
|
manager.smartDo([](auto v, auto calldata) {
|
||||||
if (v->HasSeries()){
|
if (v->hasSeries()){
|
||||||
v->updateCornerInfoAll();
|
v->updateCornerInfoAll();
|
||||||
}
|
}
|
||||||
}, nullptr, nullptr, ImageViewManager::All);
|
}, nullptr, nullptr, ImageViewManager::All);
|
||||||
@@ -399,7 +399,7 @@ void ViewContainerWidget::updateCornerInfoAll() {
|
|||||||
|
|
||||||
void ViewContainerWidget::updateCornerInfoPrivacy() {
|
void ViewContainerWidget::updateCornerInfoPrivacy() {
|
||||||
manager.smartDo([](auto v, auto calldata) {
|
manager.smartDo([](auto v, auto calldata) {
|
||||||
if (v->HasSeries()){
|
if (v->hasSeries()){
|
||||||
v->updateCornerInfoPrivacy();
|
v->updateCornerInfoPrivacy();
|
||||||
}
|
}
|
||||||
}, nullptr, nullptr, ImageViewManager::All);
|
}, nullptr, nullptr, ImageViewManager::All);
|
||||||
@@ -407,8 +407,8 @@ void ViewContainerWidget::updateCornerInfoPrivacy() {
|
|||||||
|
|
||||||
void ViewContainerWidget::render() {
|
void ViewContainerWidget::render() {
|
||||||
manager.smartDo([](auto v, auto calldata) {
|
manager.smartDo([](auto v, auto calldata) {
|
||||||
if (v->HasSeries()){
|
if (v->hasSeries()){
|
||||||
v->Render();
|
v->render();
|
||||||
}
|
}
|
||||||
}, nullptr, nullptr, ImageViewManager::All);
|
}, nullptr, nullptr, ImageViewManager::All);
|
||||||
}
|
}
|
||||||
@@ -416,18 +416,18 @@ void ViewContainerWidget::render() {
|
|||||||
void ViewContainerWidget::activeMeasure() {
|
void ViewContainerWidget::activeMeasure() {
|
||||||
|
|
||||||
manager.smartDo([](auto v, auto calldata) {
|
manager.smartDo([](auto v, auto calldata) {
|
||||||
if (v->HasSeries()){
|
if (v->hasSeries()){
|
||||||
Measure* measure = MeasureFactory::getMeasure((AnnotationActorType)MeasureHelper::getMeasureType());
|
Measure* measure = MeasureFactory::getMeasure((AnnotationActorType)MeasureHelper::getMeasureType());
|
||||||
v->ActiveMeasure(measure);
|
v->activeMeasure(measure);
|
||||||
}
|
}
|
||||||
}, nullptr, nullptr, ImageViewManager::All);
|
}, nullptr, nullptr, ImageViewManager::All);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ViewContainerWidget::SetCurrentViewSliceOrientation(int type) {
|
void ViewContainerWidget::SetCurrentViewSliceOrientation(int type) {
|
||||||
manager.getCurrentView()->SetSliceOrientation(type);
|
manager.getCurrentView()->getSliceOrientation(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ViewContainerWidget::GetCurrentViewSliceOrientation() {
|
int ViewContainerWidget::GetCurrentViewSliceOrientation() {
|
||||||
return manager.getCurrentView()->GetSliceOrientation();;
|
return manager.getCurrentView()->getSliceOrientation();;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -300,9 +300,9 @@ void QDicomViewer::SetupAnnoTool(QToolButton* annoBtn)
|
|||||||
|
|
||||||
m->addAction(tr("Show Dicom tags"), this, [&] {
|
m->addAction(tr("Show Dicom tags"), this, [&] {
|
||||||
DicomImageView* curV = ui->viewContainer->getCurrentView();
|
DicomImageView* curV = ui->viewContainer->getCurrentView();
|
||||||
if (curV->HasSeries())
|
if (curV->hasSeries())
|
||||||
{
|
{
|
||||||
curV->ShowMetaData();
|
curV->showMetaData();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -327,19 +327,19 @@ void QDicomViewer::executeActiveMeasure()
|
|||||||
case AnnotationActorType::DeleteSelectedAnn:
|
case AnnotationActorType::DeleteSelectedAnn:
|
||||||
if (curV != nullptr)
|
if (curV != nullptr)
|
||||||
{
|
{
|
||||||
curV->DeleteSelectedMeasure();
|
curV->deleteSelectedMeasure();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AnnotationActorType::DeleteSliceAnn:
|
case AnnotationActorType::DeleteSliceAnn:
|
||||||
if (curV != nullptr)
|
if (curV != nullptr)
|
||||||
{
|
{
|
||||||
curV->DeleteCurrentSliceMeasure();
|
curV->deleteCurrentSliceMeasure();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AnnotationActorType::DeleteSeriesAnn:
|
case AnnotationActorType::DeleteSeriesAnn:
|
||||||
if (curV != nullptr)
|
if (curV != nullptr)
|
||||||
{
|
{
|
||||||
curV->DeleteCurrentSeriesMeasure();
|
curV->deleteCurrentSeriesMeasure();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -422,7 +422,7 @@ void QDicomViewer::SetupMeasureTool(QToolButton* measureBtn)
|
|||||||
DicomImageView* curV = ui->viewContainer->getCurrentView();
|
DicomImageView* curV = ui->viewContainer->getCurrentView();
|
||||||
if (curV != nullptr)
|
if (curV != nullptr)
|
||||||
{
|
{
|
||||||
curV->DeleteSelectedMeasure();
|
curV->deleteSelectedMeasure();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
m->addAction(tr("Delete all in current slice"), this, [=] {
|
m->addAction(tr("Delete all in current slice"), this, [=] {
|
||||||
@@ -431,7 +431,7 @@ void QDicomViewer::SetupMeasureTool(QToolButton* measureBtn)
|
|||||||
DicomImageView* curV = ui->viewContainer->getCurrentView();
|
DicomImageView* curV = ui->viewContainer->getCurrentView();
|
||||||
if (curV != nullptr)
|
if (curV != nullptr)
|
||||||
{
|
{
|
||||||
curV->DeleteCurrentSliceMeasure();
|
curV->deleteCurrentSliceMeasure();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
m->addAction(tr("Delete all in current series"), this, [=] {
|
m->addAction(tr("Delete all in current series"), this, [=] {
|
||||||
@@ -441,7 +441,7 @@ void QDicomViewer::SetupMeasureTool(QToolButton* measureBtn)
|
|||||||
DicomImageView* curV = ui->viewContainer->getCurrentView();
|
DicomImageView* curV = ui->viewContainer->getCurrentView();
|
||||||
if (curV != nullptr)
|
if (curV != nullptr)
|
||||||
{
|
{
|
||||||
curV->DeleteCurrentSeriesMeasure();
|
curV->deleteCurrentSeriesMeasure();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -468,7 +468,7 @@ void QDicomViewer::SetupCineTool(QToolButton* cineBtn)
|
|||||||
cineBtn->setToolTip(QString("Cine"));
|
cineBtn->setToolTip(QString("Cine"));
|
||||||
connect(cineBtn, &QToolButton::clicked, this, [&] {
|
connect(cineBtn, &QToolButton::clicked, this, [&] {
|
||||||
DicomImageView* curV = ui->viewContainer->getCurrentView();
|
DicomImageView* curV = ui->viewContainer->getCurrentView();
|
||||||
if (curV->HasSeries())
|
if (curV->hasSeries())
|
||||||
{
|
{
|
||||||
if (curV->IsCine())
|
if (curV->IsCine())
|
||||||
{
|
{
|
||||||
@@ -563,9 +563,9 @@ void QDicomViewer::SetupAdjustTool(QToolButton* winlevelBtn)
|
|||||||
m->addAction(tr("Negative"), this, [=](bool value) {
|
m->addAction(tr("Negative"), this, [=](bool value) {
|
||||||
winlevelBtn->setChecked(true);
|
winlevelBtn->setChecked(true);
|
||||||
DicomImageView* curV = ui->viewContainer->getCurrentView();
|
DicomImageView* curV = ui->viewContainer->getCurrentView();
|
||||||
if (curV != nullptr && curV->HasSeries())
|
if (curV != nullptr && curV->hasSeries())
|
||||||
{
|
{
|
||||||
curV->ToggleNegativeMode();
|
curV->negativeWindow();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -591,47 +591,47 @@ void QDicomViewer::SetupFlipTool(QToolButton* flipBtn)
|
|||||||
m = new QMenu(this);
|
m = new QMenu(this);
|
||||||
m->addAction(tr("Rotate 90 CCW"), this, [&] {
|
m->addAction(tr("Rotate 90 CCW"), this, [&] {
|
||||||
DicomImageView* curV = ui->viewContainer->getCurrentView();
|
DicomImageView* curV = ui->viewContainer->getCurrentView();
|
||||||
if (curV != nullptr && curV->HasSeries())
|
if (curV != nullptr && curV->hasSeries())
|
||||||
{
|
{
|
||||||
curV->Rotate(90, ROTATE_90_CCW);
|
curV->rotateImage(90, ROTATE_90_CCW);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
m->addAction(tr("Rotate 90 CW"), this, [&] {
|
m->addAction(tr("Rotate 90 CW"), this, [&] {
|
||||||
DicomImageView* curV = ui->viewContainer->getCurrentView();
|
DicomImageView* curV = ui->viewContainer->getCurrentView();
|
||||||
if (curV != nullptr && curV->HasSeries())
|
if (curV != nullptr && curV->hasSeries())
|
||||||
{
|
{
|
||||||
curV->Rotate(-90, ROTATE_90_CW);
|
curV->rotateImage(-90, ROTATE_90_CW);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
m->addAction(tr("Rotate 180"), this, [&] {
|
m->addAction(tr("Rotate 180"), this, [&] {
|
||||||
DicomImageView* curV = ui->viewContainer->getCurrentView();
|
DicomImageView* curV = ui->viewContainer->getCurrentView();
|
||||||
if (curV != nullptr && curV->HasSeries())
|
if (curV != nullptr && curV->hasSeries())
|
||||||
{
|
{
|
||||||
curV->Rotate(180, ROTATE_180);
|
curV->rotateImage(180, ROTATE_180);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
m->addSeparator();
|
m->addSeparator();
|
||||||
m->addAction(tr("Flip horizontal"), this, [&] {
|
m->addAction(tr("Flip horizontal"), this, [&] {
|
||||||
DicomImageView* curV = ui->viewContainer->getCurrentView();
|
DicomImageView* curV = ui->viewContainer->getCurrentView();
|
||||||
if (curV != nullptr && curV->HasSeries())
|
if (curV != nullptr && curV->hasSeries())
|
||||||
{
|
{
|
||||||
curV->HFlip();
|
curV->hFlipImage();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
m->addAction(tr("Flip vertical"), this, [&] {
|
m->addAction(tr("Flip vertical"), this, [&] {
|
||||||
DicomImageView* curV = ui->viewContainer->getCurrentView();
|
DicomImageView* curV = ui->viewContainer->getCurrentView();
|
||||||
if (curV != nullptr && curV->HasSeries())
|
if (curV != nullptr && curV->hasSeries())
|
||||||
{
|
{
|
||||||
curV->VFlip();
|
curV->vFlipImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
m->addSeparator();
|
m->addSeparator();
|
||||||
m->addAction(tr("Clear transformations"), this, [&] {
|
m->addAction(tr("Clear transformations"), this, [&] {
|
||||||
DicomImageView* curV = ui->viewContainer->getCurrentView();
|
DicomImageView* curV = ui->viewContainer->getCurrentView();
|
||||||
if (curV != nullptr && curV->HasSeries())
|
if (curV != nullptr && curV->hasSeries())
|
||||||
{
|
{
|
||||||
curV->ClearTransformations();
|
curV->ClearTransformations();
|
||||||
}
|
}
|
||||||
@@ -641,9 +641,9 @@ void QDicomViewer::SetupFlipTool(QToolButton* flipBtn)
|
|||||||
|
|
||||||
connect(flipBtn, &QPushButton::clicked, this, [&] {
|
connect(flipBtn, &QPushButton::clicked, this, [&] {
|
||||||
DicomImageView* curV = ui->viewContainer->getCurrentView();
|
DicomImageView* curV = ui->viewContainer->getCurrentView();
|
||||||
if (curV != nullptr && curV->HasSeries())
|
if (curV != nullptr && curV->hasSeries())
|
||||||
{
|
{
|
||||||
curV->Rotate(90, ROTATE_90_CCW);
|
curV->rotateImage(90, ROTATE_90_CCW);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ void Customwindow::setCurrentView(DicomImageView *cur)
|
|||||||
}
|
}
|
||||||
double width = 0;
|
double width = 0;
|
||||||
double level = 0;
|
double level = 0;
|
||||||
m_curV->GetWindowLevel(level, width);
|
m_curV->getWindowLevel(level, width);
|
||||||
ui.led_WL->setText(QString("%1").arg(level));
|
ui.led_WL->setText(QString("%1").arg(level));
|
||||||
ui.led_WW->setText(QString("%1").arg(width));
|
ui.led_WW->setText(QString("%1").arg(width));
|
||||||
}
|
}
|
||||||
@@ -38,6 +38,6 @@ void Customwindow::setCurrentView(DicomImageView *cur)
|
|||||||
|
|
||||||
void Customwindow::onBtnOKClicked()
|
void Customwindow::onBtnOKClicked()
|
||||||
{
|
{
|
||||||
m_curV->SetWindowLevel(ui.led_WL->text().toDouble(), ui.led_WW->text().toDouble());
|
m_curV->setWindowLevel(ui.led_WL->text().toDouble(), ui.led_WW->text().toDouble());
|
||||||
this->close();
|
this->close();
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user