You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When displaying an IJ2 Img, say, img, of signed integral type, e.g., ByteType or IntType, ImageJFunctions.show (img, "title"); renders negative values as zero.
This is presumably due to the fact that IJ1 appears not support signed integral images.
(It does support a floating-point GRAY32 image type.)
Other IJ2 Img display methods, such as DisplayService.show ("title", img); appear
to convert the signed integral Img to a FloatType / float32 Img before handing it
off to IJ1, which then displays it (correctly) as a GRAY32 image.
As long as IJ2 continues (at least in some contexts) to rely on IJ1 for image display,
the best fix would be to add signed integral display functionality to IJ1. This would
avoid the cost in time and space of the ByteType (etc.) --> FloatType conversion.
Such a fix can be arranged to be non-breaking because it only adds new functionality
to IJ1.
A more expedient fix would be to have ImageJFunctions.show mimic
DisplayService.show, and first convert signed integral images to FloatType
images before displaying them with IJ1. (Of course, if signed integral display
were added to IJ1, DisplayService.show, and similar, should be updated to
use it, as well.)
The text was updated successfully, but these errors were encountered:
The following image is produced:
With negative values all truncated to zero.
the best fix would be to add signed integral display functionality to IJ1.
ImageJ1 does support signed integer values already, to an extent. It does so via its "calibration" feature: Analyze ▶ Calibrate...; see here for an overview; enter Linear Scale and then uncalibrated example values on the left and their corresponding calibrated/adjusted values on the right. ImageJ1 supports calibration functions for uint8 and uint16. For larger integer types, we need to wrap as float32 regardless.
We should update this library to generate properly calibrated ImagePlus objects when there are negative values.
When displaying an IJ2 Img, say, img, of signed integral type, e.g., ByteType or IntType,
ImageJFunctions.show (img, "title");
renders negative values as zero.This issue is also discussed in two imagej forum topics:
Signed integer Img is displayed incorrectly by ImageJFunctions.show
and
Is there a pure IJ2 mechanism for displaying images using stock Fiji?
This is presumably due to the fact that IJ1 appears not support signed integral images.
(It does support a floating-point GRAY32 image type.)
Other IJ2 Img display methods, such as
DisplayService.show ("title", img);
appearto convert the signed integral Img to a FloatType / float32 Img before handing it
off to IJ1, which then displays it (correctly) as a GRAY32 image.
As long as IJ2 continues (at least in some contexts) to rely on IJ1 for image display,
the best fix would be to add signed integral display functionality to IJ1. This would
avoid the cost in time and space of the ByteType (etc.) --> FloatType conversion.
Such a fix can be arranged to be non-breaking because it only adds new functionality
to IJ1.
A more expedient fix would be to have ImageJFunctions.show mimic
DisplayService.show, and first convert signed integral images to FloatType
images before displaying them with IJ1. (Of course, if signed integral display
were added to IJ1, DisplayService.show, and similar, should be updated to
use it, as well.)
The text was updated successfully, but these errors were encountered: