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

Int32 support #16

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Int32 support #16

wants to merge 8 commits into from

Conversation

ExtraE113
Copy link

Fixes #15

@ctrueden ctrueden self-assigned this Jul 29, 2022
@mkitti
Copy link

mkitti commented Aug 16, 2022

There is a IntProcessor in ImageJ1 now:
https://github.com/imagej/ImageJ/blob/84e9e3b0c872b5c38121d0e77b6fbd4cfa4a3b9b/ij/process/IntProcessor.java

Does this use that?

@ctrueden
Copy link
Member

There is a IntProcessor in ImageJ1 now
Does this use that?

@mkitti No, it copies from int[] to float[].

But it could use IntProcessor for (signed) int32. Here is an example in Groovy:

import ij.process.IntProcessor
import ij.IJ
import ij.ImagePlus

size = 800;
n = size*size;
ip = new IntProcessor(size,size);
range = (long) (2 ** 32)
println(range)

for (var i=0; i<n; i++) {
  value = Integer.MIN_VALUE + (int) (i*range/n);
  if (i < 10) println(value);
  ip.set(i, value);
}
img = new ImagePlus("32-bit int image",ip);
img.getProcessor().resetMinAndMax();
IJ.run(img,"Viridis","");
img.show();

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.

"Type 'int32' not handled yet!" Error message when loading int-32 based pixel images
3 participants