Code covered by the BSD License  

Highlights from
Mia 2.4

image thumbnail

Mia 2.4

by

 

02 Apr 2004 (Updated )

Medical Image Analysis GUI.

savedcm(outputfilename,imaVOL,scaninfo)
function wresult = savedcm(outputfilename,imaVOL,scaninfo)
% function wresult = savedcm(outputfilename,imaVOL,scaninfo)
%
% Matlab function to save dcm format output file. 
% The function use the Matlab dicomrwrite procedure.
%
% Matlab library function for MIA_gui utility. 
% University of Debrecen, PET Center/LB 2003

wresult = -1;

if scaninfo.Frames > 1
    hm = msgbox('Dynamic file cannot be saved.','MIA Info' );
    wresult = 0;
    return;
end

hm = msgbox('Dicom saving...','MIA Info' );
maxVOL = max(imaVOL(:));
if (round(double(maxVOL)) ~= maxVOL)%if imaVOL float
    imaout = uint16(reshape(imaVOL,[scaninfo.imfm 1 scaninfo.num_of_slice]));
    disp('Warning!');
    disp('The image type is float. SAVEDCM converts it to UINT16 for saving. Take care!');
    disp('');
else
    imaout = reshape(imaVOL,[scaninfo.imfm 1 scaninfo.num_of_slice]);
end
status = dicomwrite(imaout,outputfilename,'ObjectType','MR Image Storage', ...
    'PixelSpacing',scaninfo.pixsize(1:2)','SliceThickness',scaninfo.pixsize(3), ...
    'NumberOfSlices',scaninfo.num_of_slice);
delete(hm);
wresult = 0;

Contact us