-
Notifications
You must be signed in to change notification settings - Fork 5
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
STYLE: Replace thread_local variables with m_TensorStoreData data member #71
STYLE: Replace thread_local variables with m_TensorStoreData data member #71
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good on a glance.
What drives your interest in this remote module?
Good question 😃 One of our aims for the elastix project is to add OME-Zarr support! At least for the input images. We are hoping to get it working by using your remote module! |
So... what inspired you to make this module? |
Adding support for distributed image registration, as part of a grant-funded project. |
Did you write it all from scratch, or is there helpful example code of how to use tensorstore in C++, that you could use? Like, how did you figure this out? auto indexDomain = tensorstore::IndexDomainBuilder(dimension).origin(indices).shape(sizes).Finalize().value();
auto arr = tensorstore::Array(buffer, indexDomain.shape(), tensorstore::c_order);
auto indexedStore = store | tensorstore::AllDims().SizedInterval(indices, sizes);
tensorstore::Read(indexedStore, tensorstore::UnownedToShared(arr)).value();
ITKIOOMEZarrNGFF/src/itkOMEZarrNGFFImageIO.cxx Lines 230 to 234 in 1d0f131
I'm impressed! |
I started from scratch. I was looking at unit tests in tensorstore, and to a lesser degree at their Python documentation. TensorStore authors also helped me a lot. Take a look at issues opened by me: |
3dd47f5
to
09b62e9
Compare
It appears preferable that multiple OMEZarrNGFFImageIO instances do not share their TensorStore context and store. With this commit, each OMEZarrNGFFImageIO instance will have its own context and store, stored in its `m_TensorStoreData` data member. The `m_TensorStoreData` data member hides the TensorStore data from the interface, as it is a pointer to a forward-declared struct, similar to the "Pimpl" idiom.
09b62e9
to
0b9ca69
Compare
I think this pull request is ready 👍 (GitHub does not allow me to approve my own pull request 🤷.) |
It appears preferable that multiple OMEZarrNGFFImageIO instances do not share their TensorStore context and store. With this commit, each OMEZarrNGFFImageIO instance will have its own context and store, stored in its
m_TensorStoreData
data member.The
m_TensorStoreData
data member hides the TensorStore data from the interface, as it is a pointer to a forward-declared struct, similar to the "Pimpl" idiom.