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

Add Hamamatsu DCIMG Reader #4255

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Open

Conversation

zacsimile
Copy link
Contributor

@zacsimile zacsimile commented Dec 2, 2024

I found myself in the fortunate position of regularly needing to investigate bead stacks acquired as .dcimg files. My goal was to load them and reslice in xz. This seemed easiest to do in ImageJ, so I ported a merge of some existing DCIMG readers to Java for use as a local tool. The result is presented here, in case there is broader interest in the reader.

There are a few things to note:

  1. On a Mac (works fine on Windows), while the stacks load fine, reslicing does not work on the loaded stack. I receive the error
java.lang.IllegalArgumentException: Invalid bitDepth: 0
  at ij.gui.NewImage.createImage(NewImage.java:397)
  at ij.plugin.Slicer.createOutputStack(Slicer.java:462)
  at ij.plugin.Slicer.resliceRectOrLine(Slicer.java:442)
  at ij.plugin.Slicer.reslice(Slicer.java:115)
  at ij.plugin.Slicer.run(Slicer.java:80)
  at ij.IJ.runPlugIn(IJ.java:216)
  at ij.Executer.runCommand(Executer.java:152)
  at ij.Executer.run(Executer.java:70)
  at java.lang.Thread.run(Thread.java:750)

If I duplicate the stack, reslicing works fine. Does anyone know what is likely to cause such an error just on a Mac?

  1. I’ve made a design choice, where multiple frames within a single DCIMG file are loaded in T and multiple DCIMG files are loaded along Z.

  2. I’ve done the bare minimum on loading metadata.

  3. I have only tested the 4 pixel correction on older DCIMG 0x7. I don’t have any examples of DCIMG 0x1000000 or 0x2000000 that need the 4 pixel correction, though I would be happy to take a look at one.

@melissalinkert
Copy link
Member

Thank you, @zacsimile.

Before we proceed with review, there are two things we will need:

Once we have those two things, we'll assign reviewers to this pull request. Please note we'll do our best to review in a timely fashion, but can't guarantee a timeline at this point. Please see https://forum.image.sc/t/bio-formats-update/101734 for more information about the current state of Bio-Formats maintenance.

  1. On a Mac (works fine on Windows), while the stacks load fine, reslicing does not work on the loaded stack. I receive the error
java.lang.IllegalArgumentException: Invalid bitDepth: 0
  at ij.gui.NewImage.createImage(NewImage.java:397)
  at ij.plugin.Slicer.createOutputStack(Slicer.java:462)
  at ij.plugin.Slicer.resliceRectOrLine(Slicer.java:442)
  at ij.plugin.Slicer.reslice(Slicer.java:115)
  at ij.plugin.Slicer.run(Slicer.java:80)
  at ij.IJ.runPlugIn(IJ.java:216)
  at ij.Executer.runCommand(Executer.java:152)
  at ij.Executer.run(Executer.java:70)
  at java.lang.Thread.run(Thread.java:750)

If I duplicate the stack, reslicing works fine. Does anyone know what is likely to cause such an error just on a Mac?

I don't have any immediate ideas, but once we have example data I expect we would try to reproduce this error as part of the review process.

@melissalinkert
Copy link
Member

Apologies, it looks like we do already have a signed CLA. So we'll just need example data in order to proceed here.

@zacsimile
Copy link
Contributor Author

No worries! I apologize, after reading that forum post, it seems this is exactly the kind of PR you are not looking for at the moment. Thanks for having a look anyway, and please take your time. I have compiled a local version of bioformats that works for me at the moment.

I will upload some data ASAP. I just have to email a few people because a couple of the files I tested on are not mine and I'm not sure if uploading them is OK. In this case, I will have to record a couple more files in different DCIMG formats.

@zacsimile
Copy link
Contributor Author

Please find examples for DCIMG 0x7 and 0x1000000 at https://zenodo.org/records/14281237 and https://zenodo.org/records/14268554, respectively. The first one is a stack with multiple frames in a single DCIMG file and the second is a sequence of single frames, both monochromatic. I still do not have a DCIMG version 0x2000000 or a DCIMG with multiple color channels, but I do not claim to be able to load these with the current code. Happy to update it later if someone provides one or both of these examples.

@zacsimile
Copy link
Contributor Author

Fixed 4-pixel correction for DCIMG 0x1000000 upon receiving example at https://zenodo.org/records/14287640.

Copy link
Member

@melissalinkert melissalinkert left a comment

Choose a reason for hiding this comment

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

Thanks for providing test data, @zacsimile. I've done a first round of code review - let us know when you have had a chance to address all of the comments, and then we can make a plan for further testing.

@zacsimile
Copy link
Contributor Author

Thanks so much for the feedback! Addressed.

Copy link
Member

@melissalinkert melissalinkert left a comment

Choose a reason for hiding this comment

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

https://merge-ci.openmicroscopy.org/jenkins/job/BIOFORMATS-test-repo/293/ continues to pass with this pull request included, and the last set of changes looks good to me.

Propose to get this in for 8.1.0, but will hold off on merging until the new year in case any final comments.

@melissalinkert melissalinkert added this to the 8.1.0 milestone Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants