Skip to content

Commit

Permalink
Update io_writerda.m
Browse files Browse the repository at this point in the history
Fix RDA writing error (data points were not ordered correctly).
  • Loading branch information
schorschinho committed Apr 28, 2022
1 parent 012cde4 commit 0bd363c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libraries/FID-A/inputOutput/io_writerda.m
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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);

0 comments on commit 0bd363c

Please sign in to comment.