Posted by
Abdulelah on
URL: http://imagej.273.s1.nabble.com/Problem-with-ImageJ-and-Matlab-image-analysis-tp5019978p5020017.html
Hi,
First, thank you all for your thoughts and suggestions. I truly appreciate it and it help by way or another.
Second, thanks to God I finally been able to figure what or where to problem is.
As someone of you said that the orientation (or projection) of the image is different from ImageJ to Matlab, it is true. It seems to be Matlab switch the x, y whenever you give it the order to read it and give you the answer to any point directly. However, it is not when it shows it in a figure. Will give an example to better understand what i'm saying:
So, if I opened my data set in imageJ and Matlab (let's say I have a stack of images 1-100). In ImageJ if i scroll over to any of slice I want then select a point or move the cruiser to certain point (I usually zoom in till I can see each pixel to accurately select only one pixel to check for it's gray value) ImageJ will show you the x (represents the row, y (represents the column), z (represents the slice) immediately below the tool bar without even clicking on the point.
x= 274, y= 361, z= 44, Value= 14 (In ImageJ these coordinate they all start from 0)
Now, if I order Matlab to give me the exact same point value supposly I need to type it like this:
Y(275, 362, 45) I add one all over x, y, z as Matlab can only read a true positive and all start from 1
ans = 77
however, if you type it the other way (y then x then z):
Y(362, 275, 45)
ans = 14 (it will show the same value for ImageJ
Last, if I give the Matlab an order to open a figure (e.g 44) and put the coordinate for that figure to same as the ImageJ (I mean x then y orientation)
Figure(44)
imagesc(275, 362, 45) it will show that exact pixel only or you can type (:, :, z) it will show the whole image
Then you can search and read that point (275, 362) and it will give the same value = 14
To make it short, if you wish to have the same reading between ImageJ and Matlab. Whenever you give the order to Matlab just flip row (x) number to column (y) and vice versa and you will get the same value.
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html