## How can i use coordinates to find dose from dose file which is in excel in MATLAB

on 25 Sep 2013
Hi All
Hope you all are very good. i am a new babie in MATLAB world but learning very well. i am working in medical physics field. i have 55 jpg images and every image has its dose file which is in excel. i made a GUI. the aim of work is to calculate the mean, maximum doses inside the contour region.
what i have done:
Now, first i open the jpg image then i zoom the image then i contour the zoom image by imfreehand and used poly2mask and use find to calculate the coordinates inside the contoured region. i can find these [Y,X] coordinates on a excel sheet but i dont need a excel sheet, i need these should be on a table. i dont know what unit these [Y,X] have but the 3rd coodinate is Z (Z will be the thickness of the image??) is in centimeter (cm). then how can i change this to the same coodinate as [Y,X] have. this cxecl file contains 2 columns [Y,X] and have lot of rows depending on the contour region.
Problem (Question) i want to calculate the dose of these [Y,X,Z] coodinates using that dose file which is in excel and one excel sheet contaions 127 rows,127 columns and 55 excel sheets for every image.How can i do this? if i do this then i will caclulate the maximum, median, mean doses in that region. dimension of dose file are also different from the [Y,X,Z]. Hope for a positive and early and explained answer. Help is appreciated in advance.

dpb

### dpb (view profile)

on 25 Sep 2013
Need more specifics on the problem to have any detailed answers.
A) To change coordinates, a scale factor is multiplicative but obviously unless you know what the resolution/size of the image you don't know how to turn the pixel spacing into an absolute dimension. In many image formats this information is in the header; one would presume it is somewhere in your data to make it useful.
B) It's simple enough to read an Excel file; what to do with it which is the brunt of your question is unspecified. How would you do it by hand for a small sample image small enough that that would be practical? Implement that algorithm/process in Matlab and you're done. :)
Provide a very short set of sample data and the above inputs and the desired results and then folks can see enough to have a way to be helpful.

on 25 Sep 2013
A)i have a voxel size 0.09 cm for X and Y and 0.18cm for Z, can i use these?these are given in the header of file.
B) i contoured some region of image and get coodinates [Yi,Xi]. i have dose file which is in excel (127rows, 127columns)for the same image. i want to use the coordinates [Yi,Xi] and go to the dose file and take the doses at these coodinates.
in other words when i have coordinates, i will go to the dose file and see the doses at at each voxel.
dpb

### dpb (view profile)

on 25 Sep 2013
That would then seem to be the resolution, yes. Does it make sense physically if use those values likely is enough by which to judge the quality of the answer.
You can use 'logical addressing' or find to locate values in the Excel file based on other values you've selected. Note, however, that you'll likely need to use a tolerance on the equality expression rather than exact comparison since your values appear to be floating point. SOTOO
find(abs(x-xExcel)<=eps)
where x is one of your variables and xExcel is the corresponding variable in the Excel file of interest (after you've read it in to Matlab, of course).