From 0bd363c43727534e551134c950b4e4e3f563ca20 Mon Sep 17 00:00:00 2001 From: Georg Oeltzschner Date: Thu, 28 Apr 2022 12:13:57 -0400 Subject: [PATCH] Update io_writerda.m Fix RDA writing error (data points were not ordered correctly). --- libraries/FID-A/inputOutput/io_writerda.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/FID-A/inputOutput/io_writerda.m b/libraries/FID-A/inputOutput/io_writerda.m index 95708ec5..0c288686 100644 --- a/libraries/FID-A/inputOutput/io_writerda.m +++ b/libraries/FID-A/inputOutput/io_writerda.m @@ -43,12 +43,13 @@ reshape_data = reshape(fids, [1 in.sz(1) in.sz(2) in.sz(3)]); end data=[real(reshape_data);-imag(reshape_data)]; +data_toWrite = reshape(data, [2*length(data) 1]); %% Create RDA file % Open a file with the designated name, and write the header information sparFile = [outfile '.RDA']; -fid = fopen(sparFile,'wt+'); +fid = fopen(sparFile,'w+'); fprintf(fid,'>>> Begin of header <<<\r\n'); fprintf(fid,'PatientName: \r\n'); fprintf(fid,'PatientID: \r\n'); @@ -132,5 +133,5 @@ fprintf(fid,'PixelSpacingCol: 0\r\n'); % to read into extra Siemens parameter field fprintf(fid,'PixelSpacing3D: 0\r\n'); % to read into extra Siemens parameter field fprintf(fid,'>>> End of header <<<\r\n'); -fwrite(fid,data,'double'); +fwrite(fid,data_toWrite,'double'); fclose(fid); \ No newline at end of file