Skip to content

Commit

Permalink
Add pislquant optional argument
Browse files Browse the repository at this point in the history
On branch tv7
	modified:   writeceq.m
  • Loading branch information
Jon-Fredrik Nielsen committed Jan 26, 2025
1 parent 1dae56f commit 94840e5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions matlab/writeceq.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
function writeceq(ceq, fn)
function writeceq(ceq, fn, varargin)
% function writeceq(ceq, fn)
%
% Options
% pislquant default: 1 number of ADC events at start of scan for setting Rx gain
%
% Write Ceq struct to binary file

% parse optional inputs
arg.pislquant = 1;
arg = vararg_pair(arg, varargin);

fid = fopen(fn, 'wb'); % big endian (network byte order)

fwrite(fid, 47, 'int16'); % for checking endianness when reading
Expand Down Expand Up @@ -40,8 +47,8 @@ function writeceq(ceq, fn)
fwrite(fid, maxGrad, 'float32'); % maxGrad
fwrite(fid, 0.0, 'float32'); % maxSlew
fwrite(fid, ceq.duration, 'float32'); % duration
fwrite(fid, ceq.nReadouts, 'int32'); % total number of ADC events in sequence
fwrite(fid, 10, 'int32'); % number ADC events at start of scan for setting receive gain in Auto Prescan
fwrite(fid, ceq.nReadouts, 'int32'); % total number of ADC events in sequence
fwrite(fid, arg.pislquant, 'int32'); % number ADC events at start of scan for setting receive gain in Auto Prescan

%{
fread(&(ceq->maxRfPower), sizeof(float), 1, fid);
Expand Down

0 comments on commit 94840e5

Please sign in to comment.