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

Order of axes for CuImage.origin? #709

Open
jakirkham opened this issue Mar 5, 2024 · 4 comments
Open

Order of axes for CuImage.origin? #709

jakirkham opened this issue Mar 5, 2024 · 4 comments
Labels
question Further information is requested

Comments

@jakirkham
Copy link
Member

What is the order of the axes for CuImage.origin? Is it C-order or F-order? Also does it have any relationship to CuImage.dims

cc @thewtex (who raised this question)
cc @gigony (who may know the answer)

@jakirkham jakirkham added the question Further information is requested label Mar 5, 2024
@jakirkham
Copy link
Member Author

Maybe a follow up item here is adding this to the docs

@gigony
Copy link
Contributor

gigony commented Mar 5, 2024

@jakirkham @thewtex

The dimension order of the origin is crucial for 3D images, such as CT/MRI images.

There has been some discussion on origin, spacing, and direction at ITK's board: https://discourse.itk.org/t/images-in-physical-space-in-python/2124/15.
I don't recall the conclusion of the discussion, but it appears that establishing a standard for image metadata across Python image libraries is important.

cuCIM operates with a plugin system, where the primary plugin is the cuSlide plugin.
The cuMed plugin is intended to handle CT/MRI volumetric data, but its implementation is not yet planned; currently, we have only a stub plugin implementation for this.

Currently, for Whole Slide Images, the origin metadata is not extensively utilized and is always set to [(0.0, 0.0, 0.0)]
(

std::pmr::vector<float> origin({ 0.0, 0.0, 0.0 }, &resource);
).

@jakirkham
Copy link
Member Author

Thanks Gigon! 🙏

When does this origin get set in CuImage construction? Is this part of the parse call here?

is_loaded_ = image_format_->image_parser.parse(file_handle_.get(), image_metadata_);

Or does it happen somewhere else?

@gigony
Copy link
Contributor

gigony commented Mar 7, 2024

Thanks Gigon! 🙏

When does this origin get set in CuImage construction? Is this part of the parse call here?

is_loaded_ = image_format_->image_parser.parse(file_handle_.get(), image_metadata_);

Or does it happen somewhere else?

@jakirkham
Correct, the method call would call static bool CUCIM_ABI parser_parse(CuCIMFileHandle_ptr handle_ptr, cucim::io::format::ImageMetadataDesc* out_metadata_desc) method here (

std::pmr::vector<float> origin({ 0.0, 0.0, 0.0 }, &resource);
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants