Posted by
Carnë Draug on
Nov 04, 2014; 3:42pm
URL: http://imagej.273.s1.nabble.com/Fwd-ImageJ-reads-reversed-bits-from-unsigned-16-bit-TIFF-saved-by-imwrite-from-GNU-Octave-tp5010293.html
On 3 November 2014 11:05, Pariksheet Nanda <
[hidden email]> wrote:
> Hi all,
>
> ImageJ shows pixel values different from those saved by GNU Octave.
> The byte positions are the same, the bits within each byte are
> reversed, so I'm not sure if this is a traditional problem of
> endianness? For example the value 274 saved from the Octave matrix
> appears as 32480 in ImageJ; the binary representations of which are
> below:
>
> Number saved by Octave (decimal 274): 01001000 10000000
> Number read by ImageJ (decimal 32840): 00010010 00000001
>
> 1) Can anyone else reproduce this problem? At the end of this e-mail
> is the code for Octave to generate the image stacks, and an ImageJ
> macro that reads the value of each slice (or frame), and shows the
> binary and expected values in the results window. Also the image
> stacks from Octave are uploaded here and compressed to 7 kb; password
> is imagej
>
https://filelocker.uconn.edu/public_download?shareId=2c8c0c3141741de36547a9db46b1f06c>
> 2) Can you help me identify where the problem might be coming from?
> GNU Octave has a wrapper for ImageMagick C++ interface, which in turn
> uses libtiff. Perhaps the next logical thing would be to inspect the
> binary values from the TIFF file or check the TIFF file headers, etc
> but I'm not sure how to approach those investigations. My application
> and library versions are:
>
> - ImageJ 1.49i (bundled with FIJI linux-32)
> - Octave 3.8.2
> - ImageMagick 6.8.8.10
> - libtiff 4.0.3
I can't replicate this using Octave 3.8.2 on Debian Jessie with
GraphicsMagick 1.3.20 (quantum 16) and libtiff 4.0.3.
Since Octave does not distribute binaries (and certainly not GraphicsMagick
or ImageMagick binaries), how did you install it? Did you build it from
source or are you using the one from the repositories? And are you sure it's
wrapping ImageMagick and not GraphicsMagick?
Run 'octave_config_info ("MAGICK_LIBS")' at the Octave prompt and
ldd $(octave -qf --eval 'printf (which ("__magick_read__"))') | grep Magick
from bash?
Also, does Octave reads the "bad.tif" file it generates correctly?
> 3) Are there any Octave + ImageJ users out there? How do you export
> images from Octave for ImageJ? Also do you interface Octave data with
> ImageJ / FIJI using the Java Octave Forge package?
>
> [...]
The Java package is included in Octave core since 3.8.0. If you are still
using the java package you are shadowing the builtin functions.
Carnë
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html