From 6e80d953c42d11c633061059278e3ab5301d209f Mon Sep 17 00:00:00 2001 From: Krad Date: Fri, 28 Oct 2022 16:05:57 +0800 Subject: [PATCH] UI improve. --- src/src/Rendering/Viewer/DICOMImageViewer.cxx | 1 - .../Viewer/VolumeRenderingViewer.cpp | 20 +++++++++++-------- .../ClickableOrientationMarkerWidget.cpp | 2 -- .../Widget/ToolBar/VolumeRenderingToolBar.cpp | 1 + 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/src/Rendering/Viewer/DICOMImageViewer.cxx b/src/src/Rendering/Viewer/DICOMImageViewer.cxx index d7c3143..d9a20bf 100644 --- a/src/src/Rendering/Viewer/DICOMImageViewer.cxx +++ b/src/src/Rendering/Viewer/DICOMImageViewer.cxx @@ -74,7 +74,6 @@ DICOMImageViewer::DICOMImageViewer() vtkNew 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 diff --git a/src/src/Rendering/Viewer/VolumeRenderingViewer.cpp b/src/src/Rendering/Viewer/VolumeRenderingViewer.cpp index 408a6e9..fa62ed6 100644 --- a/src/src/Rendering/Viewer/VolumeRenderingViewer.cpp +++ b/src/src/Rendering/Viewer/VolumeRenderingViewer.cpp @@ -18,10 +18,10 @@ #include #include #include +#include #include #include #include -#include #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 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); } diff --git a/src/src/Rendering/Widget/ClickableOrientationMarkerWidget.cpp b/src/src/Rendering/Widget/ClickableOrientationMarkerWidget.cpp index 36b0900..86270bc 100644 --- a/src/src/Rendering/Widget/ClickableOrientationMarkerWidget.cpp +++ b/src/src/Rendering/Widget/ClickableOrientationMarkerWidget.cpp @@ -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:" <InvokeEvent(vtkCommand::PickEvent,&PressedFaceIndex); } } diff --git a/src/src/UI/Widget/ToolBar/VolumeRenderingToolBar.cpp b/src/src/UI/Widget/ToolBar/VolumeRenderingToolBar.cpp index 7c94b00..1b98a7e 100644 --- a/src/src/UI/Widget/ToolBar/VolumeRenderingToolBar.cpp +++ b/src/src/UI/Widget/ToolBar/VolumeRenderingToolBar.cpp @@ -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(&QButtonGroup::buttonClicked),this,&VolumeRenderingToolBar::modeButtonClicked);