Creating binary 3D mask from MR volume
21 views (last 30 days)
Show older comments
Hello All,
I am trying to create a 3D binary mask for MR head volume. The image has 0 intensity for background and the tissue inside the image has integers. Morphological operations provide me very noisy output.

This is after bwconncomp, thresholding and imerode options.
Are there better ways to get volumetric masks?
Answers (2)
Mrutyunjaya Hiremath
on 27 Apr 2020
Hello banikr,
I think this is what you want ... if I am not wrong.
load mri;
% load mriVolume; %3D MRI data with data variable name 'mriVolume'
mriVolume = D;
% Assuming background pixels are 0
bwMask = false(size(mriVolume));
pixIndex = find(mriVolume > 0);
bwMask(pixIndex) = 1;
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!