Creating Concentric Bands from ROI

5 vues (au cours des 30 derniers jours)
Jasmyn Benavides
Jasmyn Benavides le 9 Oct 2019
Commenté : Walter Roberson le 15 Oct 2019
Hi,
I'm currently trying to develop a code that can create concentric bands (preferably 2 or 3) based on the shape of the user-defined ROI. The ROI has to be hand-drawn since the object of interest varies in shape for different images. Is there any way to implement this without the use of premade ROI shapes (like instead of using concentric bands from drawellipse or drawrectangle).
An example of what I'm trying to do is shown in the image (where the black blob is the object of interest, the original ROI drawn by the user is the black outline, and each red band is a concentric band that is of equal distance from the ROI). Any help would be GREATLY appreciated.

Réponses (1)

Walter Roberson
Walter Roberson le 9 Oct 2019
Create an array that all true (or which is all true outside the ROI boundary including the boundary). Create another array that is true at the ROI boundary. Use bwdistgeodesic() . Now you can trace contours in the distance information returned.
Note: this will not work if you need strict euclidean distances to the boundaries.
  2 commentaires
Jasmyn Benavides
Jasmyn Benavides le 15 Oct 2019
Thank you for suggesting bwdistgeodesic(), but after playing around with the function call it seems to just turn everything in the image into B/W, rather than creating another ROI from the original shape. Do you happen to have any insight as to why it does that?
Walter Roberson
Walter Roberson le 15 Oct 2019
"Now you can trace contours in the distance information returned."
The return would be an array of distances. Distances <= band_distance and trace the outside to get the boundary for that distance, or use contour() to create a contour matrix. There are routines in the File Exchange that convert contour matrix into rois.

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by