Skip to content

Commit 2166e84

Browse files
committed
Remove specific analysis results from metadata clipboard during copy operation
Fix #133
1 parent 0df1f9e commit 2166e84

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ See DataLab [roadmap page](https://datalab-platform.com/en/contributing/roadmap.
1111
🛠️ Bug fixes:
1212

1313
* Fixed [Issue #128](https://github.com/DataLab-Platform/DataLab/issues/128) - Support long object titles in Signal and Image panels
14+
* Fixed [Issue #133](https://github.com/DataLab-Platform/DataLab/issues/133) - Remove specific analysis results from metadata clipboard during copy operation
1415
* Image ROI features:
1516
* Fixed [Issue #120](https://github.com/DataLab-Platform/DataLab/issues/120) - ROI extraction on multiple images: defined ROI should not be saved in the first selected object. The design choice is to save the defined ROI neither in the first nor in any of the selected objects: the ROI is only used for the extraction, and is not saved in any object
1617
* Fixed [Issue #121](https://github.com/DataLab-Platform/DataLab/issues/121) - `AttributeError` when extracting multiple ROIs on a single image, if more than one image is selected

cdl/core/gui/panel/base.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -537,20 +537,10 @@ def copy_metadata(self) -> None:
537537
"""Copy object metadata"""
538538
obj = self.objview.get_sel_objects()[0]
539539
self.__metadata_clipboard = obj.metadata.copy()
540-
new_pref = obj.short_id + "_"
540+
# Remove all analysis results because they are specific to the object:
541541
for key, value in obj.metadata.items():
542542
if ResultShape.match(key, value):
543-
mshape = ResultShape.from_metadata_entry(key, value)
544-
if not re.match(obj.PREFIX + r"[0-9]{3}[\s]*", mshape.title):
545-
# Handling additional result (e.g. diameter)
546-
for a_key, a_value in obj.metadata.items():
547-
if isinstance(a_key, str) and a_key.startswith(mshape.title):
548-
self.__metadata_clipboard.pop(a_key)
549-
self.__metadata_clipboard[new_pref + a_key] = a_value
550-
mshape.title = new_pref + mshape.title
551-
# Handling result shape
552-
self.__metadata_clipboard.pop(key)
553-
self.__metadata_clipboard[mshape.key] = value
543+
self.__metadata_clipboard.pop(key)
554544

555545
def paste_metadata(self) -> None:
556546
"""Paste metadata to selected object(s)"""

0 commit comments

Comments
 (0)