[ImageJ-devel] Image Orientation

Brian Schlining bschlining at gmail.com
Wed Aug 20 18:38:52 CDT 2014


Never mind! I’m working on a Mac and all it’s preview utilities were auto-rotating the image. The imglib IO is reading the file using the correct dimensions. (smacking head on desk)



On August 20, 2014 at 9:30:21 AM, Brian Schlining (bschlining at gmail.com) wrote:

Hi All,

I’m reading an image that has the following dimensions: width = 2448 pixels, height = 3264. I’m reading it as an ImgPlus as follows:

// Scala code
import io.scif.img.IO

val imgs = IO.openImgs("/images/IMG_20140806_080706.jpg")
val imgPlus = imgs.get(0);


The resulting Img has dimensions of [3264x2448x3] or [HEIGHTxWIDTHxCOLORS; which seems to be transposed from what I expect. I would expect it to be [WIDTHxHEIGHTxCOLORS]. In fact, if I convert it to a bufferedImage (see below), then it the BufferedImage also has the wrong orientation:

import net.imglib2.img.display.imagej.ImageJFunctions

val imagePlus = ImageJFunctions.wrap(img, "")
val bufferedImage = imagePlus.getBufferedImage
println(bufferedImage)
println(s"\twidth = ${bufferedImage.getWidth()}") // prints 3264 -> WRONG
println(s"\theight = ${bufferedImage.getHeight()}") // prints 2448 -> WRONG

Can some explain what’s going on here. I’m very confused.

Thanks



-- 
Brian Schlining
-- 
Brian Schlining
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20140820/56de4369/attachment.html>


More information about the ImageJ-devel mailing list