http://imagej.273.s1.nabble.com/Reading-16-bit-PGM-files-tp5005932p5005954.html
I was just calling it incorrectly.
BufferedImages. I have updated the documentation.
> Thanks for you help! I'm back on track.
>
> Paul
>
> On Tue, Dec 17, 2013 at 3:28 PM, Rasband, Wayne (NIH/NIMH) [E]
> <
[hidden email]> wrote:
>> On Dec 17, 2013, at 5:01 PM, Paul Dumais wrote:
>>
>>> Hi Wayne,
>>>
>>> Thanks Wayne. I'm using 1.48c. Is there a maven repo with 1.48m? If
>>> you do println on the BufferedImage object does it report the correct
>>> bit depth?
>>
>> 1.48c should work. I get a 16-bit BufferedImage using this JavaScript:
>>
>> imp = IJ.openImage(path);
>> ip = imp.getProcessor();
>> bi = ip.get16BitBufferedImage();
>> print(bi);
>>
>> Output:
>> BufferedImage@6f0c29fe: type = 11 ColorModel: #pixelBits = 16 numComponents = 1 color space = java.awt.color.ICC_ColorSpace@648bfdea transparency = 1 has alpha = false isAlphaPre = false ShortInterleavedRaster: width = 1280 height = 960 #numDataElements 1
>>
>> Best regards,
>>
>> -wayne
>>
>>> On Tue, Dec 17, 2013 at 2:54 PM, Rasband, Wayne (NIH/NIMH) [E]
>>> <
[hidden email]> wrote:
>>>> Hi Paul,
>>>>
>>>> Your file opens as a 16-bit image using ImageJ 1.48m (see screenshot). Are you using an old version of ImageJ?
>>>>
>>>> Best regards,
>>>>
>>>> -wayne
>>>> [cid:
[hidden email]]
>>>>
>>>>
>>>> On Dec 17, 2013, at 4:23 PM, Paul Dumais wrote:
>>>>
>>>>> Hi Wayne,
>>>>>
>>>>> Thanks for willing to look at this. My image is attached. I was going
>>>>> to try to hack the byte stream to see if the pgm header is mismatched
>>>>> to the actually raster data (although I don't know how that would
>>>>> look). Or maybe the print str of the BufferedImage object is
>>>>> misrepresenting the bit depth.
>>>>>
>>>>> Cheers,
>>>>>
>>>>> Paul
>>>>>
>>>>> On Mon, Dec 16, 2013 at 7:29 PM, Rasband, Wayne (NIH/NIMH) [E]
>>>>> <
[hidden email]> wrote:
>>>>>> On Dec 16, 2013, at 7:59 PM, Paul Dumais wrote:
>>>>>>
>>>>>>> I have discovered that reading a 16-bit PGM using the ImagePlus
>>>>>>> constructor downsamples the resulting bufferedImage into 8 bits.
>>>>>>>
>>>>>>> Does imagej support 16-bit pgm files?
>>>>>>
>>>>>> ImageJ should be able to open 16-bit PGM files. Send, or make available, an example of one of your images and I will try to figure out why ImageJ does not open it correctly.
>>>>>>
>>>>>> Best regards,
>>>>>>
>>>>>> -wayne
>>>>>>
>>>>> <2013-11-05 11-49-49_MCA000_65.3.pgm>
>>>>
>>