How to command the Gradient Weight

1 view (last 30 days)
mohd akmal masud
mohd akmal masud on 2 May 2021
Hi All, I've 83 frame image dicom. I try do the gradient weight segmentation.
But why only just one frame appear (as image attached)?
I Supposely the function imshow3D will show all the 83 frame as well.
Anyone can help me?
% Get a list of all files in the folder with the desired file name pattern.
myFolder = ('C:\Users\Akmal\Downloads\IQ NEMA GA68 51 (1)\2020-12__Studies\IQ NEMA GA68 5.1_IQ NEMA GA68 5.1_PT_2020-12-02_114711_SPINE_PET.PELVIS.DYN.Q600_n83__00000');
filePattern = fullfile(myFolder, '*.dcm'); % Change to whatever pattern you need.
theFiles = dir(filePattern);
for L = 1 : length(theFiles)
baseFileName = theFiles(L).name;
fullFileName = fullfile(theFiles(L).folder, baseFileName);
fprintf(1, 'Now reading %s\n', fullFileName);
% Now do whatever you want with this file name,
% such as reading it in as an image array with imread()
RZ(:,:,L) = dicomread(fullFileName);
end
sigma = 1.5;
W = gradientweight(RZ(:,:,L), sigma, 'RolloffFactor', 0.01, 'WeightCutoff', 1);
R = 149; C = 138;
hold on;
plot(C, R, 'r.', 'LineWidth', 1.5, 'MarkerSize',15);
title('Original Image with Seed Location')
thresh = 0.009;
[BW, D] = imsegfmm(W, C, R, thresh);
figure, imshow3D(BW)
title('Segmented Image')
hold on;
plot(C, R, 'r.', 'LineWidth', 1.5, 'MarkerSize',15);

Answers (0)

Categories

Find more on Images in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!