toolbar volume rotation

This commit is contained in:
quantulr
2024-04-23 17:19:53 +08:00
parent 03a3d29bfe
commit 49b3d45493
6 changed files with 263 additions and 42 deletions

View File

@ -1,8 +1,244 @@
ERROR: In vtkDemandDrivenPipeline.cxx, line 677 ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (00000233450F5040): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (0000023343594B20) has 0 connections but is not optional. vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677 ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (00000233450F5040): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (0000023343594B20) has 0 connections but is not optional. vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.
ERROR: In vtkDemandDrivenPipeline.cxx, line 677
vtkCompositeDataPipeline (000002067CD9E5B0): Input port 0 of algorithm vtkOpenGLGPUVolumeRayCastMapper (000002067B2660B0) has 0 connections but is not optional.

BIN
crystalfly/assets/file.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 B

BIN
crystalfly/assets/plus.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

View File

@ -1,6 +1,7 @@
from pathlib import Path from pathlib import Path
from PySide6.QtCore import Slot, Qt from PySide6.QtCore import Slot, Qt
from PySide6.QtGui import QIcon, QAction
from PySide6.QtUiTools import loadUiType from PySide6.QtUiTools import loadUiType
from PySide6.QtWidgets import QMainWindow, QSlider from PySide6.QtWidgets import QMainWindow, QSlider
from vtkmodules.vtkRenderingOpenGL2 import vtkGenericOpenGLRenderWindow from vtkmodules.vtkRenderingOpenGL2 import vtkGenericOpenGLRenderWindow
@ -15,6 +16,8 @@ MainWindowType, _ = loadUiType(str(Path(__file__).parent.joinpath("main_window.u
class MainWindow(QMainWindow, MainWindowType): class MainWindow(QMainWindow, MainWindowType):
def __init__(self): def __init__(self):
super(MainWindow, self).__init__() super(MainWindow, self).__init__()
self.cross_action = None
self.file_action = None
self.volume = None self.volume = None
self.transverse = None self.transverse = None
self.sagittal = None self.sagittal = None
@ -24,8 +27,18 @@ class MainWindow(QMainWindow, MainWindowType):
self.file_open_dialog = ImportFile() self.file_open_dialog = ImportFile()
self.file_open.triggered.connect(self.handle_file_open) self.file_open.triggered.connect(self.handle_file_open)
self.init_four_pane() self.init_four_pane()
self.init_tool_bar()
self.is_pane_maximum = False self.is_pane_maximum = False
def init_tool_bar(self):
self.file_action = QAction(icon=QIcon(str(Path(__file__).parent.parent / "assets" / "file.png")), text="file",
parent=self)
self.cross_action = QAction(icon=QIcon(str(Path(__file__).parent.parent / "assets" / "plus.png")), text="cross",
parent=self)
self.file_action.triggered.connect(self.handle_file_open)
self.tool_bar.addAction(self.file_action)
self.tool_bar.addAction(self.cross_action)
def init_four_pane(self): def init_four_pane(self):
self.coronal = VTKImageViewer(1) self.coronal = VTKImageViewer(1)
self.sagittal = VTKImageViewer(3) self.sagittal = VTKImageViewer(3)

View File

@ -17,23 +17,7 @@
<string notr="true"># background-color: rgb(50, 50, 50);</string> <string notr="true"># background-color: rgb(50, 50, 50);</string>
</property> </property>
<widget class="QWidget" name="centralwidget"> <widget class="QWidget" name="centralwidget">
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,4"> <layout class="QHBoxLayout" name="horizontalLayout" stretch="16">
<item>
<widget class="QWidget" name="widget" native="true">
<property name="styleSheet">
<string notr="true">border-color: rgb(195, 195, 195);</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>工具栏</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item> <item>
<layout class="QGridLayout" name="four_pane_grid" rowstretch="0,0" columnstretch="0,0,0"> <layout class="QGridLayout" name="four_pane_grid" rowstretch="0,0" columnstretch="0,0,0">
<property name="spacing"> <property name="spacing">
@ -131,30 +115,18 @@ margin-top: -1px;</string>
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>21</height>
</rect>
</property>
<widget class="QMenu" name="menu">
<property name="title">
<string>文件</string>
</property>
<addaction name="file_open"/>
</widget>
<widget class="QMenu" name="menu_2">
<property name="title">
<string>工具</string>
</property>
</widget>
<addaction name="menu"/>
<addaction name="menu_2"/>
</widget>
<widget class="QStatusBar" name="statusbar"/> <widget class="QStatusBar" name="statusbar"/>
<widget class="QToolBar" name="tool_bar">
<property name="windowTitle">
<string>toolBar_2</string>
</property>
<attribute name="toolBarArea">
<enum>LeftToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
<action name="file_open"> <action name="file_open">
<property name="text"> <property name="text">
<string>打开</string> <string>打开</string>