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

Studio-NDTiffAdapter: Simplifies function getImagesMatching() #1840

Merged
merged 2 commits into from
Jan 10, 2024

Conversation

nicost
Copy link
Member

@nicost nicost commented Nov 17, 2023

so that it does no longer go through the complete dataset. This may lead to problems in certain cases, but at least makes virtual datasets readable again.
Closes #1839

so that it does no longer go through the complete dataset.  This may lead to
problems in certain cases, but at least makes virtual datasets
readable again.
@nicost nicost changed the title Studio-NDTiffAdapter: Simplifies functoin getImagesMNatching Studio-NDTiffAdapter: Simplifies function getImagesMatching() Nov 17, 2023
Copy link
Member

@marktsuchida marktsuchida left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to check, is the intent not to change what getImagesMatching() returns, but to change how it computes the matching set?

This may lead to problems in certain cases

Which cases?

@nicost
Copy link
Member Author

nicost commented Nov 17, 2023

I believe it now only returns an exact match, so no longer the super set (i.e., if one only asks for channel == 1, it should return all images with channel == 1). I do not know how to implement that behavior with the NDTiffStorage back-end.

@henrypinkard
Copy link
Member

henrypinkard commented Nov 17, 2023

(Edit)

I thnink the problem is that a function that reads the metadata but not the image had never been added to the NDTiff API. I just added one:
micro-manager/NDStorage#142

return axesStream.map(new Function<HashMap<String, Object>, Image>() {
@Override
public Image apply(HashMap<String, Object> axes) {
TaggedImage ti = addEssentialImageMetadata(storage_.getImage(axes), axes);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the line that I think would need to change

@nicost
Copy link
Member Author

nicost commented Nov 18, 2023

This is the line that I think would need to change

To what? I do not really understand this code.

@henrypinkard
Copy link
Member

from storage_.getImage to storage_.getImageMetadata (so that it doesnt read pixels when it doesnt need them)

and then change the addEssentialImageMetadata to do whatever it is the studio needs

@nicost
Copy link
Member Author

nicost commented Jan 10, 2024

What I would need from the storage class is a method that tells which axes are available and which images (with axes coordinates) are in the dataset. It it unclear from the NDTiff Storage API is such a method exits, and documentation such as:

 /**
   * Get the metadata for a single image
   *
   * @param axes
   * @return
   */
  public JSONObject getImageMetadata(HashMap<String, Object> axes);

is not very helpful. I will merge this PR since it at least improves the situation, but welcome work on making this actually work right.

@nicost nicost enabled auto-merge January 10, 2024 04:52
@nicost nicost merged commit 36501ae into micro-manager:main Jan 10, 2024
5 checks passed
@nicost nicost deleted the ndtiffVirtual branch February 21, 2024 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants