Image Region Filtering, Line Fitting

I am actually trying to connect the centroids in the form of a curved line and only want to keep the regions along the line.
Input Binary Image.
labeledImage = labelmatrix(bwconncomp(binaryImage,8));
props = regionprops(labeledImage, 'All');
allCentroids = vertcat(props.Centroid);
% Sort Based on Xs (For Segregation)
allCentroids = sortrows(allCentroids,1);
% Analyse and Filter Outliers Regions
regions_to_keep = ???? % How should I approach ? I may have to set various if-else checks. Please guide me through.
% Desired Output Images are also attached.
binaryImage = ismember(labeledImage, find(regions_to_keep));
The Centroids and Line (OUTPUT):
  1. Here I am coming across a problem in which false regions are joined with the vertebral column. How to get rid of this problem?
The Desired Output?
  1. So far I have manually done this Image, as a last resort I am planning to call for user input and select/reject the regions based on user input.
So, in summary, I am facing the difficulty as follows:-
  1. Plotting the Curved Line Across Centroids (ONLY ALONG THE VERTERBAL COLUMN)
  2. False Regions merging into the Vertebral Column.
Any Help!
Regards

6 commentaires

Rao Farhat Masood forgot that Google keeps a cache of webpages, so deleting his question is pointless (permalink to archived copy). I didn't go to the trouble of re-posting the images, but they are available in the Wayback Machine link. If people with editing privileges want to add them: feel free to edit this comment and remove this sentence.
Original question:
I am actually trying to connect the centroids in the form of a curved line and only want to keep the regions along the line.
% Input Binary Image.
labeledImage = labelmatrix(bwconncomp(binaryImage,8));
props = regionprops(labeledImage, 'All');
allCentroids = vertcat(props.Centroid);
% Sort Based on Xs (For Segregation)
allCentroids = sortrows(allCentroids,1);
% Analyse and Filter Outliers Regions
regions_to_keep = ???? % How should I approach ? I may have to set various if-else checks. Please guide me through.
% Desired Output Images are also attached.
binaryImage = ismember(labeledImage, find(regions_to_keep));
The Centroids and Line (OUTPUT):
  1. Here I am coming across a problem in which false regions are joined with the vertebral column. How to get rid of this problem?
The Desired Output?
  1. So far I have manually done this Image, as a last resort I am planning to call for user input and select/reject the regions based on user input.
So, in summary, I am facing the difficulty as follows:-
  1. Plotting the Curved Line Across Centroids (ONLY ALONG THE VERTERBAL COLUMN)
  2. False Regions merging into the Vertebral Column.
Any Help!
Regards
RFM
RFM le 19 Sep 2020
Yes I had the intent to delete the question because it was not the desired/accepted answer. Even though if you want me to repost the question so that you (Rik) may post the answer instead, gladly will do it.
Walter Roberson
Walter Roberson le 19 Sep 2020
You posted a question, you got a sincere attempt to assist you in response. It might not have been the complete code you were hoping for, but a volunteer did take the time to look information up for you, and the question and answer deserve to stay out of respect for their efforts.
RFM
RFM le 19 Sep 2020
Yes agreed.
RFM
RFM le 19 Sep 2020
The only idea was to address the issue using Conventional Image Segmentation and avoiding SegNet, since the response was suggesting SegNet therefore, I thought it would be an inappropriate question.
Image Analyst
Image Analyst le 19 Sep 2020
Many of the papers published in the link were before Deep Learning was invented and will use conventional/traditional methods. Like Walter says, no one here has exact code to hand over to you, and there is no Vertebra Toolbox offered by MATLAB, so you'll have to do some research and write it yourself. Good luck though.

Connectez-vous pour commenter.

Réponses (1)

Image Analyst
Image Analyst le 8 Sep 2020

0 votes

Check pubmed or vision bibliography to find papers discussing segmentation of vertebrae. I know there will be some there.

1 commentaire

Image Analyst
Image Analyst le 8 Sep 2020
Modifié(e) : Image Analyst le 8 Sep 2020
I'm really surprised that no one has been ever able to solve this and publish it. If experts who were working for years on it were unsuccessful, then there's no way I'll be able to come up with a solution, or even a plan for one, for you in just a few minutes. Sorry, but good luck.
I'd suggest you try deep learning and use segnet. We've done that in some situations like that.

Connectez-vous pour commenter.

Question posée :

RFM
le 4 Sep 2020

Commenté :

le 19 Sep 2020

Community Treasure Hunt

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

Start Hunting!

Translated by