Clear Filters
Clear Filters

How to determine the midline in brain images.

5 views (last 30 days)
sheep
sheep on 6 Sep 2024 at 12:53
Answered: Image Analyst on 6 Sep 2024 at 13:40
Same as the title, I want to determine this

Answers (2)

Shreeya
Shreeya on 6 Sep 2024 at 13:01
Edited: Shreeya on 6 Sep 2024 at 13:03
Hi
According to my understanding, you want to determine the midline in a binarized brain image. You can follow the below mentioned steps to achieve this:
  1. Use the "bwconvhull" function. This function calculates the smallest convex polygon that encompasses all the objects present in the binary image.
  2. Utilize the "regionprops" function to extract the centroid and orientation of the convex hull.
  3. Fit a line through the centroid which has a slope equal to the tangent of the orientation obtained from the "regionprops" function.
  4. Using the slope and centroid coordinates, generate a set of ‘x’ values and calculate the corresponding ‘y’ values for the line equation.
  5. Further, ‘rasterization’ is performed to determine the pixels covered by the line. To perform ‘rasterization’, the code segment utilizes Bresenham's line algorithm. This algorithm calculates the coordinates of the pixels that the line passes through. The starting and ending points of the line are provided as input.
  6. The resulting pixel coordinates are then used to update the corresponding pixels in the binary image matrix. The value of these pixels is set to 1, indicating that they are part of the line.
  7. Display the updated binary image using the "imshow" functiion.
Refer to the following links to learn more about the "bwconvhull" and "regionprops" and Bresenham's algorithm respectively.

Image Analyst
Image Analyst on 6 Sep 2024 at 13:40
Hard for us to say, don't you think, without seeing an image? What is the midline? Is it just the geometric midline as determined by the skull? Or do you want to find it based on the brain hemispheres internal to the skull boundary? Or are they always guaranteed to be the same?
If you have any more questions, then attach your image with the image or paperclip icon after you read this:

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!