How to compare contours?

Technical Source
2 min readJan 2, 2024

--

This is a matrix of dose_data for a piece of radiographic film I have irradiated, and respective x and y coordinates for the film.

I can plot specific dose lines (11Gy,12.1Gy), and then plot a circle (representing a tumour) centre 0,0 and radius 5.

contour(col_scale,row_scale,dose_data,[11,12.1]);

hold on;

ROI1= drawcircle(‘Center’,[0,0],’Radius’,5,’StripeColor’,’red’);

I would like to be able to compare for example the 11Gy isodose line and the circle (tumour) to see how well it was irradiated. For example getting a DSC or % area of circle covered by the 11Gy dose contour. I have tried different Matlab functions but my data is not in the correct data type/format. Any advice on how to do this would be much appreciated.

NOTE:-

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help , Finance Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

To what I understand. There maybe other ways to achieve desired results:

To compare the 11 Gy isodose line with the tumour circle (ROI) and compute metrics like the Dice Similarity Coefficient (DSC) or the percentage of the circle covered by the 11 Gy dose contour, you’ll need to perform several steps. First, you’ll need to create binary masks of the isodose line and the circle, then compare these masks.

  • Create a Grid: Use meshgrid to create a grid of x and y coordinates corresponding to your dose_data matrix.
  • Generate Binary Masks: Create binary masks where the pixels within the 11 Gy isodose line and within the tumour circle are 1, and all other pixels are 0.
  • Calculate the Intersection: Find the intersection of the binary masks to see which pixels are within both the isodose line and the circle.
  • Calculate the DSC: The DSC is calculated as 2 * (|A ∩ B|) / (|A| + |B|), where A and B are the binary masks of the two regions, and |A ∩ B| is the count of pixels in the intersection.
  • Calculate the Percentage Area Covered: The percentage of the circle covered by the 11 Gy dose contour is the number of pixels in the intersection divided by the number of pixels in the circle mask.

SEE COMPLETE ANSWER CLICK THE LINK

--

--

Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.