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

Non-square pixel support for GrayscaleImage, ImageSeries, etc. #546

Open
pauladkisson opened this issue Aug 1, 2023 · 3 comments
Open
Labels
category: enhancement improvements of code or code behavior priority: medium non-critical problem and/or affecting only a small set of NWB users
Milestone

Comments

@pauladkisson
Copy link

Re-raising NeurodataWithoutBorders/pynwb#1749 for consistency with the schema.

What would you like to see added to PyNWB?

I have behavioral video and some static images with different estimated length (mm/pixel) than width (mm/pixel). I would like to specify this in the images/ImageSeries' but there is only a scalar resolution field.

What solution would you like?

All image neurodata_types should implement a grid_spacing like pynwb.ophys.ImagingPlane.

@stephprince stephprince added category: enhancement improvements of code or code behavior priority: high impacts proper operation or use of feature important to most users labels May 2, 2024
@rly
Copy link
Contributor

rly commented Nov 7, 2024

The length of each side of a pixel (or voxel) is a property of the acquisition process. That's why grid_spacing is part of pynwb.ophys.ImagingPlane. The image itself (e.g., GrayscaleImage) is agnostic to real-world dimensions. Similarly, ImageSeries is just a series of images in time. The child types of ImageSeries allow you to add information about the images as presented or recorded. OpticalSeries has a field_of_view dataset that allows you to map from pixel dimensions to real-world dimensions (in meters). OnePhotonSeries and TwoPhotonSeries have links to an ImagingPlane with grid_spacing as you mentioned.

@pauladkisson Could you provide a specific use case of how you would want to specify the length/width of a pixel for a particular type of data? Would it be sufficient to specify a set of scaling factors for the image and image series that is a tuple of (x, y) or (x, y, z), e.g., (1, 2). This is basically an aspect ratio (x_length:y_length).

@rly rly added priority: medium non-critical problem and/or affecting only a small set of NWB users and removed priority: high impacts proper operation or use of feature important to most users labels Nov 7, 2024
@pauladkisson
Copy link
Author

This was for an old project with rectangular pixels, but I don't remember and can't easily find the exact dimensions. But I think (x_length:y_length) would work perfectly fine.

@rly
Copy link
Contributor

rly commented Nov 12, 2024

Thanks. We won't add this in schema 2.8.0 (upcoming this month) but we can target 2.9.0.

@rly rly added this to the 2.9.0 milestone Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: enhancement improvements of code or code behavior priority: medium non-critical problem and/or affecting only a small set of NWB users
Projects
None yet
Development

No branches or pull requests

3 participants