Login  Register

Re: IJ 1.41c bug and 16 Bit BW images

Posted by Wayne Rasband on May 20, 2008; 3:46pm
URL: http://imagej.273.s1.nabble.com/IJ-1-41c-bug-and-16-Bit-BW-images-tp3696019p3696020.html

> today I have updated to IJ 1.41c (Windows). After update some of my
> Plugins located in subfolders of the plugins folder did not appear in
> the Plugins Menu. After "down-date" to IJ 1.40g, all available plugins
> are shown in the Plugins Menu again.

The missing plugins are either in the "Miscellaneous" submenu of the
Plugins menu or in submenus that correspond to subfolders containing
the plugins.

> I do not know whether this a bug or may have another reason:
>
> When I transfer a short array with 16 bit BW pixel data to the
> ImageProcessor by the setPixels method (ImagePlus was created by
> NewImage.createShortImage), the resulting image is BW  16 bit with the
> invert LUT. This is surprising, since I thougth LUTs are only
> applicable to 8 Bit index images. When applying the ImageProcessor
> method invertLut before displaying that image, this has no effect.
> However the invert LUT can be sucessfully applied from the IJ Menu to
> the displayed 16 Bit BW image, finally showing the desired image.
>
> If this is not a bug, how can I get a 16 Bit BW image from a pixel
> array which is finally normally displayed?

                int w=512, h=512;
                ImagePlus imp = IJ.createImage("Test", "16-bit black", w, h, 1);
                imp.show();
                IJ.wait(2000);
                short[] data = new short[w*h];
                for (int i=0; i<w*h; i++)
                        data[i] = (short)i;
                ImageProcessor ip = imp.getProcessor();
                ip.setPixels(data);
                imp.updateAndDraw();

-wayne