Skip to content

Parsing point name in nd2 #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
hftsai opened this issue Oct 29, 2019 · 5 comments
Open

Parsing point name in nd2 #26

hftsai opened this issue Oct 29, 2019 · 5 comments

Comments

@hftsai
Copy link

hftsai commented Oct 29, 2019

Hi Great tools you have created here
I'm a python novice, but I'm currently thinking to automate my experiment process.

We are conducting high throughput experiments with nikon microscopes
one way to annotate experiments during a ND acqusitions is to rename the point name (as screen shot attached)

Is there a function in nd2reader to parse the point name in a multipoint loop?

image

Thanks!
Best,

@rbnvrw
Copy link
Member

rbnvrw commented Oct 31, 2019

Thanks @hftsai, I'm not sure if these point names are parsed at this moment, but you can have a look in the attributes in reader.parser._raw_metadata (where reader is your ND2Reader instance). For example maybe the attributes custom_data, image_attributes, image_metadata_sequence or image_metadata may contain the information (no guarantees though).

Let me know if you find something!

@hftsai
Copy link
Author

hftsai commented Nov 4, 2019

Thank you!
it doesn't seem to be in the raw_metadata or in the metadata.

I'll look into the Nikon SDK

Thanks!

@aknckaan
Copy link

I was having the same issue then I noticed that the point names are saved at reader.parser_raw_metadata.image_metadata['SLxExperiment']["uLoopPars"]["Points"]

@rbnvrw
Copy link
Member

rbnvrw commented Mar 15, 2021

Great that you found this. The discoverability of all these attributes is quite low at this point. It is basically an almost one-to-one mapping of the ND2 file format into the raw metadata class. It would be great if we can improve this in future versions. I'll leave this open as a reminder.

@kevinjohncutler
Copy link

I would find this enhancement extremely useful - filtering data by point name is something I do regularly. Until then, @aknckaan's comment is workable. One thing I had to contend with is that reader.parser._raw_metadata.image_metadata gives byte objects, not strings, as the keys and values. One can recursively convert or just deal with typing b'Points' etc., but unless I'm just being stupid, an accessible version of this data would be in str form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants