Simple MPR and slice orientation features
This commit is contained in:
@@ -216,6 +216,10 @@ void QDicomViewer::createToolButton()
|
||||
this->SetupMaximizeTool(btnmaximize);
|
||||
this->SetupMinimizeTool(btnminimize);
|
||||
this->SetupCloseTool(btnclose);
|
||||
|
||||
connect(btnMPR,&QToolButton::clicked,[=](){
|
||||
ui->viewContainer->SetCurrentViewSliceOrientation((ui->viewContainer->GetCurrentViewSliceOrientation()+1)%3);
|
||||
});
|
||||
}
|
||||
|
||||
void QDicomViewer::SetupFullScreenTool(QToolButton* btnfullscreen)
|
||||
|
||||
@@ -45,6 +45,7 @@ void infinitiViewer::SetFusionInputData(vtkImageData* data)
|
||||
if (!this->FusionMapper) {
|
||||
this->FusionMapper = vtkImageSliceMapper::New();
|
||||
this->FusionMapper->SliceAtFocalPointOn();
|
||||
this->FusionMapper->SliceFacesCameraOn();
|
||||
FusionMapper->SetInputData(data);
|
||||
this->FusionActor = vtkImageSlice::New();
|
||||
FusionActor->SetPickable(false);
|
||||
@@ -304,6 +305,8 @@ infinitiViewer::infinitiViewer()
|
||||
this->ImageActor = vtkImageSlice::New();
|
||||
this->ImageMapper = vtkImageSliceMapper::New();
|
||||
this->ImageMapper->SliceAtFocalPointOn();
|
||||
this->ImageMapper->SliceFacesCameraOn();
|
||||
|
||||
this->ImageActor->SetMapper(this->ImageMapper);
|
||||
this->FusionActor = nullptr;
|
||||
this->FusionMapper = nullptr;
|
||||
@@ -657,8 +660,10 @@ void infinitiViewer::SetSliceOrientation(int orientation)
|
||||
this->Renderer->ResetCamera();
|
||||
this->Renderer->GetActiveCamera()->SetParallelScale(scale);
|
||||
}
|
||||
|
||||
this->Render();
|
||||
// first render to update imageMapper slice
|
||||
this->Render();
|
||||
//use SetSlice as second render the first image
|
||||
SetSlice(0);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -679,7 +684,7 @@ void infinitiViewer::UpdateOrientation()
|
||||
|
||||
case infinitiViewer::SLICE_ORIENTATION_XZ:
|
||||
cam->SetFocalPoint(0, 0, 0);
|
||||
cam->SetPosition(0, -1, 0); // 1 if medical ?
|
||||
cam->SetPosition(0, 1, 0); // 1 if medical ?
|
||||
cam->SetViewUp(0, 0, 1);
|
||||
break;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "view/dicomimageview.h"
|
||||
#include "view/dicomimageview.h"
|
||||
#include <QMessageBox>
|
||||
#include <QDebug>
|
||||
#include <QMimeData>
|
||||
@@ -562,8 +562,10 @@ void DicomImageView::SetPanOffset(double * pan)
|
||||
}
|
||||
}
|
||||
|
||||
//FIXME:这个函数有问题,会导致MPR显示出错!!!
|
||||
void DicomImageView::ResetPanZoom()
|
||||
{
|
||||
return;
|
||||
if (HasSeries())
|
||||
{
|
||||
//necessary to reset pan
|
||||
@@ -667,7 +669,7 @@ void DicomImageView::Rotate(double angle, TransFormType operation)
|
||||
//slcing is related with rotation, you have to recalculate to get it right
|
||||
_ImageViewer->GetRenderer()->ResetCameraClippingRange();
|
||||
_ImageViewer->SetSlice(slice);
|
||||
_ImageViewer->GetRenderWindow()->Render();
|
||||
// _ImageViewer->GetRenderWindow()->Render();
|
||||
emit Signal_Transformation(operation);
|
||||
}
|
||||
|
||||
@@ -827,4 +829,19 @@ void DicomImageView::removeViewWithMeasure()
|
||||
{
|
||||
_ImageViewer->UnActiveMeasure();
|
||||
_ImageViewer->DeleteCurrentSeriesMeasure();
|
||||
}
|
||||
}
|
||||
|
||||
void DicomImageView::SetSliceOrientation(int orientation) {
|
||||
slice_orientation = orientation;
|
||||
_ImageViewer->SetSliceOrientation(orientation);
|
||||
int max = 0;
|
||||
int min = 0;
|
||||
_ImageViewer->GetSliceRange(min, max);
|
||||
_scrollBar->setValue(min);
|
||||
_scrollBar->setMaximum(max);
|
||||
_scrollBar->setValue(0);
|
||||
}
|
||||
|
||||
int DicomImageView::GetSliceOrientation() {
|
||||
return slice_orientation;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include <QFrame>
|
||||
#include <QOpenGLWidget>
|
||||
#include "ClickableScrollBar.h"
|
||||
@@ -124,6 +124,8 @@ public:
|
||||
//Negative
|
||||
void ToggleNegativeMode();
|
||||
|
||||
void SetSliceOrientation(int orientation);
|
||||
int GetSliceOrientation();
|
||||
|
||||
signals:
|
||||
/**
|
||||
@@ -227,6 +229,7 @@ private:
|
||||
int _SliceStep =0;
|
||||
int _PrevSlice =0;
|
||||
int _ScrollTriggerType = scrollScope::TriggerType::USER_TRIGGER;
|
||||
int slice_orientation = 2;
|
||||
|
||||
bool isCine = false;
|
||||
bool isNegative = false;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "viewcontainerwidget.h"
|
||||
#include "viewcontainerwidget.h"
|
||||
#include "thumbnailImage.h"
|
||||
#include "DicomLoader.h"
|
||||
#include <QWidget>
|
||||
@@ -434,3 +434,11 @@ void ViewContainerWidget::activeMeasure() {
|
||||
}, nullptr, nullptr, ImageViewManager::All);
|
||||
}
|
||||
|
||||
void ViewContainerWidget::SetCurrentViewSliceOrientation(int type) {
|
||||
manager.getCurrentView()->SetSliceOrientation(type);
|
||||
}
|
||||
|
||||
int ViewContainerWidget::GetCurrentViewSliceOrientation() {
|
||||
return manager.getCurrentView()->GetSliceOrientation();;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,6 +43,9 @@ public:
|
||||
void removeCurrentViewWithFusion();
|
||||
void SetInteractionMode(int InteractionMode);
|
||||
|
||||
void SetCurrentViewSliceOrientation(int orientation);
|
||||
int GetCurrentViewSliceOrientation();
|
||||
|
||||
signals:
|
||||
void Signal_NotifyThumbnail(DicomImageView *view);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user