Skip to content
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

Improving metadata: Add X and Y stage coordinates in Metadata. #57

Open
joaomamede opened this issue Nov 8, 2021 · 3 comments · May be fixed by #58
Open

Improving metadata: Add X and Y stage coordinates in Metadata. #57

joaomamede opened this issue Nov 8, 2021 · 3 comments · May be fixed by #58

Comments

@joaomamede
Copy link

Adding this to the code seems to do the trick.
*same as z_coordinates"

    def get_parsed_metadata(self):
        """Returns the parsed metadata in dictionary form.

        Returns:
            dict: the parsed metadata
        """

        if self._metadata_parsed is not None:
            return self._metadata_parsed

        frames_per_channel = self._parse_total_images_per_channel()
        self._metadata_parsed = {
            "height": parse_if_not_none(self.image_attributes, self._parse_height),
            "width": parse_if_not_none(self.image_attributes, self._parse_width),
            "date": parse_if_not_none(self.image_text_info, self._parse_date),
            "fields_of_view": self._parse_fields_of_view(),
            "frames": self._parse_frames(),
            "z_levels": self._parse_z_levels(),
            "z_coordinates": parse_if_not_none(self.z_data, self._parse_z_coordinates),
            "x_coordinates":  parse_if_not_none(self.x_data, self._parse_x_coordinates),
            "y_coordinates":  parse_if_not_none(self.y_data, self._parse_y_coordinates),
            "total_images_per_channel": frames_per_channel,
            "channels": self._parse_channels(),
            "pixel_microns": parse_if_not_none(self.image_calibration, self._parse_calibration)
        }

    def _parse_x_coordinates(self):
        """The coordinate in micron for all x.

        Returns:
            list: the x coordinates in micron
        """
        return self.x_data.tolist()

    def _parse_y_coordinates(self):
        """The coordinate in micron for all y.

        Returns:
            list: the y coordinates in micron
        """
        return self.y_data.tolist()
        

Any chance we can add this to the main branch code?

@rbnvrw
Copy link
Member

rbnvrw commented Nov 8, 2021

Hi @joaomamede thank you for your contribution! Could you turn it into a pull request? Then I'll look at it in more detail and incorporate it. Thanks!

@joaomamede
Copy link
Author

Will try doing it this week.
I already had a fork trying to make the "live" version of the reader and surprisingly github doesn't let me do two forks!

@rbnvrw
Copy link
Member

rbnvrw commented Nov 10, 2021

Thank you for the PR, awesome!

If you want to work on multiple changes, you can fork once and create multiple branches in your fork, for which you can submit PRs ;-)

@rbnvrw rbnvrw linked a pull request Nov 10, 2021 that will close this issue
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 a pull request may close this issue.

2 participants