Skip to content

Improve show method for Zattrs#117

Closed
Artur-man wants to merge 6 commits into
HelenaLC:mainfrom
Artur-man:zattrs
Closed

Improve show method for Zattrs#117
Artur-man wants to merge 6 commits into
HelenaLC:mainfrom
Artur-man:zattrs

Conversation

@Artur-man
Copy link
Copy Markdown
Collaborator

@Artur-man Artur-man commented Mar 30, 2025

Towards improving show method for Zattrs (#83). Lets discuss before moving forward, but no rush ...

Here are some examples:

> meta(image(x,1))
class: Zattrs
axes(3): c:channel y:space x:space
channels(3): 0 1 2
transformations(1): global
datasets(1): 0
> meta(image(x,2))
class: Zattrs
axes(3): c:channel y:space x:space
channels(3): 0 1 2
transformations(1): global
datasets(3): 0 1 2
> meta(label(x,1))
class: Zattrs
axes(2): y:space x:space
transformations(5): global scale translation affine sequence
datasets(1): 0
> meta(label(x,2))
class: Zattrs
axes(2): y:space x:space
transformations(1): global
datasets(3): 0 1 2
> meta(point(x))
class: Zattrs
axes(2): x y
transformations(1): global
> meta(shape(x))
class: Zattrs
axes(2): x y
transformations(1): global

@Artur-man Artur-man changed the title Zattrs Improve show method for Zattrs Mar 30, 2025
@Artur-man
Copy link
Copy Markdown
Collaborator Author

Artur-man commented May 3, 2025

Perhaps a slightly different show method for datasets under zattrs:

class: Zattrs
axes(3): c:channel y:space x:space
transformations(1): global
datasets(3):
- path(3): 0 1 2
- type(3): scale scale scale
- cTrans(3): (1,1,1) (1,2,2) (1,4,4)
channels(3): 0 1 2

I am a little confused about datasets$coordinatetransformations ... since there is another transformations list in the attributes. Will ask @LucaMarconato ... should we expect an arbitrary list of transformations for each dataset ?

@Artur-man
Copy link
Copy Markdown
Collaborator Author

Artur-man commented May 4, 2025

Following here: https://ngff.openmicroscopy.org/latest/index.html
I think it is better to just list datasets below and summarize transformation, simply put each dataset has either a scale or translation transformation or both:

> x@images$blobs_multiscale_image@meta
class: Zattrs
axes(3): 
- name(3): c y x
- type(3): channel space space
transformations(1): global
datasets(3): 0 1 2
- 0: (scale:1,1,1) 
- 1: (scale:1,2,2) 
- 2: (scale:1,4,4) 
channels(3): 0 1 2

@LucaMarconato
Copy link
Copy Markdown

@Artur-man there are two sets of transformations because one set contains one transformation for each scale of a multiscale object. These transformations go between the intrinsic coordinate system of the scale to a different coordinate system.

Then there are transformations between different coordinate systems.

Here is a recent repository with many examples from the latest incoming specification (NGFF 0.6-dev1). The examples rendered on the NGFF website are too limited. Over the next weeks you can expect activities both on the repo above and in this repo: https://github.com/ome-zarr-models/ome-zarr-models-py with regard to coordinate transformations.

@Artur-man
Copy link
Copy Markdown
Collaborator Author

Artur-man commented May 9, 2025

Here is the latest version based on what we discussed with @LucaMarconato. Let me know what you think.

> x@labels$blobs_labels@meta
class: Zattrs
axes(2): 
- name: y x
- type: space space
coordTrans(5):
- global: (identity)
- scale: (scale:[3,2])
- translation: (translation:[-50,10])
- affine: (affine:[[20,10,30],[50,40,60]])
- sequence: (scale:[3,2]), (translation:[-50,10])
datasets(1): 0
- 0: (scale:[1,1]) 

> x@images$blobs_multiscale_image@meta
class: Zattrs
axes(3): 
- name: c y x
- type: channel space space
coordTrans(1):
- global: (identity)
datasets(3): 0 1 2
- 0: (scale:[1,1,1]) 
- 1: (scale:[1,2,2]) 
- 2: (scale:[1,4,4]) 
channels(3): 0 1 2

@LucaMarconato
Copy link
Copy Markdown

Thanks @Artur-man for the update. Looks good to me, but I would add one piece of information: for the transformations not in datasets, I would add the input and output coordinate system names.

HelenaLC added a commit that referenced this pull request Apr 1, 2026
@Artur-man
Copy link
Copy Markdown
Collaborator Author

shall we close this if you are done with show methods for Zattrs ?

@HelenaLC
Copy link
Copy Markdown
Owner

Still missing proper show of seq trans, but otherwise yeah, I'm happy with it for now

@Artur-man
Copy link
Copy Markdown
Collaborator Author

Ok I am closing this since this PR is now outdated I think.

@Artur-man Artur-man closed this Apr 19, 2026
@Artur-man Artur-man deleted the zattrs branch May 5, 2026 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants