You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there an easy way to rename SpatialElements? For example, an image? Not just in memory, but also on disk? I couldn't really find anything in the docs, except for copying the element, creating it with a new name, writing to disk, and deleting the old element both in memory and on disk, but that does seem like an overkill for renaming something. Maybe I'm just missing something here or I have overlooked something
The text was updated successfully, but these errors were encountered:
Hi @Marius1311 thanks for the discussion. Currently there is no API for renaming an element, but indeed it would be useful to have, we will keep this in mind.
If you want to rename images or tables, I suggest to do it outside spatialdata and rename the Zarr folder for the image/table on disk. This applies also for the other elements, with the additional requirement to also eventually modify some metadata.
Precisely:
if what is renamed is a points, shapes or labels that is annotated by a table, the table region metadata (adata.uns) needs to be renamed, and also the values of the region_key column.
After this, if you are uploading the data to some cloud storage, you should also regenerate the consolidated metadata. This can be done easily by loading the data and then calling sdata.write_consolidated_metadata().
Is there an easy way to rename SpatialElements? For example, an image? Not just in memory, but also on disk? I couldn't really find anything in the docs, except for copying the element, creating it with a new name, writing to disk, and deleting the old element both in memory and on disk, but that does seem like an overkill for renaming something. Maybe I'm just missing something here or I have overlooked something
The text was updated successfully, but these errors were encountered: