12345678910111213141516171819202122232425262728293031323334353637383940 |
- %% Author: Aleks Prša
- % Date: May, 2022
- % alex.prsa@gmail.com
- % =========================================================================
- %{
- % -------------------------------------------------------------------------
- % writeDcmProj(dataProj,filestring,parameter)
- % -------------------------------------------------------------------------
- % DESCRIPTION:
- % This function write a set of Dicom images with respective headers.
- %
- %
- % INPUT:
- % - dataProj = Projection images
- % - filestring = Path to save
- % - parameter = Parameter of all geometry
- %
- % ---------------------------------------------------------------------
- %}
- % =========================================================================
- %% Write Dicom images
- function writeDcm(dataProj,filestring,parameter)
- for k=1:size(dataProj,3)
- dataProj = uint16(dataProj);
- end
- % Write dicom files in respective folder
- fprintf('%3d/%3d', 1, parameter.nProj)
- for i=1:size(dataProj,3)
- fprintf('\b\b\b\b\b\b\b%3d/%3d', i, parameter.nProj)
- if(i<10)
- fileimg = [filestring,filesep,'0',num2str(i),'.dcm'];
- else
- fileimg = [filestring,filesep,num2str(i),'.dcm'];
- end
- dicomwrite(dataProj(:,:,i), fileimg);
- end
- end
|