Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PyNutil
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Harry Carey
PyNutil
Commits
a82b52a8
Commit
a82b52a8
authored
2 months ago
by
polarbean
Browse files
Options
Downloads
Patches
Plain Diff
add damage marker checkbox to pnt gui
parent
37bdee41
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gui/PyNutilGUI.py
+22
-1
22 additions, 1 deletion
gui/PyNutilGUI.py
gui/ui_components.py
+2
-3
2 additions, 3 deletions
gui/ui_components.py
with
24 additions
and
4 deletions
gui/PyNutilGUI.py
+
22
−
1
View file @
a82b52a8
...
...
@@ -29,6 +29,7 @@ from PyQt6.QtWidgets import (
QGridLayout
,
QGroupBox
,
QProgressDialog
,
QCheckBox
,
)
from
PyQt6.QtGui
import
QAction
,
QColor
,
QIcon
,
QDesktopServices
from
PyQt6.QtCore
import
(
...
...
@@ -200,7 +201,7 @@ class AnalysisWorker(QThread):
print
(
"
Analysis cancelled
"
)
return
pnt
.
get_coordinates
(
object_cutoff
=
0
)
pnt
.
get_coordinates
(
object_cutoff
=
0
,
apply_damage_mask
=
self
.
arguments
[
"
apply_damage_mask
"
]
)
# Check if cancelled before continuing
if
self
.
cancelled
:
...
...
@@ -299,6 +300,7 @@ class PyNutilGUI(QMainWindow):
"
label_path
"
:
None
,
# Added for custom atlases
"
atlas_path
"
:
None
,
# Added for custom atlases
"
custom_region_path
"
:
None
,
# Added for custom region file (optional)
"
apply_damage_mask
"
:
False
,
# <-- ADDED default field
}
self
.
recent_files_path
=
os
.
path
.
join
(
os
.
path
.
expanduser
(
"
~
"
),
"
.pynutil_recent_files.json
"
...
...
@@ -470,6 +472,16 @@ class PyNutilGUI(QMainWindow):
)
left_layout
.
addLayout
(
output_layout
)
damage_markers_layout
=
QHBoxLayout
()
damage_markers_label
=
QLabel
(
"
Include Damage Quantification:
"
)
self
.
include_damage_markers_checkbox
=
QCheckBox
()
self
.
include_damage_markers_checkbox
.
setChecked
(
False
)
self
.
include_damage_markers_checkbox
.
stateChanged
.
connect
(
self
.
update_damage_markers_flag
)
damage_markers_layout
.
addWidget
(
damage_markers_label
)
damage_markers_layout
.
addWidget
(
self
.
include_damage_markers_checkbox
)
left_layout
.
addLayout
(
damage_markers_layout
)
# Run and cancel buttons
left_layout
.
addWidget
(
QLabel
(
"
Start analysis:
"
))
run_buttons_layout
,
self
.
run_button
,
self
.
cancel_button
=
(
...
...
@@ -520,6 +532,7 @@ For more information about the QUINT workflow: <a href="https://quint-workflow.r
def
set_registration_json
(
self
,
index
):
if
index
>=
0
:
# Retrieve the full path from userData
value
=
(
self
.
registration_json_dropdown
.
itemData
(
index
)
or
self
.
registration_json_dropdown
.
currentText
()
...
...
@@ -778,6 +791,11 @@ For more information about the QUINT workflow: <a href="https://quint-workflow.r
if
index
>=
0
:
self
.
atlas_combo
.
setCurrentIndex
(
index
)
if
"
include_damage_markers
"
in
settings
:
dmg_markers
=
bool
(
settings
[
"
include_damage_markers
"
])
self
.
arguments
[
"
apply_damage_mask
"
]
=
dmg_markers
self
.
include_damage_markers_checkbox
.
setChecked
(
dmg_markers
)
self
.
output_box
.
setHtml
(
f
"
Settings loaded from:
{
file_path
}
"
)
except
Exception
as
e
:
...
...
@@ -1063,6 +1081,9 @@ For more information about the QUINT workflow: <a href="https://quint-workflow.r
self
.
populate_atlas_dropdown
()
self
.
append_text_to_output
(
f
"
Custom atlas
'
{
atlas_name
}
'
added successfully.
"
)
def
update_damage_markers_flag
(
self
,
state
):
self
.
arguments
[
"
apply_damage_mask
"
]
=
bool
(
state
)
if
__name__
==
"
__main__
"
:
app
=
QApplication
(
sys
.
argv
)
...
...
This diff is collapsed.
Click to expand it.
gui/ui_components.py
+
2
−
3
View file @
a82b52a8
...
...
@@ -232,9 +232,8 @@ def populate_dropdown(dropdown, recents, clear_first=True):
else
:
# Handle string items
display_text
=
get_path_display_name
(
item
)
dropdown
.
addItem
(
display_text
)
# Store the full path as user data in the item
# dropdown.setItemData(dropdown.count() - 1, item)
# Store the full path as user data
dropdown
.
addItem
(
display_text
,
userData
=
item
)
dropdown
.
setEditable
(
False
)
# dropdown.setCurrentIndex(-1)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment