Skip to content

Commit

Permalink
Improve graph window (#335)
Browse files Browse the repository at this point in the history
- Adds pandas
- Creates classes to generate the tabs in the graphs window. In particular, the following tabs are created: SingleRunResultsWidget, BulkRunResultsWidget, StatisticsResultsWidget.
- Edits the results reader to be a numpy reader.
- Edits help text for the graphs.
- Adds docscrings to GraphsWindow.
- Improve way labels look, text style in the plots in the graphs window.
- Adds option in settings to edit the app fontsize to be user defined. Default is 12
  • Loading branch information
DanicaSTFC authored Oct 9, 2024
1 parent 1a82e3f commit 5b3668c
Show file tree
Hide file tree
Showing 11 changed files with 924 additions and 311 deletions.
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
# ChangeLog

## v24.1.0
Enhancements:
* Improve graphs window #335
* Option to edit the app fontsize in settings #335

Bug fixes:
* use eqt FormDialog in settings #318

Dependencies:
* Add pandas #335

## v24.0.1
Bug fixes:
* Use RawInputDialog from the viewer package #314
Expand Down
4 changes: 2 additions & 2 deletions docs/source/results.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ Graphs of the Results
=====================
Then click on **Display Graphs**.
Another window will open (once you are done looking at the graphs you can either close or minimize this window and it will take you back to the main app just fine).
It will start you off on the **Summary** tab.
It will start you off on the **Bulk** tab.
This isn’t so useful if you only performed one run. For each run that you performed, there will be a separate tab.
If you navigate to one of these it will show you graphs for the objective minimum, and displacements in x, y, z as well as changes in φ, θ, ψ for that run.
The title of the tab also gives the number of sampling points in the subvolume and the subvolume size.

This will automatically show the displacements including the translation that you set in the manual registration.
You can adjust the displacements to exclude this translation by going to Settings and selecting **Show displacement relative to reference point 0**.
Now, coming back to the summary tab, this shows the settings for the runs including the subvolume geometry, maximum displacement etc.,
Now, coming back to the bulk tab, this shows the settings for the runs including the subvolume geometry, maximum displacement etc.,
and if you have done a bulk run then you can select a particular variable (such as the objective minimum) and then compare the graphs for this variable in each of the runs.
You can select to just compare for a certain subvolume size or number of sampling points, or you can choose to compare them all (which is what is chosen in the image below).

Expand Down
1 change: 1 addition & 0 deletions recipe/dev_environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ dependencies:
- openpyxl
- python
- numpy
- pandas
- scipy
- ccpi::ccpi-viewer >=24.0.1
- ccpi::ccpi-dvc >=22.0.0
Expand Down
1 change: 1 addition & 0 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ requirements:
- openpyxl
- python
- numpy
- pandas
- scipy
- ccpi-viewer >=24.0.1
- ccpi-dvc >=22.0.0
Expand Down
25 changes: 16 additions & 9 deletions src/idvc/dvc_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,13 +487,21 @@ def CreateHelpPanel(self):
"4. Limit the range of the vectors viewed by changing the 'Vector Range Min' and Vector Range Max'. Then, click 'View Pointcloud/Vectors' to apply the changes.\n"
"5. On the 2D viewer, the vectors are shown as 2D arrows, showing the displacements in the current plane. If the 'x', 'y' or 'z' keys are pressed click 'View Pointcloud/Vectors' to apply the changes.\n\n"
"Display Graphs:\n"
"Graphs are displayed in a new window (once you are done looking at the graphs you can either close or minimize this window). A tab is created for each run, showing a summary of the parameters.\n"
"1. Select an option from the list for the variable to compare.\n"
"2. Select the parameters to compare from the list.\n"
"3. Click on 'Plot Histograms'.\n"
"Note: This will automatically show the displacements including the translation that you set in the manual registration.\n"
"4. Optionally, go to 'Settings' and select 'Show displacement relative to reference point 0' to adjust the displacements to exclude the initial registration translation.\n"
"5. In the case of a bulk run, a particular variable can be selected and the graphs for this variable in each of the runs can be compared.\n\n"
"Graphs are displayed in a new window (once you are done looking at the graphs you can either close or minimize this window).\n"
"A tab is created to visualise a single run. Information on the run is displayed on the left.\n"
"1. Select an option for the result to plot.\n"
"2. Select the parameter to fix and its value.\n"
"3. Click on 'Plot'.\n"
"In the case of a bulk run, an additional tab enables comparison of the results. Information on the bulk run is displayed on the left.\n"
"1. Select an option for the result to plot.\n"
"2. Select the parameter to fix and its value. Alternatively, select 'None' to plot all values.\n"
"3. Click on 'Plot histograms'.\n"
"An additional tab includes quantatitative statistical analysis of the bulk run.\n"
"1. Select an option for the result to plot. Alternatively, select 'All'.\n"
"2. Select the parameter to fix and its value. Alternatively, select 'All' to plot all values. Optionally, collapse the plots.\n"
"3. Click on 'Plot'.\n"
"Note: As a default, the displacements include the translation set in the manual registration.\n"
"4. Optionally, go to 'Settings' and select 'Show displacement relative to reference point 0' to adjust the displacements to exclude the initial registration translation.\n\n"
"Results Files:\n"
"Select a folder and export a session to access the result files. Two tab-delimited text files are generated for each run at location <session_folder>\Results\<run_name>\dvc_result_*.\n"
"1. The status file (dvc_result_*.stat) contains an echo of the input file used for the analysis, information about the point cloud, dvc program version, run date/time, search statistics and timing.\n"
Expand Down Expand Up @@ -4959,8 +4967,7 @@ def show_run_pcs(self):
points_list = []
subvol_list = []
for folder in glob.glob(os.path.join(directory, "dvc_result_*")):
file_path = os.path.join(folder, os.path.basename(folder))
result = RunResults(file_path)
result = RunResults(folder)
self.result_list.append(result)
el = str(result.subvol_points)
if el not in points_list:
Expand Down
7 changes: 5 additions & 2 deletions src/idvc/idvc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import PySide2
from PySide2 import QtWidgets, QtGui
import os, sys
import logging
Expand All @@ -16,8 +15,12 @@ def main():
level = eval(f'logging.{args.debug.upper()}')
logging.basicConfig(level=level)
logging.info(f"iDVC: Setting debugging level to {args.debug.upper()}")

app = QtWidgets.QApplication([])
# Set a global font for the application
default_font_family = app.font().family()
font = QtGui.QFont(default_font_family, 12) # Replace with your preferred font and size
QtWidgets.QApplication.setFont(font)


file_dir = os.path.dirname(__file__)
owl_file = os.path.join(file_dir, "DVCIconSquare.png")
Expand Down
11 changes: 10 additions & 1 deletion src/idvc/ui/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@ def __init__(self, parent, title="Settings"):
self.parent = parent



self.fontsize_label = QLabel("Fontsize: ")
self.fontsize_widget = QSpinBox()
self.fontsize_widget.setMaximum(25)
self.fontsize_widget.setMinimum(5)
self.fontsize_widget.setSingleStep(1)
self.fontsize_widget.setValue(12)
self.addWidget(self.fontsize_widget, self.fontsize_label, 'fontsize')
self.dark_checkbox = QCheckBox("Dark Mode")
# populate from settings
if self.parent.settings.value("dark_mode") is not None:
Expand Down Expand Up @@ -105,6 +111,9 @@ def __init__(self, parent, title="Settings"):


def onOk(self):
default_font_family = PySide2.QtWidgets.QApplication.font().family()
font = PySide2.QtGui.QFont(default_font_family, self.fontsize_widget.value())
PySide2.QtWidgets.QApplication.setFont(font)
#self.parent.settings.setValue("settings_chosen", 1)
if self.dark_checkbox.isChecked():
self.parent.settings.setValue("dark_mode", True)
Expand Down
Loading

0 comments on commit 5b3668c

Please sign in to comment.