Login  Register

Re: Saving Raw 32-bit images with imageJ API

Posted by Rasband, Wayne (NIH/NIMH) [E] on Jul 07, 2010; 8:47pm
URL: http://imagej.273.s1.nabble.com/Saving-Raw-32-bit-images-with-imageJ-API-tp3687689p3687690.html

On Jul 6, 2010, at 11:02 AM, Wise, Bowden (GE, Research) wrote:

> Hi,
> I want to use imageJ to scale some images to decimate them. The input
> images are 32-bit real, 2048x2048 images, with little endian. I can read
> the images by setting the FileInfo parameters appropriately. However, I
> cannot figure out how to save the image back out as 32-bit real,
> 512x512, little endian.
> I tried using FileInfo with appropriate settings and using the FileSaver
> but it does not appear to be saving correctly. How do others save their
> images as raw?
> If I save the same image out as a PNG file, the data is indeed scaled
> properly.
> Am I missing something?
> Thanks!
> Bowden

In Edit>Options>Input/Output, enable "Save TIFF and raw in Intel byte order", then save the images using File>Save As>Raw. The images will be saved as raw in their current format (8-bit, 16-bit unsigned, 32-bit float or RGB).

With JavaScript or a plugin, use

 imp = IJ.getImage();
 Prefs.intelByteOrder = true;
 IJ.saveAs(imp, "Raw Data", path);

-wayne