Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[codespell]
skip = .git,*.pdf,*.svg
# some abbreviated citations etc
ignore-regex = .*Reson\. Ser.*
ignore-words-list = te,fo,nd,maked,datas,iten,itel,tread
22 changes: 22 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Codespell

on:
push:
branches: [master]
pull_request:
branches: [master]

permissions:
contents: read

jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
- name: Codespell
uses: codespell-project/actions-codespell@v2
4 changes: 2 additions & 2 deletions doc/doxy.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ HTML_STYLESHEET =
# user-defined cascading style sheet that is included after the standard
# style sheets created by doxygen. Using this option one can overrule
# certain style aspects. This is preferred over using HTML_STYLESHEET
# since it does not replace the standard style sheet and is therefor more
# since it does not replace the standard style sheet and is therefore more
# robust against future updates. Doxygen will copy the style sheet file to
# the output directory.

Expand Down Expand Up @@ -1679,7 +1679,7 @@ UML_LOOK = NO
# the class node. If there are many fields or methods and many nodes the
# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS
# threshold limits the number of items for each type to make the size more
# managable. Set this to 0 for no limit. Note that the threshold may be
# manageable. Set this to 0 for no limit. Note that the threshold may be
# exceeded by 50% before the limit is enforced.

UML_LIMIT_NUM_FIELDS = 10
Expand Down
4 changes: 2 additions & 2 deletions doc/seqcode.sty
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%% This is file `seqcode.sty'
%%
%% It is supposed to help you easily include MATLAB source code
%% into LaTeX document, but have it nicely highlighted, unsing
%% into LaTeX document, but have it nicely highlighted, using
%% the great listings package.
%%
%% Usage: Include your MATLAB source code by using
Expand Down Expand Up @@ -136,7 +136,7 @@
linewidth={\textwidth}
}

\ifbw % use font formating and gray 'colors'
\ifbw % use font formatting and gray 'colors'
\newcommand\keywordcolor{\bfseries}
\lstset{language=matlabfloz, % use our version of highlighting
keywordstyle=\bfseries, % keywords in bold
Expand Down
32 changes: 16 additions & 16 deletions matlab/+mr/@Sequence/Sequence.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
rfLibrary; % Library of RF events
gradLibrary; % Library of gradient events
adcLibrary; % Library of ADC readouts
trigLibrary; % Library of trigger events ( referenced from the extentions library )
trigLibrary; % Library of trigger events ( referenced from the extensions library )
labelsetLibrary; % Library of Label(set) events ( reference from the extensions library )
labelincLibrary; % Library of Label(inc) events ( reference from the extensions library )
extensionLibrary; % Library of extension events. Extension events form single-linked zero-terminated lists
Expand Down Expand Up @@ -270,7 +270,7 @@ function setDefinition(seqObj,key,val)
function addBlock(obj,varargin)
%addBlock Add a new block to the sequence.
% addBlock(obj, blockStruct) Adds a sequence block with
% provided as a block struture
% provided as a block structure
%
% addBlock(obj, e1, e2, ...) Adds a block with multiple
% events e1, e2, etc.
Expand All @@ -297,7 +297,7 @@ function modGradAxis(obj,axis,modifier)
allGradEvents = paren2(vertcat(obj.blockEvents{:}),3:5);

selectedEvents=unique(allGradEvents(:,channelNum));
selectedEvents=selectedEvents(0~=selectedEvents); % elliminate 0
selectedEvents=selectedEvents(0~=selectedEvents); % eliminate 0
otherEvents=unique(allGradEvents(:,otherChans));
assert(isempty(intersect(selectedEvents,otherEvents)),'ERROR: the same gradient event is used on multiple axes, this is not yet supported by modGradAxis()');

Expand Down Expand Up @@ -397,7 +397,7 @@ function flipGradAxis(obj, axis)

function [id shapeIDs]=registerRfEvent(obj, event)
% registerRfEvent Add the event to the libraries (object,
% shapes, etc and retur the event's ID. This I can be stored in
% shapes, etc and return the event's ID. This I can be stored in
% the object to accelerate addBlock()

mag = abs(event.signal);
Expand Down Expand Up @@ -671,7 +671,7 @@ function setBlock(obj, index, varargin)
% key mapping then... The trick is that we rely on the
% sorting of the extension IDs and then we can always find
% the last one in the list by setting the reference to the
% next to 0 and then proceed with the otehr elements.
% next to 0 and then proceed with the other elements.
[~,I]=sort([extensions(:).ref]);
extensions=extensions(I);
all_found=true;
Expand Down Expand Up @@ -729,7 +729,7 @@ function setBlock(obj, index, varargin)
end
end
else
error('Error in block %d: Gradient starting at non-zero value need to be preceded by a comptible gradient', index);
error('Error in block %d: Gradient starting at non-zero value need to be preceded by a compatible gradient', index);
end
else
error('First gradient in the the first block has to start at 0.');
Expand Down Expand Up @@ -951,7 +951,7 @@ function setBlock(obj, index, varargin)
c_excitation=0;
c_refocusing=0;
c_adcSamples=0;
% loop throught the blocks to prepare preallocations
% loop through the blocks to prepare preallocations
for iB=1:length(obj.blockEvents)
block = obj.getBlock(iB);
if ~isempty(block.rf)
Expand Down Expand Up @@ -1024,7 +1024,7 @@ function setBlock(obj, index, varargin)
% ii_next_refocusing = min(length(i_refocusing),ii_next_refocusing+1);
% end
% end
i_periods=sort([1; i_excitation+1; i_refocusing+1; size(gw,2)+1]); % we need thise +1 for compatibility with the above code which prooved to be correct
i_periods=sort([1; i_excitation+1; i_refocusing+1; size(gw,2)+1]); % we need these +1 for compatibility with the above code which proved to be correct
ii_next_excitation=min(length(i_excitation),1);
ii_next_refocusing=min(length(i_refocusing),1);
ktraj=zeros(size(gw));
Expand Down Expand Up @@ -1163,7 +1163,7 @@ function setBlock(obj, index, varargin)
block = obj.getBlock(iB);
isValid = t0+obj.blockDurations(iB)>timeRange(1) && t0<=timeRange(2);
if isValid
if isfield(block,'label') %current labels, works on the curent or next adc
if isfield(block,'label') %current labels, works on the current or next adc
for i=1:length(block.label)
if strcmp(block.label(i).type,'labelinc')
label_store.(block.label(i).label)=...
Expand Down Expand Up @@ -1248,7 +1248,7 @@ function setBlock(obj, index, varargin)
setAxesZoomMotion(h,ax(1),'horizontal');
end

function grad_waveforms=gradient_waveforms1(obj) % currently disfunctional (feature_ExtTrap)
function grad_waveforms=gradient_waveforms1(obj) % currently dysfunctional (feature_ExtTrap)
% gradient_waveforms()
% Decompress the entire gradient waveform
% Returns an array of gradient_axes x timepoints
Expand Down Expand Up @@ -1633,7 +1633,7 @@ function setBlock(obj, index, varargin)
end
gm_pp{i}=fnint(gw_pp{i});
tc{end+1}=gm_pp{i}.breaks;
% "sample" ramps for display purposes otherwise piecewise-linear diplay (plot) fails (looks stupid)
% "sample" ramps for display purposes otherwise piecewise-linear display (plot) fails (looks stupid)
ii=find(abs(gm_pp{i}.coefs(:,1))>eps);
if ~isempty(ii)
tca=cell(1,length(ii));
Expand All @@ -1660,7 +1660,7 @@ function setBlock(obj, index, varargin)
tacc=1e-10; % temporal accuracy
taccinv=1/tacc;
t_ktraj = tacc*unique(round(taccinv*[tc{:}, 0, t_excitation-2*obj.rfRasterTime, t_excitation-obj.rfRasterTime, t_excitation, t_refocusing-obj.rfRasterTime, t_refocusing, t_adc, total_duration]));
% % the "proper" matlab's function ismember() is slow and returns a bool array, but builtin('_ismemberhelper'...) is not compatible accross versions (known not to work on the windows 2021a version)
% % the "proper" matlab's function ismember() is slow and returns a bool array, but builtin('_ismemberhelper'...) is not compatible across versions (known not to work on the windows 2021a version)
%[~,i_excitation]=builtin('_ismemberhelper',tacc*round(taccinv*t_excitation),t_ktraj);
%[~,i_refocusing]=builtin('_ismemberhelper',tacc*round(taccinv*t_refocusing),t_ktraj);
%[~,i_adc]=builtin('_ismemberhelper',tacc*round(taccinv*t_adc),t_ktraj);
Expand Down Expand Up @@ -1754,7 +1754,7 @@ function setBlock(obj, index, varargin)
% filter like we did it in the gradient music project
%b = fir1(40, 10000/sample_rate);
%sound_data = filter(b, 1, sound_data,[],2);
% use Gaussian convolution instead to supress ringing
% use Gaussian convolution instead to suppress ringing
gw=gausswin(round(sample_rate/6000)*2+1);
gw=gw/sum(gw(:));
sound_data(1,:) = conv(sound_data(1,:), gw, 'same');
Expand Down Expand Up @@ -1863,7 +1863,7 @@ function setBlock(obj, index, varargin)
end

function id = getExtensionTypeID(obj, str)
% get numeric ID for the given string extention ID
% get numeric ID for the given string extension ID
% will automatically create a new ID if unknown
num=find(strcmp(obj.extensionStringIDs,str));
if isempty(num)
Expand All @@ -1881,7 +1881,7 @@ function setBlock(obj, index, varargin)
end

function str = getExtensionTypeString(obj, id)
% get numeric ID for the given string extention ID
% get numeric ID for the given string extension ID
% may fail
num=find(obj.extensionNumericIDs==id);
if isempty(num)
Expand All @@ -1891,7 +1891,7 @@ function setBlock(obj, index, varargin)
end

function setExtensionStringAndID(obj, str, id)
% set numeric ID for the given string extention ID
% set numeric ID for the given string extension ID
% may fail if not unique
if any(strcmp(obj.extensionStringIDs,str)) || any(obj.extensionNumericIDs==id)
error('Numeric or String ID is not unique');
Expand Down
4 changes: 2 additions & 2 deletions matlab/+mr/@Sequence/read.m
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ function read(obj,filename,varargin)

% for versions prior to 1.4.0 blockDurations have not been initialized
obj.blockDurations=zeros(1,length(obj.blockEvents));
% scan trhough blocks and calculate durations
% scan through blocks and calculate durations
for iB = 1:length(obj.blockEvents)
b=obj.getBlock(iB);
if delayInd_tmp(iB) > 0
Expand Down Expand Up @@ -497,7 +497,7 @@ function read(obj,filename,varargin)

function nextLine = skipComments(fid, stopBeforeSection)
%skipComments Read lines of skipping blank lines and comments.
% line=skipComments(fid) Read lines from valid file identifer and
% line=skipComments(fid) Read lines from valid file identifier and
% return the next non-comment line.

if (nargin<2)
Expand Down
4 changes: 2 additions & 2 deletions matlab/+mr/addGradients.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%addGradients Superposition of several gradients
%
% [grad] = addGradients(grads, system)
% Returns the superposition of serveral gradients
% Returns the superposition of several gradients
% gradients have to be passed as a cell array e.g. {g1, g2, g3}
%
% See also Sequence.addBlock mr.opts makeTrapezoid
Expand Down Expand Up @@ -114,7 +114,7 @@
for ii = 1:length(grads)
g=grads{ii};
if strcmp(g.type,'trap')
if g.flatTime>0 % trapezoid or triange
if g.flatTime>0 % trapezoid or triangle
g.tt=cumsum([0 g.riseTime g.flatTime g.fallTime]);
g.waveform=[0 g.amplitude g.amplitude 0];
else
Expand Down
2 changes: 1 addition & 1 deletion matlab/+mr/calcDuration.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
% % containing one sample will be zero
% % however, we do not have access to the gradient raster time
% % here, so we opt of a hack, but it will actually fail for the
% % gradint containg one sample...
% % gradint containing one sample...
% % event.t(2) - event.t(1) gives us one gradient raster time
% duration=max(duration, event.t(end) + event.t(2) - event.t(1) + event.delay );
duration=max(duration, event.delay+event.shape_dur); % shaped gradient has now a field called 'shape_dur' because it is impossible to calculate duration here in a general case...
Expand Down
2 changes: 1 addition & 1 deletion matlab/+mr/calcRamp.m
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
%
% 1. Calculate optimal k-space point kopt that would lie on a straight
% line of N=UsePoints evenly spaced points to kend. If this kopt can be
% reached within gradient and slew limts, kopt is the solution of this
% reached within gradient and slew limits, kopt is the solution of this
% function call.
%
% 2. If kopt cannot be reached, calculate the gradient limited point kgl
Expand Down
2 changes: 1 addition & 1 deletion matlab/+mr/calcRfBandwidth.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

tc=mr.calcRfCenter(rf);

% resample the pulse to a resonable time array
% resample the pulse to a reasonable time array
nn=round(1/df/dt);
t=(-floor(nn/2):ceil(nn/2)-1)*dt;

Expand Down
2 changes: 1 addition & 1 deletion matlab/+mr/checkTiming.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
if isnumeric(e) % special handling for blockDuration
continue;
end
assert(isstruct(e), 'wrong format of the variable aguments, list of structures is expected');
assert(isstruct(e), 'wrong format of the variable arguments, list of structures is expected');
ok=true;
if length(e)>1
% for now this is only the case for arrays of extensions, but
Expand Down
2 changes: 1 addition & 1 deletion matlab/+mr/compile_mex.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
%
% The Pulseq toolbox has been designed such that these files are *not*
% necessary to use the toolbox, but if they are present a substantial
% performance improvement can be acheived.
% performance improvement can be achieved.
%
% The script relies on the MATLAB Coder package, available in later
% versions of MATLAB.
Expand Down
2 changes: 1 addition & 1 deletion matlab/+mr/convert.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function out=convert(in,varargin)
%OPTS Set gradient limits of the MR system.
% out=convert(in,from,to) Convert the numerical data in, given in
% specificed units 'from' to units specified in 'to'.
% specified units 'from' to units specified in 'to'.
%
% Valid unit strings are:
% 'Hz/m' 'mT/m' 'rad/ms/mm' 'Hz/m/s' 'mT/m/ms' 'T/m/s' 'rad/ms/mm/ms'
Expand Down
2 changes: 1 addition & 1 deletion matlab/+mr/getSupportedLabels.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function supported_labels = getSupportedLabels()
% auxilary function
% auxiliary function

supported_labels={'SLC','SEG','REP','AVG','SET','ECO','PHS','LIN','PAR','NAV','REV','SMS', ... # these label values are copied to the corresponding MDH field on Siemens
'PMC', ... # for MoCo/PMC Pulseq version to recognize blocks that can be prospectively corrected for motion
Expand Down
2 changes: 1 addition & 1 deletion matlab/+mr/getSupportedRfUse.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function supported_rf_use = getSupportedRfUse()
% auxilary function
% auxiliary function

supported_rf_use={'excitation','refocusing','inversion','saturation','preparation'};

Expand Down
2 changes: 1 addition & 1 deletion matlab/+mr/makeAdiabaticPulse.m
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
pm=cumsum(fm)*opt.dwell;

[dfm,ifm]=min(abs(fm)); % find the center of the pulse
% we will also use the ocasion to find the rate of change of the frequency
% we will also use the occasion to find the rate of change of the frequency
% at the center of the pulse
if dfm==0
pm0=pm(ifm);
Expand Down
2 changes: 1 addition & 1 deletion matlab/+mr/makeArbitraryRf.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function [rf, gz, gzr, delay] = makeArbitraryRf(signal,flip,varargin)
%makeArbitraryRf Create an RF pulse with the given pulse shape.
% rf=makeArbitraryRf(singal, flip) Create RF pulse with complex signal
% rf=makeArbitraryRf(signal, flip) Create RF pulse with complex signal
% and given flip angle (in radians)
%
% rf=makeArbitraryRf(..., 'FreqOffset', f,'PhaseOffset',p)
Expand Down
2 changes: 1 addition & 1 deletion matlab/+mr/makeExtendedTrapezoidArea.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
Gp=sys.maxGrad*sign(Gp);
obj2=@(x) (A-testGA(Gp,x,SR,sys.gradRasterTime,Gs,Ge)).^2;
[T,obj2val,exitf] = fminsearch(obj2,0);
assert(obj2val<1e-2); % did the final search converge? MZ: I had to reduce the theshold...
assert(obj2val<1e-2); % did the final search converge? MZ: I had to reduce the threshold...

Tp=ceil(T/sys.gradRasterTime)*sys.gradRasterTime;

Expand Down
4 changes: 2 additions & 2 deletions matlab/+mr/makeGaussPulse.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
% slice select gradient corresponding to given slice thickness (m).
%
% [rf, gz]=makeGaussPulse(flip,lims,...) Create slice selection gradient
% with the specificed gradient limits (e.g. amplitude, slew).
% with the specified gradient limits (e.g. amplitude, slew).
%
% [rf, gz, gzr]=makeGaussPulse(flip,lims,...) Create slice selection and
% slice refocusing gradients with the specificed gradient limits
% slice refocusing gradients with the specified gradient limits
% (e.g. amplitude, slew) and taking into account 'centerpos' parameter
%
% See also Sequence.addBlock
Expand Down
4 changes: 2 additions & 2 deletions matlab/+mr/makeSincPulse.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
% slice select gradient corresponding to given slice thickness (m).
%
% [rf, gz]=makeSincPulse(flip,lims,...) Create slice selection gradient
% with the specificed gradient limits (e.g. amplitude, slew).
% with the specified gradient limits (e.g. amplitude, slew).
%
% [rf, gz, gzr]=makeSincPulse(flip,lims,...) Create slice selection and
% slice refocusing gradients with the specificed gradient limits
% slice refocusing gradients with the specified gradient limits
% (e.g. amplitude, slew) and taking into account 'centerpos' parameter
%
% See also Sequence.addBlock
Expand Down
2 changes: 1 addition & 1 deletion matlab/+mr/makeTrapezoid.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
% g=makeTrapezoid(channel, ...) Create trapezoid gradient on
% the given channel.
%
% g=makeTrapezoid(channel,lims,...) Create trapezoid with the specificed
% g=makeTrapezoid(channel,lims,...) Create trapezoid with the specified
% gradient limits (e.g. amplitude, slew).
%
% g=makeTrapezoid(...,'Duration',d,'Area',a) Create a
Expand Down
4 changes: 2 additions & 2 deletions matlab/+mr/simRf.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
% Performs a rapid RF pulse simulation based on the rotation formalism.
% The algorithm is optimized by using quaternions to represent rotations.
% The compulsory parameter 'rf' is the Pulseq RF pulse. Optional
% parameter 'rephase_factor' is needed in several cases e.g. to correclty
% parameter 'rephase_factor' is needed in several cases e.g. to correctly
% visualize the phase of the magnetization for slice-selective
% excitation. Another optional parameter 'prephase_factor' is an
% experimental parameter useful for simulating refocusing pulses or
Expand Down Expand Up @@ -63,7 +63,7 @@

shapea = interp1(rf.t, 2*pi*rf.signal.*exp(1i*(rf.phaseOffset+2*pi*rf.freqOffset*rf.t)),T,'linear',0);

% intialize result vectors
% initialize result vectors
M_ROT=zeros(size(F));
Z_ROT=zeros(size(F));
sf=size(F);
Expand Down
Loading