how to calculate maximum, minimum dose in some specific region.
Show older comments
Dear All
i want to make GUI it will work as we contoure some region of interest in the patient CT in Pinnacle treatment planning system and then calculate the dose and find mean maximum dose in that region.
But i have a image file and a dose file. i want to use these to calculate the maximum, minimum, and mean doses inside the contour region. i want to make contoure in the image and use that in dose to find the dose in that region and calculate maximum, minimum, and mean dose in that region.
till now, i made a GUI i can open a image (there are 55 image Slices, i can open one at a time) on the axis then i can contour by imfreehand. i thoght if i have the all x,y cooridnates inside the region then i will find these coordinate in the dose file which is in excel for the same slice to calculate the mean maximum doses but it vain. please find some time and help me.
regards Muhammad
Answers (1)
Image Analyst
on 24 Sep 2013
Once you draw the mask and use .CreateMask to get your binary image, you can get the x,y coordinates from find()
[rows, columns] = find(binaryImage); % [y,x], not (x,y) because rows = y.
Then call xlsread() to read in the x,y coordinates from your workbook and find the max.
7 Comments
Muhammad
on 24 Sep 2013
Image Analyst
on 24 Sep 2013
So what does the worksheet look like? Is is a long list of (x,y,dose) values in 3 columns and thousands of rows?
Muhammad
on 24 Sep 2013
Muhammad
on 24 Sep 2013
Image Analyst
on 24 Sep 2013
OK so read it in as a 2D array of numbers, called dose. Then convert your binary image to dose like this:
doseImage = zeros(size(binaryImage)); % Preallocate dose image.
doseImage(binaryImage) = dose(binaryImage);
This assumes that your dose array in the workbook corresponds column for column and row for row with your image.
Muhammad
on 24 Sep 2013
Image Analyst
on 24 Sep 2013
You can use the .createMask method to create a binary image directly, instead of using poly2mask, as shown in the attached demo below.
But I'm not sure how the image and the mask you draw on it is related to the table of dose numbers in the workbook, and what you want as a final output.
Categories
Find more on Live Scripts and Functions in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!