Skip to content

Commit 274c40d

Browse files
committed
Image average profile extraction: AttributeError when trying to edit profile parameters
Fix #87
1 parent 1e12f66 commit 274c40d

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ See DataLab [roadmap page](https://datalab-platform.com/en/contributing/roadmap.
1414
* Adding the test data paths multiple times to `cdl.utils.tests.TST_PATH` was causing the test data to be loaded multiple times, which lead to some tests failing (a simple workaround was added to V0.16.2: this issue is now fixed)
1515
* Thanks again to [@rolandmas](https://github.com/rolandmas) for reporting the issue in the context of the Debian packaging
1616
* Fixed [Issue #86](https://github.com/DataLab-Platform/DataLab/issues/86) - Average of N integer images overflows data type
17+
* Fixed [Issue #87](https://github.com/DataLab-Platform/DataLab/issues/87) - Image average profile extraction: `AttributeError` when trying to edit profile parameters
1718

1819
## DataLab Version 0.16.2 ##
1920

cdl/core/gui/profiledialog.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ def set_obj(self, obj: ImageObj):
298298
p0 = QC.QPointF(*axes_to_canvas(item, x1, y1))
299299
p1 = QC.QPointF(*axes_to_canvas(item, x2, y2))
300300
self.cstool.add_shape_to_plot(plot, p0, p1)
301+
self.shape = self.cstool.get_last_final_shape()
301302
self.param_btn.setEnabled(True)
302303
self.button_box.button(QW.QDialogButtonBox.Ok).setEnabled(True)
303304
else:

cdl/tests/features/images/profile_unit_test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ def test_profile_unit():
2424
if initial_param:
2525
if mode == "line":
2626
param = cdl.param.LineProfileParam.create(row=100, col=200)
27+
elif mode == "segment":
28+
param = cdl.param.SegmentProfileParam.create(
29+
row1=10, col1=20, row2=200, col2=300
30+
)
2731
else:
2832
param = cdl.param.AverageProfileParam.create(
2933
row1=10, col1=20, row2=200, col2=300
@@ -41,6 +45,8 @@ def test_profile_unit():
4145
mode, param, add_initial_shape=initial_param
4246
)
4347
dialog.set_obj(obj)
48+
if initial_param:
49+
dialog.edit_values()
4450
ok = exec_dialog(dialog)
4551
execenv.print(f"Returned code: {ok}")
4652
execenv.print(f"Param: {param}")

0 commit comments

Comments
 (0)