DICOM(動画データ)から静止画の取り出し
    2 views (last 30 days)
  
       Show older comments
    
    Atsuhiko Ninomiya
 on 2 Feb 2023
  
    
    
    
    
    Commented: Atsuhiko Ninomiya
 on 3 Feb 2023
            検査動画に関するDICOMデータ(x.dcm)があります.
動画データですので,一連の静止画の stack と考えております.この x.dcm から,1枚ごとの静止画の DICOMデータを作成したいと思います.この検査動画のDICOMデータは,4-D uint16 でした.
動画データ x.dcm → 静止画データ 1.dcm, 2.dcm, ・・・, n.dcm
を作成する方法をご教示ください.よろしくお願いいたします.
0 Comments
Accepted Answer
  Atsushi Ueno
      
 on 3 Feb 2023
        % dicomwrite(dicomreadVolume(fullfile(matlabroot,"toolbox","images","imdata","dog")),'x.dcm'); % サンプルデータ
X = dicomread("x.dcm"); % 検査動画に関するDICOMデータを読み込む
for k = 1:size(X,4)
    dicomwrite(X(:,:,:,k), k+".dcm"); % 静止画データ 1.dcm, 2.dcm, ・・・, n.dcm を書き込んでいく
end
% montage(X,'DisplayRange',[]);   % 表示確認用
% imshow(dicomread("12.dcm"),[]); % 表示確認用
2 Comments
  Atsushi Ueno
      
 on 3 Feb 2023
				for 文使ったら負けシリーズ(殆ど何も変わらない)
X = dicomread("x.dcm");
num = 1:size(X,4);
arrayfun(@(idx,filename) dicomwrite(X(:,:,:,idx),filename), num, num + ".dcm");
More Answers (0)
See Also
Categories
				Find more on DICOM Format in Help Center and File Exchange
			
	Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!