123456789101112131415161718192021222324252627282930313233343536373839404142 |
- %% Author: Aleks Prša
- % Date: May, 2022
- % alex.prsa@gmail.com
- % =========================================================================
- %{
- % -------------------------------------------------------------------------
- % writeDicomProj(dataProj,infoDicom,filestring,parameter)
- % -------------------------------------------------------------------------
- % DESCRIPTION:
- % This function write a set of Dicom images with respective headers.
- %
- %
- % INPUT:
- % - dataProj = Projection images
- % - infoDicomProjs = Dicom header from projections
- % - filestring = Path to save
- % - parameter = Parameter of all geometry
- %
- % ---------------------------------------------------------------------
- %}
- % =========================================================================
- %% Write Dicom images
- function writeDicomProj(dataProj,infoDicom,filestring,parameter)
- for k=1:size(dataProj,3)
- dataProj = 65535*mat2gray(dataProj);
- 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, infoDicom(:,1), 'CreateMode', 'copy');
- end
- end
|