Skip to content

Int32 support#16

Open
ExtraE113 wants to merge 8 commits intofiji:masterfrom
ExtraE113:int32_support
Open

Int32 support#16
ExtraE113 wants to merge 8 commits intofiji:masterfrom
ExtraE113:int32_support

Conversation

@ExtraE113
Copy link
Copy Markdown

Fixes #15

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

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
Copy Markdown
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