Is there a way to change order of dicoms?

1 回表示 (過去 30 日間)
sc
sc 2018 年 4 月 26 日
再開済み: Jan 2018 年 5 月 11 日
Hi! I'm creating a code with Matlab to import and process dicoms.
I'd like to load images and I tried to do this with function 'dicomread' and it works, but I'd like change order of images.
For example: if images go from number 1 to 50, the code will load images from 50 to 1, with order (input) that is given by user. Is it possible?
  1 件のコメント
Rik
Rik 2018 年 4 月 26 日
That is just a matter of how you make your code. dicomread works on a file by file basis, so it's your choice in what order you read them.

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

採用された回答

Jan
Jan 2018 年 4 月 26 日
編集済み: Jan 2018 年 4 月 26 日
X = dicomread(filename);
X = X(:, :, :, size(X, 4):-1:1);
Or maybe:
n = 50;
for k = 1:n
X = dicomread(filename, 'frames', n + 1 - k);
...
end
  2 件のコメント
sc
sc 2018 年 4 月 26 日
編集済み: sc 2018 年 4 月 26 日
I'd like to do this according preferences to user. For example: if I have 10 images, I'd like to insert an input that ask to user the order of these images, like
x = [input ('Insert order of images:')];
and this could be: 10 9 8 6 3 2 4 7 5 1
How can I do? Thank you!!
Jan
Jan 2018 年 4 月 26 日
@sc: Did you read my answer and the documentation of dicomread?
x = input ('Insert order of images:'); % No surrounding [ and ]!
Img = dicomread(filename, 'frames', x);

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

その他の回答 (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