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

RGB images sent to ImageJ should use composite mode to preserve color #278

Closed
ctrueden opened this issue Jul 26, 2023 · 1 comment · Fixed by #309
Closed

RGB images sent to ImageJ should use composite mode to preserve color #278

ctrueden opened this issue Jul 26, 2023 · 1 comment · Fixed by #309
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@ctrueden
Copy link
Member

  • Open a JPG in napari
  • Send it to ImageJ using the advanced transfer button, fixing the dimensions to be correct (YXC)
  • Observe that even though the dimensions are correct, the image is still in grayscale, with one channel at a time

ImageJ has a special CompositeImage class to composite multiple channels together at once, and ImageJ2 provides a hint for that, which IIRC is Dataset#setRGBMerged(true). It's unfortunate if napari-imagej needs to end up calling that—this might actually be a bugfix in PyImageJ or even in imagej-legacy somewhere—but I'm documenting the issue here because it's easy to reproduce using napari-imagej.

@gselzer gselzer self-assigned this Jul 26, 2023
@gselzer gselzer added the enhancement New feature or request label Jul 26, 2023
@gselzer gselzer added this to the 0.2.0 milestone Jul 26, 2023
@gselzer
Copy link
Collaborator

gselzer commented Nov 5, 2024

I tried to fix this on the rgb-data-transfer branch, but there were errors stemming from imagej-common:

java.lang.ArrayIndexOutOfBoundsException: Index -2 out of bounds for length 1
	at net.imglib2.AbstractInterval.min(AbstractInterval.java:208)
	at net.imagej.Position.setPosition(Position.java:324)
	at net.imagej.Position.setPosition(Position.java:367)
	at net.imagej.display.DefaultDatasetView.getCurrentLUT(DefaultDatasetView.java:556)
	at net.imagej.display.DefaultDatasetView.updateLUTs(DefaultDatasetView.java:543)
	at net.imagej.display.DefaultDatasetView.rebuild(DefaultDatasetView.java:398)
	at net.imagej.display.DefaultImageDisplay.rebuild(DefaultImageDisplay.java:134)
	at net.imagej.display.DefaultImageDisplay.display(DefaultImageDisplay.java:272)
	at org.scijava.display.DefaultDisplayService.createDisplayQuietly(DefaultDisplayService.java:228)
	at org.scijava.display.DefaultDisplayService.createDisplay(DefaultDisplayService.java:210)
	at org.scijava.ui.AbstractUserInterface.show(AbstractUserInterface.java:98)
	at org.scijava.ui.UserInterface.show(UserInterface.java:75)
	at org.scijava.ui.DefaultUIService.show(DefaultUIService.java:242)

@gselzer gselzer linked a pull request Nov 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants