how to stack 3D images from 2D images after semantic function.

1 ビュー (過去 30 日間)
mohd akmal masud
mohd akmal masud 2021 年 9 月 23 日
回答済み: yanqi liu 2021 年 9 月 26 日
Hi all, I have 2D images. then I used semantic program that have network build from U-Net deep learning.
after I segment the volume, I wrote this coding below to view as 3D stack the binary images. but only first images appear. Anyone can help me?
filePattern = fullfile('C:\Users\Akmal\Desktop\I-131 256 28.02.2020\I-131 SPECT NEMA VALIDATION 01112019 256X256\testimages', '*.png');
IMDS = imageDatastore(filePattern);
fileList = dir(filePattern)
numFiles = length(fileList);
image3d = zeros(256, 256, numFiles, 'uint8');
for k = 16 : 35
fullFileName = fullfile(fileList(k).folder, fileList(k).name);
thisImage = imread(fullFileName);
image3d(:, :, k) = thisImage;
end
[C,scores] = semanticseg((image3d(:, :, k)),net1);
outt2=C=="foreground";
st2=strel('disk',0);
outt22=imopen(outt2,st2);
imshow3D( outt22);

採用された回答

yanqi liu
yanqi liu 2021 年 9 月 26 日
please use size(outt2) to check the dim

その他の回答 (1 件)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021 年 9 月 23 日
There is a small err in the code. Here is the corrected part of it:
for k = 1:numFiles % Starts at 1
fullFileName = fullfile(fileList(k).folder, fileList(k).name);
thisImage = imread(fullFileName);
image3d(:, :, k) = thisImage;
end
  1 件のコメント
mohd akmal masud
mohd akmal masud 2021 年 9 月 23 日
that is not I mean

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by