How to segment image with location wanted.

2 vues (au cours des 30 derniers jours)
mohd akmal masud
mohd akmal masud le 9 Déc 2021
Commenté : yanqi liu le 9 Déc 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')
Should be the image appear like below that I want
Anyone can help me?

Réponse acceptée

yanqi liu
yanqi liu le 9 Déc 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 commentaire
mohd akmal masud
mohd akmal masud le 9 Déc 2021
got error
Error using bwselect
Expected input number 1, BW, to be two-dimensional.
Error in bwselect>ParseInputs (line 262)
validateattributes(BW,{'logical' 'numeric'},{'2d' 'nonsparse'}, ...
Error in bwselect (line 55)
[xdata,ydata,BW,xi,yi,r,c,n,newFig] = ParseInputs(varargin{:});
Error in adaptivethreshold (line 35)
BW = bwselect(BW, round(mean(52: 66)), round(mean(57:76)));

Connectez-vous pour commenter.

Plus de réponses (1)

mohd akmal masud
mohd akmal masud le 9 Déc 2021
I used this one, settled sir. TQ very much
T = adaptthresh(spect, 0.000000001);
%change grey to binary
BW = imbinarize(spect,T);
C = 66;
R = 59;
P = 52;
BW = bwselect3(BW,C,R,P);
%open image
figure
imshow3D(BW)
  1 commentaire
yanqi liu
yanqi liu le 9 Déc 2021
yes,use select can get the target area,in 3D use bwselect3,it is great!

Connectez-vous pour commenter.

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by