Clear Filters
Clear Filters

How to write a sequence of dicom file ?

1 view (last 30 days)
I have a matrix of size 262144x234. I have reshaped this matrix into 512x512x234. Now I want to write this sequence of 243 matrices into a dicom file. Such that I can use it for view on ITK-Snap software.
IMin0=reshape(IMin0,512,[],234);
dicomwrite(IMin0,'original.dcm');

Accepted Answer

Stephen23
Stephen23 on 28 Feb 2018
Edited: Stephen23 on 28 Feb 2018
IMin0 = reshape(IMin0,512,512,234);
for k = 1:size(IMin0,3)
fnm = sprintf('file_%d.dcm',k);
dicomwrite(IMin0(:,:,k),fnm)
end
See also:
  1 Comment
Prasad Gianluca Colombage Fernando
Hi it's very good your code;do you how do I create a series DICOM after modifying it's HU ?

Sign in to comment.

More Answers (0)

Categories

Find more on DICOM Format in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!