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

Imaris: Remove empty color entries for non 0 indexed colors #4193

Merged
merged 2 commits into from
Jul 10, 2024

Conversation

dgault
Copy link
Member

@dgault dgault commented Jun 4, 2024

Issue was raised on forum thread https://forum.image.sc/t/how-to-open-ims-files-with-fiji/29907/12
A sample file was provided on https://zenodo.org/records/11203497 and can be used for testing

The problem appears to be due to the colors in the file being indexed from 1 rather than 0, this lead to a null entry in the arraylist. Removing the empty entry allows for the file to read without exception.

To test, use the sample file in the Zenodo link

  • Without this PR attampting to initiate the file should result in an exception as below
  • With the PR the file should be read without the exception and the images display as expected
	at loci.formats.in.ImarisHDFReader.initFile(ImarisHDFReader.java:413)
	at loci.formats.FormatReader.setId(FormatReader.java:1480)
	at loci.plugins.in.ImportProcess.initializeFile(ImportProcess.java:498)
	at loci.plugins.in.ImportProcess.execute(ImportProcess.java:141)
	at loci.plugins.in.Importer.showDialogs(Importer.java:156)
	at loci.plugins.in.Importer.run(Importer.java:77)
	at loci.plugins.LociImporter.run(LociImporter.java:78)
	at ij.IJ.runUserPlugIn(IJ.java:244)
	at ij.IJ.runPlugIn(IJ.java:210)
	at ij.Executer.runCommand(Executer.java:152)
	at ij.Executer.run(Executer.java:70)
	at java.lang.Thread.run(Thread.java:748)

@imagesc-bot
Copy link

This pull request has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/how-to-open-ims-files-with-fiji/29907/18

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.

h5dump -A on the file shows that Channel 1, Channel 2, and Channel 3 have a Color attribute, but Channel 0 does not. showinf -nopix -omexml with this PR shows that channels 0, 1, and 2 have a Color set, but channel 3 does not.

@dgault dgault added this to the 7.3.1 milestone Jul 8, 2024
@dgault
Copy link
Member Author

dgault commented Jul 9, 2024

With the first commit, removing the empty colour resulted in the remaining colours being re-indexed. With the latest commit the null colour is now handled so the previous colour indexes remain intact.

@dgault dgault requested a review from melissalinkert July 9, 2024 10:16
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.

This looks good to me. OK to merge if builds are green in the morning.

@dgault dgault merged commit cc8bb5f into ome:develop Jul 10, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants