[ImageJ-devel] Image Orientation

Brian Schlining bschlining at gmail.com
Wed Aug 20 11:30:14 CDT 2014


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20140820/838e544c/attachment-0001.html>


More information about the ImageJ-devel mailing list