UI improve.

This commit is contained in:
Krad
2022-10-28 16:05:57 +08:00
parent 01736047f7
commit 6e80d953c4
4 changed files with 13 additions and 11 deletions

View File

@@ -74,7 +74,6 @@ DICOMImageViewer::DICOMImageViewer()
vtkNew<vtkTextProperty> prop;
prop->SetFontFamilyToArial();
// prop->ShadowOn();
this->cornerAnnotation->SetTextProperty(prop);
this->cornerAnnotation->GetTextProperty()->SetColor(0.0, 1, 1);
// Annotate the image with window/level and mouse over pixel information

View File

@@ -18,10 +18,10 @@
#include <vtkPiecewiseFunction.h>
#include <vtkColorTransferFunction.h>
#include <vtkCornerAnnotation.h>
#include <vtkTextProperty.h>
#include <vtkPlane.h>
#include <vtkBoundingBox.h>
#include <vtkAnnotatedCubeActor.h>
#include <vtkVectorText.h>
#include "Interaction/VolumeInteractorStyle.h"
#include "Rendering/Widget/ClickableOrientationMarkerWidget.h"
@@ -126,6 +126,15 @@ VolumeRenderingViewer::VolumeRenderingViewer()
volumeProperty->SetSpecularPower(10.0);
VolumeActor->SetProperty(volumeProperty);
VolumeActor->SetMapper(VolumeMapper);
vtkNew<vtkTextProperty> prop;
prop->SetFontFamilyToArial();
this->annotation->SetTextProperty(prop);
this->annotation->GetTextProperty()->SetColor(.0,1.,1.);
// Annotate the image with window/level and mouse over pixel information
this->annotation->SetLinearFontScaleFactor(2);
this->annotation->SetNonlinearFontScaleFactor(1);
this->annotation->SetMaximumFontSize(20);
this->annotation->SetMinimumFontSize(8);
}
VolumeRenderingViewer::~VolumeRenderingViewer() {
@@ -459,14 +468,9 @@ void VolumeRenderingViewer::SetCoordsTransformMatrix(ExtendMedicalImagePropertie
cube->GetXMinusFaceProperty()->SetColor(.882,.3,0.2);
cube->GetXPlusFaceProperty()->SetColor(.882,.3,0.2);
cube->GetTextEdgesProperty()->SetEdgeVisibility(0);
// cube->GetTextEdgesProperty()->SetEdgeColor(0.149,0.737,.835);
// cube->GetTextEdgesProperty()->SetColor(1.0,1.0,.0);
// cube->GetTextEdgesProperty()->SetLineWidth(2.0);
// cube->GetCubeProperty()->SetEdgeColor(1.0,1.0,.0);
// cube->GetCubeProperty()->SetEdgeVisibility(1);
cube->GetCubeProperty()->SetColor(0.11,0.471,.539);
// cube->GetCubeProperty()->SetColor(0.11,0.471,.539);
cube->GetCubeProperty()->SetColor(0.05,0.55,0.5);
cube->SetPickable(true);
vtkVectorText* text = vtkVectorText::New();
OrientationMarker->SetOrientationMarker(cube);
cube->AddObserver(vtkCommand::PickEvent,this,&VolumeRenderingViewer::pressedOrientationMarker);
}

View File

@@ -48,7 +48,6 @@ void ClickableOrientationMarkerWidget::OnLeftButtonDown() {
this->StartPosition[1] = Y;
this->State = this->ComputeStateBasedOnPosition( X, Y, pos1, pos2 );
// this->SetCursor( this->State );
if (this->State == vtkOrientationMarkerWidget::Outside)
{
@@ -92,7 +91,6 @@ void ClickableOrientationMarkerWidget::OnLeftButtonDown() {
}
}
PressedFaceIndex = faceIndex;
vtkErrorMacro("face index:" <<faceIndex);
obj->InvokeEvent(vtkCommand::PickEvent,&PressedFaceIndex);
}
}

View File

@@ -70,6 +70,7 @@ VolumeRenderingToolBar::VolumeRenderingToolBar(QWidget *parent) : QToolBar(paren
group->addButton(btnRotate,1);
group->addButton(btnZoom,2);
group->addButton(btnPan,3);
group->addButton(btnWindow,1024);
group->setExclusive(true);
connect(group, static_cast<void(QButtonGroup::*)(int)>(&QButtonGroup::buttonClicked),this,&VolumeRenderingToolBar::modeButtonClicked);