From e7510b0ee8e01b69f6cab7576ea899cb720331a5 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Sat, 22 Jul 2023 08:59:12 -0400 Subject: [PATCH 1/5] Add github action to codespell master on push and PRs --- .github/workflows/codespell.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/codespell.yml diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 00000000..7373affc --- /dev/null +++ b/.github/workflows/codespell.yml @@ -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 From 384c7190c10985bfbab7cd723da976b27d52176e Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Sat, 22 Jul 2023 08:59:12 -0400 Subject: [PATCH 2/5] Add rudimentary codespell config --- .codespellrc | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .codespellrc diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 00000000..da3c0571 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,4 @@ +[codespell] +skip = .git,*.pdf,*.svg +# +# ignore-words-list = From 86d6566482cbee2912bb586078fe80844c3f2c85 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Sat, 22 Jul 2023 09:00:17 -0400 Subject: [PATCH 3/5] skips --- .codespellrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.codespellrc b/.codespellrc index da3c0571..1ebfbc0e 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,4 +1,5 @@ [codespell] skip = .git,*.pdf,*.svg -# -# ignore-words-list = +# some abbreviated citations etc +ignore-regex = .*Reson\. Ser.* +ignore-words-list = te,fo,nd,maked,datas,iten,itel,tread From 376699f4dd93de63bf351d0e721a210832f16a32 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Sat, 22 Jul 2023 09:04:51 -0400 Subject: [PATCH 4/5] [DATALAD RUNCMD] run codespell throughout but ignore fail === Do not change lines below === { "chain": [], "cmd": "codespell -w || :", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- doc/doxy.conf.in | 2 +- doc/seqcode.sty | 2 +- matlab/+mr/@Sequence/Sequence.m | 30 ++++++++++---------- matlab/+mr/@Sequence/read.m | 4 +-- matlab/+mr/addGradients.m | 4 +-- matlab/+mr/calcDuration.m | 2 +- matlab/+mr/calcRamp.m | 2 +- matlab/+mr/calcRfBandwidth.m | 2 +- matlab/+mr/checkTiming.m | 2 +- matlab/+mr/compile_mex.m | 2 +- matlab/+mr/convert.m | 2 +- matlab/+mr/getSupportedLabels.m | 2 +- matlab/+mr/getSupportedRfUse.m | 2 +- matlab/+mr/makeAdiabaticPulse.m | 2 +- matlab/+mr/makeExtendedTrapezoidArea.m | 2 +- matlab/+mr/makeGaussPulse.m | 4 +-- matlab/+mr/makeSincPulse.m | 4 +-- matlab/+mr/makeTrapezoid.m | 2 +- matlab/+mr/simRf.m | 4 +-- matlab/+mr/splitGradientAt.m | 4 +-- matlab/demoRecon/reconExample2DEPI.m | 4 +-- matlab/demoRecon/reconExampleBART.m | 12 ++++---- matlab/demoSeq/pnsTest.m | 2 +- matlab/demoSeq/writeEpiDiffusionRS.m | 4 +-- matlab/demoSeq/writeEpiRS.m | 4 +-- matlab/demoSeq/writeEpiSpinEchoRS.m | 4 +-- matlab/demoSeq/writeEpi_label.m | 2 +- matlab/demoSeq/writeFastRadialGradientEcho.m | 2 +- matlab/demoSeq/writeMPRAGE.m | 4 +-- matlab/demoSeq/writeMPRAGE_4ge.m | 4 +-- matlab/demoSeq/writeSpiral.m | 6 ++-- matlab/demoSeq/writeTrufi.m | 6 ++-- matlab/demoSeq/writeUTE.m | 4 +-- matlab/demoSeq/writeUTE_rs.m | 6 ++-- matlab/demoSeq/writeZTE_Petra.m | 4 +-- matlab/demoSeq/writeZTE_Petra_Na.m | 8 +++--- matlab/demoUnsorted/demoRfSimulation.m | 2 +- matlab/demoUnsorted/gradSpectrum.m | 2 +- matlab/demoUnsorted/pnsTest.m | 2 +- matlab/demoUnsorted/rf_sim.m | 4 +-- matlab/demoUnsorted/rf_simq.m | 8 +++--- matlab/testmatlab.py | 2 +- src/ExternalSequence.cpp | 8 +++--- tests/epi_rs.m | 6 ++-- 44 files changed, 95 insertions(+), 95 deletions(-) diff --git a/doc/doxy.conf.in b/doc/doxy.conf.in index 6e4449cd..e9a731dc 100644 --- a/doc/doxy.conf.in +++ b/doc/doxy.conf.in @@ -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. diff --git a/doc/seqcode.sty b/doc/seqcode.sty index 8f547909..2337d245 100644 --- a/doc/seqcode.sty +++ b/doc/seqcode.sty @@ -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 diff --git a/matlab/+mr/@Sequence/Sequence.m b/matlab/+mr/@Sequence/Sequence.m index d01088fe..5084665b 100644 --- a/matlab/+mr/@Sequence/Sequence.m +++ b/matlab/+mr/@Sequence/Sequence.m @@ -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 @@ -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. @@ -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()'); @@ -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); @@ -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; @@ -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.'); @@ -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 thise +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)); @@ -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)=... @@ -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 @@ -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)); @@ -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); @@ -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'); @@ -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) @@ -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) @@ -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'); diff --git a/matlab/+mr/@Sequence/read.m b/matlab/+mr/@Sequence/read.m index 7dfe18a9..a1cc9176 100644 --- a/matlab/+mr/@Sequence/read.m +++ b/matlab/+mr/@Sequence/read.m @@ -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 @@ -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) diff --git a/matlab/+mr/addGradients.m b/matlab/+mr/addGradients.m index e2ae2795..0c2097ef 100644 --- a/matlab/+mr/addGradients.m +++ b/matlab/+mr/addGradients.m @@ -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 @@ -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 diff --git a/matlab/+mr/calcDuration.m b/matlab/+mr/calcDuration.m index 71277362..eec1c71c 100644 --- a/matlab/+mr/calcDuration.m +++ b/matlab/+mr/calcDuration.m @@ -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... diff --git a/matlab/+mr/calcRamp.m b/matlab/+mr/calcRamp.m index 139efb8f..7e86161d 100644 --- a/matlab/+mr/calcRamp.m +++ b/matlab/+mr/calcRamp.m @@ -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 diff --git a/matlab/+mr/calcRfBandwidth.m b/matlab/+mr/calcRfBandwidth.m index 7435d552..3f356778 100644 --- a/matlab/+mr/calcRfBandwidth.m +++ b/matlab/+mr/calcRfBandwidth.m @@ -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; diff --git a/matlab/+mr/checkTiming.m b/matlab/+mr/checkTiming.m index ebf0bbc0..2d3f76d9 100644 --- a/matlab/+mr/checkTiming.m +++ b/matlab/+mr/checkTiming.m @@ -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 diff --git a/matlab/+mr/compile_mex.m b/matlab/+mr/compile_mex.m index 1e2d1241..d3d25d82 100644 --- a/matlab/+mr/compile_mex.m +++ b/matlab/+mr/compile_mex.m @@ -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. diff --git a/matlab/+mr/convert.m b/matlab/+mr/convert.m index 6270c3ca..c261eac0 100644 --- a/matlab/+mr/convert.m +++ b/matlab/+mr/convert.m @@ -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' diff --git a/matlab/+mr/getSupportedLabels.m b/matlab/+mr/getSupportedLabels.m index 158bb064..922719d9 100644 --- a/matlab/+mr/getSupportedLabels.m +++ b/matlab/+mr/getSupportedLabels.m @@ -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 diff --git a/matlab/+mr/getSupportedRfUse.m b/matlab/+mr/getSupportedRfUse.m index 3b6595ac..b9e043f8 100644 --- a/matlab/+mr/getSupportedRfUse.m +++ b/matlab/+mr/getSupportedRfUse.m @@ -1,5 +1,5 @@ function supported_rf_use = getSupportedRfUse() -% auxilary function +% auxiliary function supported_rf_use={'excitation','refocusing','inversion','saturation','preparation'}; diff --git a/matlab/+mr/makeAdiabaticPulse.m b/matlab/+mr/makeAdiabaticPulse.m index a38410cb..85ab8a8a 100644 --- a/matlab/+mr/makeAdiabaticPulse.m +++ b/matlab/+mr/makeAdiabaticPulse.m @@ -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); diff --git a/matlab/+mr/makeExtendedTrapezoidArea.m b/matlab/+mr/makeExtendedTrapezoidArea.m index 24b6665d..d1d2bb94 100644 --- a/matlab/+mr/makeExtendedTrapezoidArea.m +++ b/matlab/+mr/makeExtendedTrapezoidArea.m @@ -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; diff --git a/matlab/+mr/makeGaussPulse.m b/matlab/+mr/makeGaussPulse.m index 8c21b56b..50e32a0f 100644 --- a/matlab/+mr/makeGaussPulse.m +++ b/matlab/+mr/makeGaussPulse.m @@ -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 diff --git a/matlab/+mr/makeSincPulse.m b/matlab/+mr/makeSincPulse.m index 76092d59..921cc0d7 100644 --- a/matlab/+mr/makeSincPulse.m +++ b/matlab/+mr/makeSincPulse.m @@ -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 diff --git a/matlab/+mr/makeTrapezoid.m b/matlab/+mr/makeTrapezoid.m index f38de28a..254b148b 100644 --- a/matlab/+mr/makeTrapezoid.m +++ b/matlab/+mr/makeTrapezoid.m @@ -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 diff --git a/matlab/+mr/simRf.m b/matlab/+mr/simRf.m index 25c56f1e..b1336edf 100644 --- a/matlab/+mr/simRf.m +++ b/matlab/+mr/simRf.m @@ -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 @@ -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); diff --git a/matlab/+mr/splitGradientAt.m b/matlab/+mr/splitGradientAt.m index b5e5a35c..1bf61c4c 100644 --- a/matlab/+mr/splitGradientAt.m +++ b/matlab/+mr/splitGradientAt.m @@ -37,7 +37,7 @@ ch = grad.channel; if strcmp(grad.type, 'grad') - % check if we have an arbitrary gradient or an exended trapezoid + % check if we have an arbitrary gradient or an extended trapezoid if abs(grad.tt(1)-0.5*gradRasterTime)<1e-10 && ... all(abs(grad.tt(2:end)-grad.tt(1:end-1)-gradRasterTime)<1e-10) % arbitrary gradient -- the most trivial conversion @@ -47,7 +47,7 @@ else grad1=grad; grad2=grad; - grad1.last=0.5*(grad.waveform(timeindex-1)+grad.waveform(timeindex)); % FIXME: retrive the double-sampling point (e.g. the corner of the trapezoid) + grad1.last=0.5*(grad.waveform(timeindex-1)+grad.waveform(timeindex)); % FIXME: retrieve the double-sampling point (e.g. the corner of the trapezoid) grad2.first=grad1.last; grad2.delay=grad.delay + timepoint; grad1.tt=grad.tt(1:(timeindex-1)); diff --git a/matlab/demoRecon/reconExample2DEPI.m b/matlab/demoRecon/reconExample2DEPI.m index 0bcc7719..4a352324 100644 --- a/matlab/demoRecon/reconExample2DEPI.m +++ b/matlab/demoRecon/reconExample2DEPI.m @@ -35,8 +35,8 @@ rawdata = double(twix_obj.image.unsorted()); end -%% if necessary re-tune the trajectory delay to supress ghosting -traj_recon_delay=0e-6;%3.23e-6;%-1e-6;%3.90e-6;%-1.03e-6; % adjust this parameter to supress ghosting (negative allowed) (our trio -1.0e-6, prisma +3.9e-6; avanto +3.88) +%% if necessary re-tune the trajectory delay to suppress ghosting +traj_recon_delay=0e-6;%3.23e-6;%-1e-6;%3.90e-6;%-1.03e-6; % adjust this parameter to suppress ghosting (negative allowed) (our trio -1.0e-6, prisma +3.9e-6; avanto +3.88) [ktraj_adc, t_adc, ktraj, t_ktraj, t_excitation, t_refocusing] = seq.calculateKspacePP('trajectory_delay', traj_recon_delay); %[ktraj_adc, ktraj, t_excitation, t_refocusing, t_adc] = seq.calculateKspace('trajectory_delay', traj_recon_delay); %ktraj_adc_nodelay=seq.calculateKspace('trajectory_delay', 10e-6); diff --git a/matlab/demoRecon/reconExampleBART.m b/matlab/demoRecon/reconExampleBART.m index 8cdae897..0c3f488d 100644 --- a/matlab/demoRecon/reconExampleBART.m +++ b/matlab/demoRecon/reconExampleBART.m @@ -1,6 +1,6 @@ % very basic generic non-Cartesian recon using BART % assumes raw data *.mat (or *.dat) fiels are stored together with the -% *.seq Pulseq files withe the identical(!) names +% *.seq Pulseq files with the identical(!) names % % optionally needs mapVBVD in the path (if raw data have not yet been converted to *.mat) % requires BART, modify or remove the line below depending on your path settings @@ -66,7 +66,7 @@ %% calculate k-space trajectory traj_recon_delay=0*1e-6;%1.75e-6; % adjust this parameter to potentially improve resolution & geometric accuracy. It can be calibrated by inverting the spiral revolution dimension and making two images match. for our Prisma and a particular trajectory we found 1.75e-6 -samples_to_mask=0; % each ADC may contain damaged samples in the begining +samples_to_mask=0; % each ADC may contain damaged samples in the beginning fprintf('calculating k-space trajectory ...'); %[ktraj_adc, t_adc, ktraj, t, t_excitation, t_refocusing]=seq.calculateKspacePP('trajectory_delay', traj_recon_delay); @@ -180,7 +180,7 @@ [~,pwrsort]=sort(-datapwr); %% call bart for the actual recon -- first try inverse gridding -igrid = bart('nufft -i -t -lowmem1', ktraj_adc, rawdata); % inverse interative gridding (-i) % -lowmem1 may be of help with large data +igrid = bart('nufft -i -t -lowmem1', ktraj_adc, rawdata); % inverse interactive gridding (-i) % -lowmem1 may be of help with large data save([basic_file_path '_recon_igrid'],'igrid'); % display (needs imab for displaying multiple slices/partitions) figure; imab(sum(abs(igrid).^2,4).^0.5); colormap gray; @@ -194,8 +194,8 @@ title('BART recon, nonlinear inversion'); drawnow; %% call bart for the pics algorithm with compressed sensing (with dummy coil sensitivities) -pics = bart('pics -S -l2 -r5 -t', ktraj_adc, rawdata, ones(size(igrid))); % inverse interative gridding (-i) % -lowmem1 may be of help with large data -%pics_l1 = bart('pics -S -l1 -i100 -s0.0002 -r0.003 -t', ktraj_adc, rawdata, ones(size(igrid))); % inverse interative gridding (-i) % -lowmem1 may be of help with large data +pics = bart('pics -S -l2 -r5 -t', ktraj_adc, rawdata, ones(size(igrid))); % inverse interactive gridding (-i) % -lowmem1 may be of help with large data +%pics_l1 = bart('pics -S -l1 -i100 -s0.0002 -r0.003 -t', ktraj_adc, rawdata, ones(size(igrid))); % inverse interactive gridding (-i) % -lowmem1 may be of help with large data % tested r 0.002 0.004 and 0.01 (l1, l1s or ++, l1ss or +++) save([basic_file_path '_recon_pics'],'pics'); % display (needs imab for displaying multiple slices/partitions) @@ -203,7 +203,7 @@ title('BART recon, pics-l2'); drawnow; % %% -% pics_l2 = bart('pics -S -l2 -r5 -t', ktraj_adc, rawdata, ones(size(igrid))); % inverse interative gridding (-i) % -lowmem1 may be of help with large data +% pics_l2 = bart('pics -S -l2 -r5 -t', ktraj_adc, rawdata, ones(size(igrid))); % inverse interactive gridding (-i) % -lowmem1 may be of help with large data % save([basic_file_path '_recon_picsL2'],'pics_l2'); % % display (needs imab for displaying multiple slices/partitions) % figure; imab(sum(abs(pics_l2).^2,4).^0.5); colormap gray; drawnow; diff --git a/matlab/demoSeq/pnsTest.m b/matlab/demoSeq/pnsTest.m index dedc2241..b6c1e136 100644 --- a/matlab/demoSeq/pnsTest.m +++ b/matlab/demoSeq/pnsTest.m @@ -1,4 +1,4 @@ -% this is an experimentaal high-performance EPI sequence +% this is an experimental high-performance EPI sequence % which uses split gradients to overlap blips with the readout % gradients combined with ramp-samping diff --git a/matlab/demoSeq/writeEpiDiffusionRS.m b/matlab/demoSeq/writeEpiDiffusionRS.m index e3b13c1c..7c93b52d 100644 --- a/matlab/demoSeq/writeEpiDiffusionRS.m +++ b/matlab/demoSeq/writeEpiDiffusionRS.m @@ -1,4 +1,4 @@ -% this is an diffusion/weighted EPI based on the experimentaal high- +% this is an diffusion/weighted EPI based on the experimental high- % performance EPI sequence which uses split gradients to overlap blips with % the readout gradients combined with ramp-samping % it further features diffusion weighting using the standard @@ -58,7 +58,7 @@ gy = mr.makeTrapezoid('y',lims,'Area',-deltak,'Duration',blip_dur); % we use negative blips to save one k-space line on our way towards the k-space center %gy = mr.makeTrapezoid('y',lims,'amplitude',deltak/blip_dur*2,'riseTime',blip_dur/2, 'flatTime', 0); -% readout gradient is a truncated trapezoid with dead times at the beginnig +% readout gradient is a truncated trapezoid with dead times at the beginning % and at the end each equal to a half of blip_dur % the area between the blips should be defined by kWidth % we do a two-step calculation: we first increase the area assuming maximum diff --git a/matlab/demoSeq/writeEpiRS.m b/matlab/demoSeq/writeEpiRS.m index 3577dd37..669addaf 100644 --- a/matlab/demoSeq/writeEpiRS.m +++ b/matlab/demoSeq/writeEpiRS.m @@ -1,4 +1,4 @@ -% this is an experimentaal high-performance EPI sequence +% this is an experimental high-performance EPI sequence % which uses split gradients to overlap blips with the readout % gradients combined with ramp-samping @@ -43,7 +43,7 @@ gy = mr.makeTrapezoid('y',sys,'Area',-deltak,'Duration',blip_dur); % we use negative blips to save one k-space line on our way towards the k-space center %gy = mr.makeTrapezoid('y',lims,'amplitude',deltak/blip_dur*2,'riseTime',blip_dur/2, 'flatTime', 0); -% readout gradient is a truncated trapezoid with dead times at the beginnig +% readout gradient is a truncated trapezoid with dead times at the beginning % and at the end each equal to a half of blip_dur % the area between the blips should be defined by kWidth % we do a two-step calculation: we first increase the area assuming maximum diff --git a/matlab/demoSeq/writeEpiSpinEchoRS.m b/matlab/demoSeq/writeEpiSpinEchoRS.m index 4459945d..5313d8d7 100644 --- a/matlab/demoSeq/writeEpiSpinEchoRS.m +++ b/matlab/demoSeq/writeEpiSpinEchoRS.m @@ -1,4 +1,4 @@ -% this is an experimentaal high-performance EPI sequence +% this is an experimental high-performance EPI sequence % which uses split gradients to overlap blips with the readout % gradients combined with ramp-samping @@ -64,7 +64,7 @@ gy = mr.makeTrapezoid('y',lims,'Area',-deltak,'Duration',blip_dur); % we use negative blips to save one k-space line on our way towards the k-space center %gy = mr.makeTrapezoid('y',lims,'amplitude',deltak/blip_dur*2,'riseTime',blip_dur/2, 'flatTime', 0); -% readout gradient is a truncated trapezoid with dead times at the beginnig +% readout gradient is a truncated trapezoid with dead times at the beginning % and at the end each equal to a half of blip_dur % the area between the blips should be defined by kWidth % we do a two-step calculation: we first increase the area assuming maximum diff --git a/matlab/demoSeq/writeEpi_label.m b/matlab/demoSeq/writeEpi_label.m index be5b4dea..348b8704 100644 --- a/matlab/demoSeq/writeEpi_label.m +++ b/matlab/demoSeq/writeEpi_label.m @@ -61,7 +61,7 @@ mr.makeLabel('SET','SEG', gx.amplitude<0), ... mr.makeLabel('SET','AVG',n==3)); if (n~=Navigator) - seq.addBlock(mr.makeDelay(mr.calcDuration(gy))); % we need this dummy blip pulse to maintain ientical RO gradient timing anf the correspnding eddy currents + seq.addBlock(mr.makeDelay(mr.calcDuration(gy))); % we need this dummy blip pulse to maintain ientical RO gradient timing anf the corresponding eddy currents end gx.amplitude = -gx.amplitude; % Reverse polarity of read gradient end diff --git a/matlab/demoSeq/writeFastRadialGradientEcho.m b/matlab/demoSeq/writeFastRadialGradientEcho.m index 55dddce8..56c3d151 100644 --- a/matlab/demoSeq/writeFastRadialGradientEcho.m +++ b/matlab/demoSeq/writeFastRadialGradientEcho.m @@ -31,7 +31,7 @@ deltak=1/fov; gx = mr.makeTrapezoid('x','Amplitude',Nx*deltak/ro_dur,'FlatTime',ceil(ro_dur/sys.gradRasterTime)*sys.gradRasterTime,'system',sys); adc = mr.makeAdc(Nx*ro_os,'Duration',ro_dur,'Delay',gx.riseTime,'system',sys); -gxPre = mr.makeTrapezoid('x','Area',-gx.amplitude*(ro_dur/Nx/ro_os*(Nx*ro_os/2-0.5)+0.5*gx.riseTime),'system',sys); % 0.5 is necessary to acount for the Siemens sampling in the center of the dwell periods +gxPre = mr.makeTrapezoid('x','Area',-gx.amplitude*(ro_dur/Nx/ro_os*(Nx*ro_os/2-0.5)+0.5*gx.riseTime),'system',sys); % 0.5 is necessary to account for the Siemens sampling in the center of the dwell periods % [gxPre,~]=mr.align('right', gxPre, 'right', gzComb); addDelay=mr.calcDuration(rf)-gxPre.delay; diff --git a/matlab/demoSeq/writeMPRAGE.m b/matlab/demoSeq/writeMPRAGE.m index 439c5e24..59c2535b 100644 --- a/matlab/demoSeq/writeMPRAGE.m +++ b/matlab/demoSeq/writeMPRAGE.m @@ -42,7 +42,7 @@ deltak=1./fov; gro = mr.makeTrapezoid(ax.d1,'Amplitude',N(ax.n1)*deltak(ax.n1)/ro_dur,'FlatTime',ceil((ro_dur+sys.adcDeadTime)/sys.gradRasterTime)*sys.gradRasterTime,'system',sys); adc = mr.makeAdc(N(ax.n1)*ro_os,'Duration',ro_dur,'Delay',gro.riseTime,'system',sys); -groPre = mr.makeTrapezoid(ax.d1,'Area',-gro.amplitude*(adc.dwell*(adc.numSamples/2+0.5)+0.5*gro.riseTime),'system',sys); % the first 0.5 is necessary to acount for the Siemens sampling in the center of the dwell periods +groPre = mr.makeTrapezoid(ax.d1,'Area',-gro.amplitude*(adc.dwell*(adc.numSamples/2+0.5)+0.5*gro.riseTime),'system',sys); % the first 0.5 is necessary to account for the Siemens sampling in the center of the dwell periods gpe1 = mr.makeTrapezoid(ax.d2,'Area',-deltak(ax.n2)*(N(ax.n2)/2),'system',sys); % maximum PE1 gradient gpe2 = mr.makeTrapezoid(ax.d3,'Area',-deltak(ax.n3)*(N(ax.n3)/2),'system',sys); % maximum PE2 gradient gslSp = mr.makeTrapezoid(ax.d3,'Area',max(deltak.*N)*4,'Duration',10e-3,'system',sys); % spoil with 4x cycles per voxel @@ -129,7 +129,7 @@ %% seq.setDefinition('FOV', fov); seq.setDefinition('Name', 'mprage'); -seq.setDefinition('OrientationMapping', 'SAG'); % only when programming in saggital orientation +seq.setDefinition('OrientationMapping', 'SAG'); % only when programming in sagittal orientation seq.write('mprage.seq') % Write to pulseq file %seq.install('siemens'); diff --git a/matlab/demoSeq/writeMPRAGE_4ge.m b/matlab/demoSeq/writeMPRAGE_4ge.m index 41ac13ae..3fc14978 100644 --- a/matlab/demoSeq/writeMPRAGE_4ge.m +++ b/matlab/demoSeq/writeMPRAGE_4ge.m @@ -33,7 +33,7 @@ deltak=1./fov; gro = mr.makeTrapezoid(ax.d1,'Amplitude',N(ax.n1)*deltak(ax.n1)/ro_dur,'FlatTime',ceil(ro_dur/sys.gradRasterTime)*sys.gradRasterTime,'system',sys); adc = mr.makeAdc(N(ax.n1)*ro_os,'Duration',ro_dur,'Delay',gro.riseTime,'system',sys); -groPre = mr.makeTrapezoid(ax.d1,'Area',-gro.amplitude*(adc.dwell*(adc.numSamples/2+0.5)+0.5*gro.riseTime),'system',sys); % the first 0.5 is necessary to acount for the Siemens sampling in the center of the dwell periods +groPre = mr.makeTrapezoid(ax.d1,'Area',-gro.amplitude*(adc.dwell*(adc.numSamples/2+0.5)+0.5*gro.riseTime),'system',sys); % the first 0.5 is necessary to account for the Siemens sampling in the center of the dwell periods gpe1 = mr.makeTrapezoid(ax.d2,'Area',deltak(ax.n2)*(N(ax.n2)/2),'system',sys); % maximum PE1 gradient gpe2 = mr.makeTrapezoid(ax.d3,'Area',deltak(ax.n3)*(N(ax.n3)/2),'system',sys); % maximum PE2 gradient gslSp = mr.makeTrapezoid(ax.d3,'Area',max(deltak.*N)*4,'Duration',10e-3,'system',sys); % spoil with 4x cycles per voxel @@ -46,7 +46,7 @@ % calculate timing of the fast loop % we will have two blocks in the inner loop: % 1: RF -% 2: prewinder,phase enconding + readout + spoilers/rewinders +% 2: prewinder,phase encoding + readout + spoilers/rewinders [groPre,~]=mr.align('right',groPre,mr.makeDelay(mr.calcDuration(gpe1,gpe2)-gro.riseTime)); gro1.delay=mr.calcDuration(groPre); groSp.delay=mr.calcDuration(gro1); diff --git a/matlab/demoSeq/writeSpiral.m b/matlab/demoSeq/writeSpiral.m index db995c6c..21d76ef0 100644 --- a/matlab/demoSeq/writeSpiral.m +++ b/matlab/demoSeq/writeSpiral.m @@ -1,4 +1,4 @@ -% this is an experimentaal spiral sequence +% this is an experimental spiral sequence fov=256e-3; Nx=96; Ny=Nx; % Define FOV and resolution sliceThickness=3e-3; % slice thinckness @@ -32,7 +32,7 @@ kSamples=round(2*pi*kRadius)*Oversampling; readoutTime = 4.2e-4; -% calculate a raw Archimedian spiral trajectory +% calculate a raw Archimedean spiral trajectory clear ka; ka(kRadius*kSamples+1)=1i; % init as complex for c=0:kRadius*kSamples @@ -114,7 +114,7 @@ adc = mr.makeAdc(adcSamples,'Dwell',adcDwell,'Delay',mr.calcDuration(gzReph));%lims.adcDeadTime); % extend spiral_grad_shape by repeating the last sample -% this is needed to accomodate for the ADC tuning delay +% this is needed to accommodate for the ADC tuning delay spiral_grad_shape = [spiral_grad_shape spiral_grad_shape(:,end)]; % readout grad diff --git a/matlab/demoSeq/writeTrufi.m b/matlab/demoSeq/writeTrufi.m index 511a74ca..91fbdd88 100644 --- a/matlab/demoSeq/writeTrufi.m +++ b/matlab/demoSeq/writeTrufi.m @@ -1,6 +1,6 @@ % we define here a really crude True-FISP a.k.a. bSSFP sequence % there is no user control for TR/TE, you just specify the ADC time and the -% RF parameters and the rest is calculated to find the fastest posible +% RF parameters and the rest is calculated to find the fastest possible % timing. The sequence intensively uses the extended trapezoid % functionality to achieve near-optimal timing. Due to the requirement for % splitting the sequence into blocks the TR is increased by approximately @@ -54,7 +54,7 @@ % new gr will consist of two parts: % 1: prephaser followed by a part of the read gradient including the % beginning of the ramp-down -% 2: the remainer of the ramp-down and the second "prephaser" +% 2: the remainder of the ramp-down and the second "prephaser" gx_parts=mr.splitGradientAt(gx,ceil(mr.calcDuration(adc)/sys.gradRasterTime)*sys.gradRasterTime); gx_parts(1).delay=mr.calcDuration(gxPre); gx_1=mr.addGradients({gxPre,gx_parts(1)},'system',sys); @@ -84,7 +84,7 @@ rf05=rf; rf05.signal=0.5*rf.signal; seq.addBlock(rf05,gz_1,mr.makeLabel('SET','ONCE', 1)); % we also label the few following blocks as preparing to exclude them if the sequence is repeated -% the following delay calculation fails for agressive sequence timing +% the following delay calculation fails for aggressive sequence timing prepDelay=mr.makeDelay(round((TR/2-mr.calcDuration(gz_1))/sys.gradRasterTime)*sys.gradRasterTime); % I know this round() is not 100% correct gx_1_1=mr.makeExtendedTrapezoidArea('x',0,gx_2.first,-gx_2.area,sys); gyPre_2 = mr.makeTrapezoid('y','Area',phaseAreas(end),'Duration',pe_dur,'system',sys); % last PE step (in case of repetitions) diff --git a/matlab/demoSeq/writeUTE.m b/matlab/demoSeq/writeUTE.m index 6f560866..a0734648 100644 --- a/matlab/demoSeq/writeUTE.m +++ b/matlab/demoSeq/writeUTE.m @@ -16,7 +16,7 @@ ro_duration=2.56e-3; % read-out time: controls RO bandwidth and T2-blurring ro_os=2; % oversampling ro_asymmetry=1; % 0: fully symmetric 1: half-echo -minRF_to_ADC_time=50e-6; % the parameter wich defines TE (together with the RO asymmetyry) +minRF_to_ADC_time=50e-6; % the parameter which defines TE (together with the RO asymmetyry) % more in-depth parameters rfSpoilingInc=117; % RF spoiling increment @@ -26,7 +26,7 @@ 'SliceThickness',sliceThickness,'apodization',0.5,'timeBwProduct',2,... 'centerpos',1,'system',sys); -% Align RO assymmetry to ADC samples +% Align RO asymmetry to ADC samples Nxo=round(ro_os*Nx); ro_asymmetry = round(ro_asymmetry*Nxo/2)/Nxo*2; % check whether we need to use 2Nx or so... % Define other gradients and ADC events diff --git a/matlab/demoSeq/writeUTE_rs.m b/matlab/demoSeq/writeUTE_rs.m index 638d919d..5be34577 100644 --- a/matlab/demoSeq/writeUTE_rs.m +++ b/matlab/demoSeq/writeUTE_rs.m @@ -18,7 +18,7 @@ rf_duration=0.5e-3; % duration of the excitation pulse ro_duration=0.720e-3; % read-out time: controls RO bandwidth and T2-blurring ro_os=2; % oversampling -minRF_to_ADC_time=70e-6; % the parameter wich defines TE together with ro_discard +minRF_to_ADC_time=70e-6; % the parameter which defines TE together with ro_discard ro_discard=0; % dummy ADC samples to discard (due to ADC filter ro_spoil=1; % extend RO to achieve spoiling @@ -49,7 +49,7 @@ gz.flatTime=ceil((gz.flatTime-gz.fallTime*0.5)/sys.gradRasterTime)*sys.gradRasterTime; rf.delay=mr.calcDuration(rf,gz)-rf.shape_dur; % fix the possible time shift due to the rounding-up step above -% Align RO assymmetry to ADC samples +% Align RO asymmetry to ADC samples Nxo=round(ro_os*Nx); % Define other gradients and ADC events deltak=1/fov/2; @@ -73,7 +73,7 @@ % set up timing gx.delay=mr.calcDuration(gz)+TE; -adc.delay=floor((gx.delay-adc.dwell*0.5-adc.dwell*ro_discard)/sys.gradRasterTime)*sys.gradRasterTime; % take into accout 0.5 samples ADC shift +adc.delay=floor((gx.delay-adc.dwell*0.5-adc.dwell*ro_discard)/sys.gradRasterTime)*sys.gradRasterTime; % take into account 0.5 samples ADC shift rf_phase=0; rf_inc=0; diff --git a/matlab/demoSeq/writeZTE_Petra.m b/matlab/demoSeq/writeZTE_Petra.m index 9aa48d69..80db772e 100644 --- a/matlab/demoSeq/writeZTE_Petra.m +++ b/matlab/demoSeq/writeZTE_Petra.m @@ -17,7 +17,7 @@ rf_duration=10e-6; % duration of the excitation pulse ro_duration=300e-6; % read-out time: controls RO bandwidth and T2-blurring -minRF_to_ADC_time=50e-6; % the parameter wich defines TE together with ro_discard +minRF_to_ADC_time=50e-6; % the parameter which defines TE together with ro_discard %ro_discard=4; % how many ADC samples are contaminated by RF switching artifacts and alike rfSpoilingInc=117; % RF spoiling increment @@ -27,7 +27,7 @@ 'rfDeadTime', 100e-6, 'adcDeadTime', 10e-6, 'gamma',42.576e6); % 1H: 42.576e6 23Na: 11.262e6 seq=mr.Sequence(sys); % Create a new sequence object -seq_sar=mr.Sequence(sys); % Create an auxillary sequence object for SAR testing +seq_sar=mr.Sequence(sys); % Create an auxiliary sequence object for SAR testing %% create main sequence elements diff --git a/matlab/demoSeq/writeZTE_Petra_Na.m b/matlab/demoSeq/writeZTE_Petra_Na.m index e8a23359..3d32438b 100644 --- a/matlab/demoSeq/writeZTE_Petra_Na.m +++ b/matlab/demoSeq/writeZTE_Petra_Na.m @@ -17,7 +17,7 @@ rf_duration=50e-6; % duration of the excitation pulse ro_duration=1800e-6; % read-out time: controls RO bandwidth and T2-blurring -minRF_to_ADC_time=50e-6; % the parameter wich defines TE together with ro_discard +minRF_to_ADC_time=50e-6; % the parameter which defines TE together with ro_discard %ro_discard=4; % how many ADC samples are contaminated by RF switching artifacts and alike rfSpoilingInc=117; % RF spoiling increment @@ -27,7 +27,7 @@ 'rfDeadTime', 100e-6, 'adcDeadTime', 10e-6, 'gamma',11.262e6); % 1H: 42.576e6 23Na: 11.262e6 seq=mr.Sequence(sys); % Create a new sequence object -seq_sar=mr.Sequence(sys); % Create an auxillary sequence object for SAR testing +seq_sar=mr.Sequence(sys); % Create an auxiliary sequence object for SAR testing %% create main sequence elements @@ -191,7 +191,7 @@ hold on;plot3(kfa(1,:),kfa(2,:),kfa(3,:),'r.'); %% -% Align RO assymmetry to ADC samples +% Align RO asymmetry to ADC samples Nxo=round(ro_os*Nx); % Define other gradients and ADC events deltak=1/fov/2; @@ -215,7 +215,7 @@ % set up timing gx.delay=mr.calcDuration(gz)+TE; -adc.delay=floor((gx.delay-adc.dwell*0.5-adc.dwell*ro_discard)/sys.gradRasterTime)*sys.gradRasterTime; % take into accout 0.5 samples ADC shift +adc.delay=floor((gx.delay-adc.dwell*0.5-adc.dwell*ro_discard)/sys.gradRasterTime)*sys.gradRasterTime; % take into account 0.5 samples ADC shift rf_phase=0; rf_inc=0; diff --git a/matlab/demoUnsorted/demoRfSimulation.m b/matlab/demoUnsorted/demoRfSimulation.m index a5a3d435..b5823bea 100644 --- a/matlab/demoUnsorted/demoRfSimulation.m +++ b/matlab/demoUnsorted/demoRfSimulation.m @@ -289,7 +289,7 @@ %% spoiling simulation for the same pulse used and refocusing pulse -spoiling_factor=5; % area of the left/righ spoiler; reasonable range 1..10 +spoiling_factor=5; % area of the left/right spoiler; reasonable range 1..10 cl=13; % convolution length to simulate intravoxel dephasing [M_z,M_xy,F2,ref_eff,mxrf,myrf]=mr.simRf(rf180_ad,spoiling_factor,spoiling_factor); diff --git a/matlab/demoUnsorted/gradSpectrum.m b/matlab/demoUnsorted/gradSpectrum.m index 098404dc..37d8fcb8 100644 --- a/matlab/demoUnsorted/gradSpectrum.m +++ b/matlab/demoUnsorted/gradSpectrum.m @@ -9,7 +9,7 @@ fmax=10000; %10kHz nwin=5000; % 0.05s os=3; % frequency oversampling for prettier peaks -ascName=[]; % this disables the display of the system's resonance frequences +ascName=[]; % this disables the display of the system's resonance frequencies %ascName='idea/asc/MP_GPA_K2309_2250V_951A_AS82.asc'; % 3T prisma if ischar(ascName) diff --git a/matlab/demoUnsorted/pnsTest.m b/matlab/demoUnsorted/pnsTest.m index dedc2241..b6c1e136 100644 --- a/matlab/demoUnsorted/pnsTest.m +++ b/matlab/demoUnsorted/pnsTest.m @@ -1,4 +1,4 @@ -% this is an experimentaal high-performance EPI sequence +% this is an experimental high-performance EPI sequence % which uses split gradients to overlap blips with the readout % gradients combined with ramp-samping diff --git a/matlab/demoUnsorted/rf_sim.m b/matlab/demoUnsorted/rf_sim.m index e5df1c5d..5c879b44 100644 --- a/matlab/demoUnsorted/rf_sim.m +++ b/matlab/demoUnsorted/rf_sim.m @@ -16,7 +16,7 @@ function rf_sim(pulse,prephase_factor,rephase_factor) M_STA = sin(w)*abs(fftshift(fft(shapea,N))) * dt*v/w; M_STA = M_STA(N/2+(-numel(F)/2+1:numel(F)/2)); % extract frequencies of interest -% intialize result vectors +% initialize result vectors %M_ODE=zeros(size(F)); M_ROT=zeros(size(F)); Z_ROT=zeros(size(F)); @@ -55,7 +55,7 @@ function rf_sim(pulse,prephase_factor,rephase_factor) % summarize results M_ROT(i) = abs(2*Q(1,1)'*Q(2,1)); % transv. magn. Z_ROT(i) = Q(1,1)*Q(2,2)+Q(2,1)*Q(1,2); % long. magn. - q(1,i)=0.5*real(Q(1,1)+Q(2,2)); % rotation quaternion (for futher anlysis) + q(1,i)=0.5*real(Q(1,1)+Q(2,2)); % rotation quaternion (for further analysis) q(2,i)=0.5*imag(Q(2,1)+Q(1,2)); q(3,i)=0.5*real(Q(1,2)-Q(2,1)); q(4,i)=0.5*imag(Q(1,1)-Q(2,2)); diff --git a/matlab/demoUnsorted/rf_simq.m b/matlab/demoUnsorted/rf_simq.m index 2e77e9c1..ddd828ae 100644 --- a/matlab/demoUnsorted/rf_simq.m +++ b/matlab/demoUnsorted/rf_simq.m @@ -17,7 +17,7 @@ M_STA = sin(w)*abs(fftshift(fft(shapea,N))) * dt*v/w; M_STA = M_STA(N/2+(-numel(F)/2+1:numel(F)/2)); % extract frequencies of interest -% intialize result vectors +% initialize result vectors M_ROT=zeros(size(F)); Z_ROT=zeros(size(F)); sf=size(F); @@ -45,7 +45,7 @@ % % summarize results % M_ROT(i) = abs(2*Q(1,1)'*Q(2,1)); % transv. magn. % Z_ROT(i) = Q(1,1)*Q(2,2)+Q(2,1)*Q(1,2); % long. magn. -% q(1,i)=0.5*real(Q(1,1)+Q(2,2)); % rotation quaternion (for futher anlysis) +% q(1,i)=0.5*real(Q(1,1)+Q(2,2)); % rotation quaternion (for further analysis) % q(2,i)=0.5*imag(Q(2,1)+Q(1,2)); % q(3,i)=0.5*real(Q(1,2)-Q(2,1)); % q(4,i)=0.5*imag(Q(1,1)-Q(2,2)); @@ -87,8 +87,8 @@ myrf=myrf(:,2)+1i*myrf(:,3); myrfc=conv(myrf,ones(cl,1)/cl,'same'); %figure;plot(F,sum(mrfc1.^2).^0.5,F,sum(mrfc2.^2).^0.5,F,0.5-0.5*real(Z_ROT));axis([-4 4 -0.1 1.1]); title('refocusing profiles vs ''inversion'''); -%figure;plot(F,(0.5*sum(mrfc1.^2,2)+0.5*sum(mrfc2.^2,2)).^0.5,F,0.5-0.5*m0rf(:,4));axis([-4 4 -0.1 1.1]); title('refocusing profiles vs (inverted and scalled) M_z'); -figure;plot(F,abs(abs(mxrfc)+1i*abs(myrfc))/2^0.5,F,0.5-0.5*m0rf(:,4));axis([-4 4 -0.1 1.1]); title('refocusing profiles vs (inverted and scalled) M_z'); +%figure;plot(F,(0.5*sum(mrfc1.^2,2)+0.5*sum(mrfc2.^2,2)).^0.5,F,0.5-0.5*m0rf(:,4));axis([-4 4 -0.1 1.1]); title('refocusing profiles vs (inverted and scaled) M_z'); +figure;plot(F,abs(abs(mxrfc)+1i*abs(myrfc))/2^0.5,F,0.5-0.5*m0rf(:,4));axis([-4 4 -0.1 1.1]); title('refocusing profiles vs (inverted and scaled) M_z'); % refocusing phase %figure;plot(F,angle(mxrf)/2-(angle(myrf)+pi/2)/2);axis([-4 4 -1.6 1.6]); title('refocusing phase inconsistency'); %figure;plot(F,angle(mxrf)/2+(angle(myrf)+pi/2)/2);axis([-4 4 -1.6 1.6]); title('mean refocusing phase'); diff --git a/matlab/testmatlab.py b/matlab/testmatlab.py index b594fbeb..0e416d40 100755 --- a/matlab/testmatlab.py +++ b/matlab/testmatlab.py @@ -27,7 +27,7 @@ def cmp_lines(path_1, path_2): def main(): """Main""" sequences = ['fid', 'gre', 'epi_rs'] - # binary sequences are unsuported now + # binary sequences are unsupported now #binary_sequences = ['gre_binary'] binary_sequences = [] base_dir = '../tests/' diff --git a/src/ExternalSequence.cpp b/src/ExternalSequence.cpp index 95249605..dc4a4295 100644 --- a/src/ExternalSequence.cpp +++ b/src/ExternalSequence.cpp @@ -352,7 +352,7 @@ bool ExternalSequence::load(std::string path) } } - // Read delays section (comatibility with Pulseq version prior to 1.4.0) + // Read delays section (compatibility with Pulseq version prior to 1.4.0) // --------------------------------------------------------------------- std::map tmpDelayLibrary; if (m_fileIndex.find("[DELAYS]") != m_fileIndex.end()) { @@ -486,7 +486,7 @@ bool ExternalSequence::load(std::string path) print_msg(ERROR_MSG, std::ostringstream().flush() << "*** ERROR: failed to decode labelinc event\n" << buffer << std::endl ); return false; }else if(nRet>0) { - print_msg(ERROR_MSG, std::ostringstream().flush() << "*** ERROR: decoding labelinc event returnd 0\n" << buffer << std::endl ); + print_msg(ERROR_MSG, std::ostringstream().flush() << "*** ERROR: decoding labelinc event returned 0\n" << buffer << std::endl ); } m_labelincLibrary[nID] = label; @@ -872,7 +872,7 @@ SeqBlock* ExternalSequence::GetBlock(int index) { if (events.id[GX+i]>0) block->grad[i] = m_gradLibrary[events.id[GX+i]]; // unpack (known) extension objects if (events.id[EXT]>0) { - // oh yeah, the current data stuctures seem to be really ugly and slow... + // oh yeah, the current data structures seem to be really ugly and slow... int nNextExtID=events.id[EXT]; while (nNextExtID) { std::map::iterator itEL = m_extensionLibrary.find(nNextExtID); @@ -962,7 +962,7 @@ SeqBlock* ExternalSequence::GetBlock(int index) { duration = MAX(duration, trigger.delay+trigger.duration ); } - // TODO: conversion from previous versons + // TODO: conversion from previous versions assert(version_combined>=1004000L); //// handling of delays has changed in revision 1.2.0 //if (version_combined<1002000L) diff --git a/tests/epi_rs.m b/tests/epi_rs.m index aaa3de73..16fa9a80 100644 --- a/tests/epi_rs.m +++ b/tests/epi_rs.m @@ -1,4 +1,4 @@ -% this is an experimentaal high-performance EPI sequence +% this is an experimental high-performance EPI sequence % which uses split gradients to overlap blips with the readout % gradients combined with ramp-samping @@ -30,7 +30,7 @@ gy = mr.makeTrapezoid('y',lims,'Area',deltak,'Duration',blip_dur); %gy = mr.makeTrapezoid('y',lims,'amplitude',deltak/blip_dur*2,'riseTime',blip_dur/2, 'flatTime', 0); -% readout gradient is a truncated trapezoid with dead times at the beginnig +% readout gradient is a truncated trapezoid with dead times at the beginning % and at the end each equal to a half of blip_dur % the area between the blips should be defined by kWidth % we do a two-step calculation: we first increase the area assuming maximum @@ -57,7 +57,7 @@ adc.delay=round((gx.riseTime+gx.flatTime/2-time_to_center)*1e6)*1e-6; % we adjust the delay to align the trajectory with the gradient. We have to aligh the delay to 1us % this rounding actually makes the sampling points on odd and even readouts % to appear misalligned. However, on the real hardware this misalignment is -% much stronger anways due to the grdient delays +% much stronger anyway due to the grdient delays % FOV positioning requires alignment to grad. raster... -> TODO From 113f8d7589d4e9a2f69e33832e2c54b302ded491 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Sat, 22 Jul 2023 09:13:02 -0400 Subject: [PATCH 5/5] Fix some ambigous typos --- doc/doxy.conf.in | 2 +- doc/seqcode.sty | 2 +- matlab/+mr/@Sequence/Sequence.m | 4 ++-- matlab/+mr/makeArbitraryRf.m | 2 +- matlab/demoRecon/reconExampleBART.m | 2 +- matlab/demoSeq/writeCineGradientEcho.m | 4 ++-- matlab/demoSeq/writeSemiLaser.m | 2 +- matlab/demoSeq/writeSpiral.m | 4 ++-- src/ExternalSequence.cpp | 4 ++-- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/doxy.conf.in b/doc/doxy.conf.in index e9a731dc..e3ecf330 100644 --- a/doc/doxy.conf.in +++ b/doc/doxy.conf.in @@ -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 diff --git a/doc/seqcode.sty b/doc/seqcode.sty index 2337d245..5e807d6d 100644 --- a/doc/seqcode.sty +++ b/doc/seqcode.sty @@ -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 diff --git a/matlab/+mr/@Sequence/Sequence.m b/matlab/+mr/@Sequence/Sequence.m index 5084665b..1a8eae35 100644 --- a/matlab/+mr/@Sequence/Sequence.m +++ b/matlab/+mr/@Sequence/Sequence.m @@ -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) @@ -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 proved 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)); diff --git a/matlab/+mr/makeArbitraryRf.m b/matlab/+mr/makeArbitraryRf.m index eb23c58b..bb986397 100644 --- a/matlab/+mr/makeArbitraryRf.m +++ b/matlab/+mr/makeArbitraryRf.m @@ -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) diff --git a/matlab/demoRecon/reconExampleBART.m b/matlab/demoRecon/reconExampleBART.m index 0c3f488d..3f824288 100644 --- a/matlab/demoRecon/reconExampleBART.m +++ b/matlab/demoRecon/reconExampleBART.m @@ -1,5 +1,5 @@ % very basic generic non-Cartesian recon using BART -% assumes raw data *.mat (or *.dat) fiels are stored together with the +% assumes raw data *.mat (or *.dat) files are stored together with the % *.seq Pulseq files with the identical(!) names % % optionally needs mapVBVD in the path (if raw data have not yet been converted to *.mat) diff --git a/matlab/demoSeq/writeCineGradientEcho.m b/matlab/demoSeq/writeCineGradientEcho.m index 2bd958bb..3376536a 100644 --- a/matlab/demoSeq/writeCineGradientEcho.m +++ b/matlab/demoSeq/writeCineGradientEcho.m @@ -10,7 +10,7 @@ % cardiac features phases = 8; -hearbeats = 15; % odd numbers of heartbeats / segments work better +heartbeats = 15; % odd numbers of heartbeats / segments work better % more in-depth parameters rfSpoilingInc=117; % RF spoiling increment @@ -49,7 +49,7 @@ gxPre = mr.makeTrapezoid('x','Area',-gx.area/2,'Duration',pre_duration,'system',sys); gzReph = mr.makeTrapezoid('z','Area',-gz.area/2,'Duration',pre_duration,'system',sys); -lines_per_segment = round(Ny/hearbeats); +lines_per_segment = round(Ny/heartbeats); Ns=ceil(Ny/lines_per_segment); Ny=Ns*lines_per_segment; % it can be that because of the rounding above we measure few more k-space lines... phaseAreas = ((0:Ny-1)-Ny/2)*deltak; diff --git a/matlab/demoSeq/writeSemiLaser.m b/matlab/demoSeq/writeSemiLaser.m index cb2a0e03..f1cc93d0 100644 --- a/matlab/demoSeq/writeSemiLaser.m +++ b/matlab/demoSeq/writeSemiLaser.m @@ -125,7 +125,7 @@ seq.addBlock(gxSpoil_combi,gySpoil_combi,gz_comb,rf_180_4); seq.addBlock(adc,mr.makeDelay(mr.calcDuration(adc)+system.adcDeadTime)); - % this is realy a lazy way of defining the TR delay + % this is really a lazy way of defining the TR delay if i==1 delayTR = TR- seq.duration(); assert(delayTR>0); diff --git a/matlab/demoSeq/writeSpiral.m b/matlab/demoSeq/writeSpiral.m index 21d76ef0..bfe6ffe1 100644 --- a/matlab/demoSeq/writeSpiral.m +++ b/matlab/demoSeq/writeSpiral.m @@ -104,7 +104,7 @@ adcSegments=round(adcSamplesDesired/adcSamplesPerSegment); adcSamples=adcSegments*adcSamplesPerSegment; adcDwell=round(adcTime/adcSamples/100e-9)*100e-9; % on Siemens adcDwell needs to be aligned to 100ns (if my memory serves me right) -adcSegmentDuration=adcSamplesPerSegment*adcDwell; % with the 100 samples above and the 100ns alignment we automatically fullfill the segment alignment requirement +adcSegmentDuration=adcSamplesPerSegment*adcDwell; % with the 100 samples above and the 100ns alignment we automatically fulfill the segment alignment requirement if mod(adcSegmentDuration, sys.gradRasterTime)>eps error('ADC segmentation model results in incorrect segment duration'); end @@ -130,7 +130,7 @@ % extends past the end of the trajectory (these points will have to be % discarded in the reconstruction, which is no problem). However, the % ramp-down parts and the Z-spoiler now have to be added to the readout -% block otherwise there will be a gap inbetween +% block otherwise there will be a gap between % gz_spoil.delay=mr.calcDuration(gx); % gx_spoil.delay=gz_spoil.delay; % gy_spoil.delay=gz_spoil.delay; diff --git a/src/ExternalSequence.cpp b/src/ExternalSequence.cpp index dc4a4295..f1d7ee49 100644 --- a/src/ExternalSequence.cpp +++ b/src/ExternalSequence.cpp @@ -766,7 +766,7 @@ bool ExternalSequence::load(std::string path) if (m_blockDurations_ru[b]) // non-zero means old delay library reference { if (tmpDelayLibrary.end()==tmpDelayLibrary.find(m_blockDurations_ru[b])) { - print_msg(ERROR_MSG, std::ostringstream().flush() << "*** ERROR: invalid delay library reference " << m_blockDurations_ru[b] << " in block " << b << " detected while convering the Pulseq file from older version"); + print_msg(ERROR_MSG, std::ostringstream().flush() << "*** ERROR: invalid delay library reference " << m_blockDurations_ru[b] << " in block " << b << " detected while covering the Pulseq file from older version"); return false; } duration=tmpDelayLibrary[m_blockDurations_ru[b]]; // we know delay is still 0, see above @@ -1015,7 +1015,7 @@ bool ExternalSequence::decodeBlock(SeqBlock *block) (shapeTime.samples.size()==3 || shapeTime.samples.size()==4)) { // size=3: 1 1 N-2; size=4: t0 d d N-3 - // in both cases the actuall dwell time is stored at shapeTime.samples[1] + // in both cases the actual dwell time is stored at shapeTime.samples[1] fDwellTime_us=m_dRadiofrequencyRasterTime_us*shapeTime.samples[1]; // no need to unpack } else