Skip to content

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

Description

@joaomamede

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?

Activity

  1. rbnvrw commented on Nov 8, 2021

    @rbnvrw
    Member

    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!

  2. joaomamede commented on Nov 8, 2021

    @joaomamede
    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!

  3. rbnvrw commented on Nov 10, 2021

    @rbnvrw
    Member

    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 ;-)

  4. linked a pull request that will close this issueAdd XY metadata #58on Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions