How can I mark voxels inside of an ROI with a class label?
1 view (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
Matt J
on 13 Dec 2015
Edited: Matt J
on 13 Dec 2015
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 Comments
Matt J
on 14 Dec 2015
Edited: Matt J
on 14 Dec 2015
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.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!