I am trying to automate the calculation of each height of the vertebra.
I have bwlabel my binary image so that it labels 1 to 24 from top to bottom.
I have used regionprops the get the centroid and bounding box. I understand that the boundingbox does give the height and width however it does not trully reflect the height of each vertebra as some of them are at an angle. (1st picture)
bwboundaries does give me all the coordinates of the boundaries but how do I use that to find an average of height of each of the vertebra? (2nd picture)
Or is there a way to run through the image in a way that I can get 3 coordinates from the top and the bottom end plate of the vertebrae respectively, find the average height and perhaps draw a line through the 3 coordinates?
My end goal is to be able to find the height and draw a line through the top and bottom end plate of each vertebrae if possible like the image below.