How can I mark voxels inside of an ROI with a class label?

1 次查看(过去 30 天)
Hi, I have medical knee MRIs with dicom format. I am going to apply a machine learning algorithm to classify voxels; however, I don't have any training set to train the classifier. I have sequences of MRI for each patient that an ROI has been extracted in each slice by expert (as ground truth). My idea is to label voxels inside of ROI as one class, and outside of ROI as another class to create the training set. Does anyone know how can I add a class label (attribute) to voxels inside of ROI as a class(1) and outside of ROI as background class(0)? Or my idea isn't correct!? How can i create my train set for classification? IS there any code that can label the voxels inside of an ROI as 1 and outside as 0? Your help is appreciated.

回答(1 个)

Matt J
Matt J 2015-12-13
编辑:Matt J 2015-12-13
It depends on what form the ROI exists in now, i.e, what data do you currently possess about the ROI's size, shape, and location within the image? If you had used an IMROI object, it would be very easy. You would just use its createMask() method.
  2 个评论
Sara Salimi
Sara Salimi 2015-12-14
编辑:Sara Salimi 2015-12-14
Dear Matt J,
Many thanks for your help. yes I have also an excel file of the points of ROI of sequences of ROI for each patient I have attached one text file that is related to the image that I have attached. Is it possible I extract a column which indicates the class of voxels (as 1/0)? I am beginner in MATLAB, and I will be thankful if you guide me.
Once again Thanks a lot for your help.
Matt J
Matt J 2015-12-14
编辑:Matt J 2015-12-14
You can use xlsread() to read in the point coordinates from the excel file. Once you have the coordinates as vectors I and J you can create a binary map of the ROI pixels by doing
map=full(sparse(I,J,1,m,n);
where [m,n] is the size of the image. Or, you can omit full() and save memory by keeping the map in sparse form.

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by