How to segment image with location wanted.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
mohd akmal masud
el 9 de Dic. de 2021
Comentada: yanqi liu
el 9 de Dic. de 2021
Hi Everyone. I Have Code below. But the image look like unwanted segmentation. Because I just want the volume that in red circle only. I just write the location that I want, but result stil same.
clc
clear all
[spect map]=dicomread('ArifSyazwan.dcm');
info = dicominfo('ArifSyazwan.dcm');
%gp=info.SliceThickness;
spect=(squeeze(spect));%smooth3
aa=size(spect);aa=aa(3);
imshow3D(spect);
T = adaptthresh(spect, 0.000000001);
%change grey to binary
BW = imbinarize(spect,T);
%open image
figure
imshow3D(BW(56:65, 72: 62)); % which is the location that we want
% CC = bwconncomp(BW);
% [r, c] = cellfun(@(x) ind2sub(size(BW), x), CC.PixelIdxList, 'UniformOutput', 0);
data = regionprops('table', BW,'Area','Centroid')
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/827985/image.jpeg)
Should be the image appear like below that I want
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/827990/image.jpeg)
Anyone can help me?
0 comentarios
Respuesta aceptada
yanqi liu
el 9 de Dic. de 2021
yes,sir,may be uload ArifSyazwan.dcm to do some analysis,such as
clc
clear all
[spect map]=dicomread('ArifSyazwan.dcm');
info = dicominfo('ArifSyazwan.dcm');
%gp=info.SliceThickness;
spect=(squeeze(spect));%smooth3
aa=size(spect);aa=aa(3);
imshow3D(spect);
T = adaptthresh(spect, 0.000000001);
%change grey to binary
BW = imbinarize(spect,T);
BW = bwselect(BW, round(mean(72: 62)), round(mean(56:65)));
%open image
figure
imshow3D(BW); % which is the location that we want
% CC = bwconncomp(BW);
% [r, c] = cellfun(@(x) ind2sub(size(BW), x), CC.PixelIdxList, 'UniformOutput', 0);
data = regionprops('table', BW,'Area','Centroid')
1 comentario
Más respuestas (1)
mohd akmal masud
el 9 de Dic. de 2021
1 comentario
yanqi liu
el 9 de Dic. de 2021
yes,use select can get the target area,in 3D use bwselect3,it is great!
Ver también
Categorías
Más información sobre Image Segmentation and Analysis en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!