imagej / imagej/imagej2

Wrong data for TIFF images

Open
#215 2 comments 0 reactions 0 assignees View on GitHub
needs feedback
Dominant language
Java
Stars
1.4k
Forks
350
PR merge metrics
No merged PRs in 30d

Description

Example:

ImagePlus img = new ImagePlus(tiffFile);
L.i(img.getWidth()+" x "+img.getHeight());
for (int i = 500; i < 600; i++) {
int[] px = img.getPixel(i, i);
out.println(i+": "+Arrays.toString(px));
}

Dimensions are always correct, data is correct for other image formats, but for TIFFs (here, 16 bit uncompressed) only the first channel shows values > 0, which is incorrect:

6000 x 4000
500: [122, 0, 0, 0]
501: [65325, 0, 0, 0]
502: [65471, 0, 0, 0]
503: [28, 0, 0, 0]
504: [65202, 0, 0, 0]
505: [65281, 0, 0, 0]
506: [65021, 0, 0, 0]

How can I get correct values?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the ImagePlus(tiffFile) loading path and follow getPixel for 16-bit uncompressed TIFF data, comparing it with the behavior for other image formats. Reproduce the 6000 x 4000 example and verify that all returned channel values match the TIFF pixel data rather than only the first channel being populated.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
computer-vision
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.