How to convert a stack of medical images in the work space into .png without losing information?

2 ビュー (過去 30 日間)
Hi,
I have a stack of medical images that I need to convert them into png or any other image format. It is, for example, 281x389x104 (i.e., 104 images, Width: 281 and Height: 389). The files are in .mhd and .raw format. After reading that, how can I convert each slice into an image format without losing information?
Your help is appreciated
Many thanks

回答 (1 件)

Ahmet Cecen
Ahmet Cecen 2016 年 12 月 29 日
for i = 1:104
currentImage = YourData(:,:,i);
currentFileName = ['YourFileName', num2str(i), '.png'];
imwrite(currentImage,currentFileName);
end
Should work.
  2 件のコメント
Sara Salimi
Sara Salimi 2016 年 12 月 29 日
Thanks for your response, but the output is a blank image. :(
Walter Roberson
Walter Roberson 2016 年 12 月 29 日
Experiment with
currentImage = uint8( YourData(:,:,i) );

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

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by