Debian Codegraph @

doc/features/image/menu_edit.rst

raw
1 .. _ima-menu-edit:
2
3 Manipulate metadata and annotations
4 ===================================
5
6 This section describes how to manipulate metadata and annotations in DataLab.
7
8 Image metadata contains various information about the image or its representation,
9 such as view settings, Regions Of Interest (ROIs), processing chain history,
10 analysis results, and any other information that you may have added to the metadata
11 of an image (or that comes from the image file itself).
12
13 .. seealso::
14
15 For more information about Regions Of Interest (ROIs), see the :ref:`ima-menu-roi` section.
16
17 .. figure:: /images/shots/i_edit.png
18
19 Screenshot of the "Edit" menu.
20
21 The "Edit" menu allows you to perform classic editing operations on the current image
22 or group of images (create/rename group, move up/down, delete image/group of images,
23 etc.).
24
25 As detailed below, it also allows you to:
26
27 - Navigate and utilize the processing chain history through actions like "Recompute"
28 and "Select source objects".
29 - Manipulate metadata and annotations associated with the current image, thanks to the
30 "Metadata" and "Annotations" submenus which provide the following features.
31
32 Recompute
33 ---------
34
35 The "Recompute" |recompute| action allows you to recompute the selected image(s) using
36 their original processing parameters. This is useful when you want to re-execute the
37 processing chain that was used to create an image, for example after modifying global
38 settings or dependencies.
39
40 .. |recompute| image:: ../../../datalab/data/icons/edit/recompute.svg
41 :width: 24px
42 :height: 24px
43 :class: dark-light no-scaled-link
44
45 .. note::
46
47 This action is only available for images that were created through processing
48 operations and have stored processing parameters.
49
50 Select source objects
51 ---------------------
52
53 The "Select source objects" |goto_source| action allows you to select the source
54 object(s) that were used to create the currently selected image. This helps trace
55 back the processing history and understand which original images were used as input
56 for the current result.
57
58 .. |goto_source| image:: ../../../datalab/data/icons/edit/goto_source.svg
59 :width: 24px
60 :height: 24px
61 :class: dark-light no-scaled-link
62
63 .. note::
64
65 This action is only available when exactly one image is selected and that image
66 has source object references.
67
68 Metadata
69 --------
70
71 .. figure:: /images/shots/i_edit_metadata.png
72
73 Screenshot of the "Metadata" submenu.
74
75 Copy/paste metadata
76 ^^^^^^^^^^^^^^^^^^^
77
78 As metadata contains useful information about the image, it can be copied and pasted
79 from one image to another by selecting the "Copy metadata" |metadata_copy| and
80 "Paste metadata" |metadata_paste| actions in the "Edit" menu.
81
82 .. |metadata_copy| image:: ../../../datalab/data/icons/edit/metadata_copy.svg
83 :width: 24px
84 :height: 24px
85 :class: dark-light no-scaled-link
86
87 .. |metadata_paste| image:: ../../../datalab/data/icons/edit/metadata_paste.svg
88 :width: 24px
89 :height: 24px
90 :class: dark-light no-scaled-link
91
92 This feature allows you to tranfer those information from one image to another:
93
94 - :ref:`Regions Of Interest (ROIs) <ima-menu-roi>`: that is a very efficient way to reuse
95 the same ROI on different images and easily compare the results of the analysis on
96 those images
97 - Analyze results, such as a centroid position or a contour detection (the relevance
98 of transferring such information depends on the context and is up to the user
99 to decide)
100 - Any other information that you may have added to the metadata of an image
101
102 .. note::
103
104 Copying metadata from an image to another will overwrite the metadata of the
105 destination image (for the metadata keys that are common to both images)
106 or simply add the metadata keys that are not present in the destination image.
107
108 Import/export metadata
109 ^^^^^^^^^^^^^^^^^^^^^^
110
111 Metadata can also be imported and exported from/to a JSON file using the "Import
112 metadata" |metadata_import| and "Export metadata" |metadata_export| actions in the
113 "Edit" menu. This is exactly the same as the copy/paste metadata feature (see above
114 for more details on the use cases of this feature), but it allows you to save the
115 metadata to a file and then import it back later.
116
117 .. |metadata_import| image:: ../../../datalab/data/icons/edit/metadata_import.svg
118 :width: 24px
119 :height: 24px
120 :class: dark-light no-scaled-link
121
122 .. |metadata_export| image:: ../../../datalab/data/icons/edit/metadata_export.svg
123 :width: 24px
124 :height: 24px
125 :class: dark-light no-scaled-link
126
127 Delete metadata
128 ^^^^^^^^^^^^^^^
129
130 When deleting metadata using the "Delete metadata" |metadata_delete| action in the
131 "Edit" menu, you will be prompted to confirm the deletion of Region of Interests (ROIs)
132 if they are present in the metadata. After this eventual confirmation, the metadata
133 will be deleted, meaning that analysis results, ROIs, and any other information
134 associated with the image will be lost.
135
136 .. |metadata_delete| image:: ../../../datalab/data/icons/edit/metadata_delete.svg
137 :width: 24px
138 :height: 24px
139 :class: dark-light no-scaled-link
140
141 Add metadata
142 ^^^^^^^^^^^^
143
144 The "Add metadata" |metadata_add| action allows you to add custom metadata items to
145 one or more selected images. This is useful for tagging images with experiment IDs,
146 sample names, processing steps, or any other custom information.
147
148 .. |metadata_add| image:: ../../../datalab/data/icons/edit/metadata_add.svg
149 :width: 24px
150 :height: 24px
151 :class: dark-light no-scaled-link
152
153 .. figure:: /images/shots/i_add_metadata.png
154
155 Add metadata dialog.
156
157 When you select "Add metadata..." from the Edit menu, a dialog appears where you can:
158
159 - **Metadata key**: Enter the name of the metadata field to add
160 - **Value pattern**: Define a pattern for the metadata value using Python format strings
161 - **Conversion**: Choose how to store the value (string, float, integer, or boolean)
162 - **Preview**: See how the metadata will be added to each selected image
163
164 The value pattern supports the following placeholders:
165
166 - ``{title}``: Image title
167 - ``{index}``: 1-based index of the image in the selection
168 - ``{count}``: Total number of selected images
169 - ``{xlabel}``, ``{xunit}``, ``{ylabel}``, ``{yunit}``: Axis labels and units
170 - ``{metadata[key]}``: Access existing metadata values
171
172 You can also use format modifiers:
173
174 - ``{title:upper}``: Convert to uppercase
175 - ``{title:lower}``: Convert to lowercase
176 - ``{index:03d}``: Format as 3-digit number with leading zeros
177
178 **Examples:**
179
180 - Add acquisition number: key=``acquisition``, pattern=``ACQ_{index:04d}``, conversion=string
181 → Creates metadata like ``acquisition="ACQ_0001"``
182
183 - Add exposure time: key=``exposure_ms``, pattern=``{metadata[exposure]}``, conversion=float
184 → Copies exposure from existing metadata and converts to float
185
186 - Flag calibrated images: key=``is_calibrated``, pattern=``true``, conversion=bool
187 → Sets ``is_calibrated=True`` for all selected images
188
189 Annotations
190 -----------
191
192 Annotations are visual elements that can be added to images to highlight specific
193 features, mark regions of interest, or add explanatory notes. DataLab provides a
194 dedicated submenu in the "Edit" menu for managing annotations.
195
196 .. figure:: /images/shots/i_edit_annotations.png
197
198 Screenshot of the "Annotations" submenu.
199
200 Copy/paste annotations
201 ^^^^^^^^^^^^^^^^^^^^^^
202
203 Annotations can be copied from one image and pasted to one or more other images
204 using the "Copy annotations" |annotations_copy| and "Paste annotations" |annotations_paste|
205 actions. This is useful when you want to apply the same visual markers across multiple
206 images.
207
208 .. |annotations_copy| image:: ../../../datalab/data/icons/edit/annotations_copy.svg
209 :width: 24px
210 :height: 24px
211 :class: dark-light no-scaled-link
212
213 .. |annotations_paste| image:: ../../../datalab/data/icons/edit/annotations_paste.svg
214 :width: 24px
215 :height: 24px
216 :class: dark-light no-scaled-link
217
218 The "Paste annotations" action is only enabled when there are annotations in the
219 clipboard (i.e., after using "Copy annotations").
220
221 Edit annotations
222 ^^^^^^^^^^^^^^^^
223
224 The "Edit annotations" |annotations_edit| action opens a dialog where you can view,
225 add, modify, or remove annotations from the current image. This provides a visual
226 way to manage all annotations on an image.
227
228 .. |annotations_edit| image:: ../../../datalab/data/icons/edit/annotations_edit.svg
229 :width: 24px
230 :height: 24px
231 :class: dark-light no-scaled-link
232
233 Import/export annotations
234 ^^^^^^^^^^^^^^^^^^^^^^^^^^
235
236 Annotations can be saved to and loaded from JSON files (.dlabann extension) using
237 the "Import annotations" |annotations_import| and "Export annotations" |annotations_export|
238 actions. This allows you to:
239
240 - Save annotation sets for later reuse
241 - Share annotations with colleagues
242 - Archive annotations separately from image data
243 - Apply the same annotations to different images across sessions
244
245 .. |annotations_import| image:: ../../../datalab/data/icons/edit/annotations_import.svg
246 :width: 24px
247 :height: 24px
248 :class: dark-light no-scaled-link
249
250 .. |annotations_export| image:: ../../../datalab/data/icons/edit/annotations_export.svg
251 :width: 24px
252 :height: 24px
253 :class: dark-light no-scaled-link
254
255 The "Export annotations" action is only available when the selected image has
256 annotations.
257
258 Delete annotations
259 ^^^^^^^^^^^^^^^^^^
260
261 The "Delete annotations" |annotations_delete| action removes all annotations from the
262 selected image(s). This action is only enabled when the selected image(s) have
263 annotations.
264
265 .. |annotations_delete| image:: ../../../datalab/data/icons/edit/annotations_delete.svg
266 :width: 24px
267 :height: 24px
268 :class: dark-light no-scaled-link
269
270 .. note::
271
272 Annotations are stored separately from metadata and analysis results. Deleting
273 annotations does not affect ROIs or other metadata items.
274
275 Image titles
276 ------------
277
278 Image titles may be considered as metadata from a user point of view, even if they
279 are not stored in the metadata of the image (but in an attribute of the image object).
280
281 The "Edit" menu allows you to:
282
283 - "Add object title to plot": this action will add a label on top of the image
284 with its title, which might be useful in combination with the "Distribute on a grid"
285 operation (see :ref:`ima-menu-processing`) to easily identify the images.
286
287 - "Copy titles to clipboard" |copy_titles|: this action will copy the titles of the
288 selected images to the clipboard, which might be useful to paste them in a text
289 editor or in a spreadsheet.
290
291 Example of the content of the clipboard:
292
293 .. code-block:: text
294
295 g001:
296 s001: lorentz(a=1,sigma=1,mu=0,ymin=0)
297 s002: derivative(s001)
298 s003: wiener(s002)
299 g002: derivative(g001)
300 s004: derivative(s001)
301 s005: derivative(s002)
302 s006: derivative(s003)
303 g003: fft(g002)
304 s007: fft(s004)
305 s008: fft(s005)
306 s009: fft(s006)
307
308 .. |copy_titles| image:: ../../../datalab/data/icons/edit/copy_titles.svg
309 :width: 24px
310 :height: 24px
311 :class: dark-light no-scaled-link