フィルターのクリア

Why it comes up with only the first slice all the time?

1 回表示 (過去 30 日間)
Stelios Fanourakis
Stelios Fanourakis 2017 年 12 月 7 日
コメント済み: Stelios Fanourakis 2017 年 12 月 7 日
I have 5 MRI images and need to load and stack them. I use the code below. It comes up with the first slice/image under 5 times. It does not load the 4 remaining images. Only the first image by 5 times. What to do?
clc; clear all; close all;
N=5; img_dir ='D:\Stelios PhD files'
strfile = 'Z01'; img = dicomread(fullfile(img_dir, strfile)); siz_img = size(img);
% create result matrix: D = NaN([siz_img N]); D(:,:,1) = img;
% load all the remaining images and put them in the matrix for i=1:N strfile = sprintf('Z01',i); D(:,:,i)= dicomread(fullfile(img_dir, strfile)); end
D=squeeze(D);
Ds=smooth3(D);

採用された回答

KL
KL 2017 年 12 月 7 日
編集済み: KL 2017 年 12 月 7 日
Probably you intended to write,
sprintf('Z0%d',i);
instead of
sprintf('Z01',i); %the outout here is always Z01
  1 件のコメント
Stelios Fanourakis
Stelios Fanourakis 2017 年 12 月 7 日
Yeahp! That was it. Thanks a lot!!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDICOM Format についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by