Skip to content

Commit 1591bc3

Browse files
committed
Add source file path to signal and image metadata
1 parent 716358a commit 1591bc3

File tree

4 files changed

+234
-202
lines changed

4 files changed

+234
-202
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ for future and past milestones.
8888
performance during the execution of test scripts
8989
* Test scenarios on signals and images are now using this feature to improve
9090
performance
91+
* Signal and image metadata:
92+
* Added "source" entry to the metadata dictionary, to store the source file path
93+
when importing a signal or an image from a file
94+
* This field is kept while processing the signal/image, in order to keep track of
95+
the source file path
9196

9297
📚 Documentation:
9398

cdl/core/computation/image/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ def dst_11_signal(src: ImageObj, name: str, suffix: str | None = None) -> Signal
118118
dst.title = title
119119
if suffix is not None:
120120
dst.title += "|" + suffix
121+
dst.metadata["source"] = src.metadata["source"] # Keep track of the source image
121122
return dst
122123

123124

cdl/core/gui/panel/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,7 @@ def open_object(
648648
obj_or_objlist = self.IO_REGISTRY.read(filename)
649649
objs = obj_or_objlist if isinstance(obj_or_objlist, list) else [obj_or_objlist]
650650
for obj in objs:
651+
obj.metadata["source"] = filename
651652
self.add_object(obj, set_current=obj is objs[-1])
652653
self.selection_changed()
653654
if len(objs) == 1:

0 commit comments

Comments
 (0)