Skip to content

Commit

Permalink
see CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ThoHiller committed Jun 30, 2022
1 parent beff9fc commit 9843ea8
Show file tree
Hide file tree
Showing 28 changed files with 552 additions and 247 deletions.
3 changes: 3 additions & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**BLOCHUS** is developed by

* Thomas Hiller (since 2019), [email protected]
6 changes: 3 additions & 3 deletions BLOCHUS/BLOCHUS.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
%------------- BEGIN CODE --------------

%% GUI 'header' info and default GUI settings
myui.version = '0.1.4';
myui.date = '25.09.2020';
myui.version = '0.1.5';
myui.date = '30.06.2022';
myui.author = 'Thomas Hiller';
myui.email = 'thomas.hiller[at]leibniz-liag.de';
myui.email = 'thomas.hiller[at]bgr.de';

myui.fontsize = 9;
myui.axfontsize = 11;
Expand Down
2 changes: 1 addition & 1 deletion BLOCHUS/BLOCHUS_loadDefaults.m
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
% pre-polarization B-field amplitude in units of [B0]
init.PrePolFactor = [100 1e-6 1e6];
% polar angle of pre-polarization field [deg]
init.PrePolTheta = [90 0 360];
init.PrePolTheta = [90 1e-3 360];
% azimuthal angle of pre-polarization field [deg]
init.PrePolPhi = [0 0 360];
% pre-polarization B-field switch amplitude in units of [B0]
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## [0.1.5] - 2022-06-30

### Added
- custom pre-polarization current switch-off ramps are now supported via an interpolation routine (so far only via script and in MATLAB<sup>TM</sup>)

### Changed
- now multiple angle-axis-pairs are allowed as input for function `getRotationMatrixFromAngleandAxis`

### Fixed
- fixed an issue in `getRotationMatrixFromVectors` for very small angles between vectors A and B (also edge case like parallel and anti-parallel vectors are now considered)

## [0.1.4] - 2020-09-25

### Added
Expand Down Expand Up @@ -43,6 +54,7 @@

Initial Version

[0.1.5]: https://github.com/ThoHiller/nmr-blochus/compare/v0.1.4...v0.1.5
[0.1.4]: https://github.com/ThoHiller/nmr-blochus/compare/v0.1.3...v0.1.4
[0.1.3]: https://github.com/ThoHiller/nmr-blochus/compare/v0.1.2...v0.1.3
[0.1.2]: https://github.com/ThoHiller/nmr-blochus/compare/v.0.1.1...v0.1.2
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ In order to work properly you need to meet the following requirements:

#### Operating System

I tested it successfully under Windows 7 (64bit) and 10 (64bit) with Matlab R2017a and newer. Always with the latest version of the GUI Layout Toolbox (current version is v2.3.4)
I tested it successfully under Windows 7 (64bit) and 10 (64bit) with Matlab R2017a and newer. Always with the latest version of the GUI Layout Toolbox (current version is v2.3.5)

**NOTE:** So far I did not test anything on Linux or a Mac. If you get it to work on either of the two systems (which it basically should I guess) please let me know.

Expand All @@ -63,7 +63,7 @@ I tested it successfully under Windows 7 (64bit) and 10 (64bit) with Matlab R201
<a name="usage"></a>
### Usage

1. By executing the start scripts (see above)
1. By executing the start script (see above)
2. Simply type `BLOCHUS` on the MATLAB<sup>TM</sup> prompt (make sure the `blochus` folder is on the MATLAB<sup>TM</sup> path)
3. Check the example scripts for the usage of the core functions without the GUI (inside the `scripts` folder)

Expand All @@ -87,14 +87,15 @@ In no particular order and without guarantee that it will ever happen :-) :
### Cite as
If you use BLOCHUS for your research, please cite it as:

Thomas Hiller. (2020, September 25). ThoHiller/nmr-blochus: v0.1.4 (Version v0.1.4). Zenodo. [https://doi.org/10.5281/zenodo.3829464]
Thomas Hiller. (2020, September 25). ThoHiller/nmr-blochus: v0.1.5 (Version v0.1.5). Zenodo. [https://doi.org/10.5281/zenodo.3829464]

Note: Even though the version number might change due to updates, this DOI is permanent (represents all versions) and always links to the latest version.


### References

1. Hiller, T., Dlugosch, R. and Müller-Petke, M., "Utilizing pre-polarization to enhance SNMR signals - effect of imperfect switch-off", Geophysical Journal International **222**(2), p.815-826, 2020, [DOI](https://doi.org/10.1093/gji/ggaa216)
1. Hiller, T., Costabel, S., Dlugosch, R. and Müller-Petke, M. "First Measurements of Surface Nuclear Magnetic Resonance Signals Without an Oscillating Excitation Pulse – Exploiting Non-Adiabatic Prepolarization Switch-Off", Geophysical Research Letters, **48**(23), e2021GL095371, 2021, [DOI](https://doi.org/10.1029/2021GL095371)
1. Hiller, T., Costabel, S., Radic, T., Dlugosch, R. and Müller-Petke, M. "Feasibility study on prepolarized surface nuclear magnetic resonance for soil moisture measurements", Vadose Zone Journal, **20**(5), e20138, 2021, [DOI](https://doi.org/10.1002/vzj2.20138)
2. Hiller, T., Dlugosch, R. and Müller-Petke, M., "Utilizing pre-polarization to enhance SNMR signals - effect of imperfect switch-off", Geophysical Journal International **222**(2), p.815-826, 2020, [DOI](https://doi.org/10.1093/gji/ggaa216)

- - -
<p style="text-align: center;"> MATLAB is a registered trademark of The Mathworks, Inc. </p>
6 changes: 3 additions & 3 deletions doc/blochus/BLOCHUS/BLOCHUS.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" sr
0033 <span class="comment">%------------- BEGIN CODE --------------</span>
0034
0035 <span class="comment">%% GUI 'header' info and default GUI settings</span>
0036 myui.version = <span class="string">'0.1.4'</span>;
0037 myui.date = <span class="string">'25.09.2020'</span>;
0036 myui.version = <span class="string">'0.1.5'</span>;
0037 myui.date = <span class="string">'30.06.2022'</span>;
0038 myui.author = <span class="string">'Thomas Hiller'</span>;
0039 myui.email = <span class="string">'thomas.hiller[at]leibniz-liag.de'</span>;
0039 myui.email = <span class="string">'thomas.hiller[at]bgr.de'</span>;
0040
0041 myui.fontsize = 9;
0042 myui.axfontsize = 11;
Expand Down
16 changes: 8 additions & 8 deletions doc/blochus/BLOCHUS/BLOCHUS_loadDefaults.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,15 @@ <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" sr
0099 init.M0 = [0 0 1];
0100 <span class="comment">% initial magnetization [A/m]</span>
0101 init.Minit = [1 0 0];
0102 <span class="comment">% Earth's magnetic field [T] default: 48µT min: 1fT max: 1T</span>
0102 <span class="comment">% Earth's magnetic field [T] default: 48µT min: 1fT max: 1T</span>
0103 init.B0 = [48/1e6 1e-12 1];
0104 <span class="comment">% corresponding Larmor frequencies [Hz]</span>
0105 init.Omega0 = [<a href="../../blochus/functions/blochsim/getOmega0.html" class="code" title="function omega0 = getOmega0(gamma,B)">getOmega0</a>(init.gamma,init.B0(1))/2/pi -1e9 1e9];
0106 <span class="comment">% T1 relaxation time [ms] default: 100ms min: 1µs max: 1000s</span>
0106 <span class="comment">% T1 relaxation time [ms] default: 100ms min: 1µs max: 1000s</span>
0107 init.T1relax = [100 1e-3 1e6];
0108 <span class="comment">% T2 relaxation time [ms] default: 50ms min: 1µs max: 1000s</span>
0108 <span class="comment">% T2 relaxation time [ms] default: 50ms min: 1µs max: 1000s</span>
0109 init.T2relax = [50 1e-3 1e6];
0110 <span class="comment">% simulation time [ms] default: 50ms min: 1µs max: 1000s</span>
0110 <span class="comment">% simulation time [ms] default: 50ms min: 1µs max: 1000s</span>
0111 init.Tsim = [50 1e-3 1e6];
0112
0113 <span class="comment">% --- PRE-POLARIZATION ---</span>
Expand All @@ -189,14 +189,14 @@ <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" sr
0118 <span class="comment">% pre-polarization B-field amplitude in units of [B0]</span>
0119 init.PrePolFactor = [100 1e-6 1e6];
0120 <span class="comment">% polar angle of pre-polarization field [deg]</span>
0121 init.PrePolTheta = [90 0 360];
0121 init.PrePolTheta = [90 1e-3 360];
0122 <span class="comment">% azimuthal angle of pre-polarization field [deg]</span>
0123 init.PrePolPhi = [0 0 360];
0124 <span class="comment">% pre-polarization B-field switch amplitude in units of [B0]</span>
0125 init.PrePolSwitchFactor = [1 1e-6 1e6];
0126 <span class="comment">% switch-off ramp time [ms] default: 1ms min: 1µs max: 1000s</span>
0126 <span class="comment">% switch-off ramp time [ms] default: 1ms min: 1µs max: 1000s</span>
0127 init.PrePolTramp = [1 1e-6 1e6];
0128 <span class="comment">% switch-off ramp slope time [ms] default: 0.1ms min: 1µs max: 1000s</span>
0128 <span class="comment">% switch-off ramp slope time [ms] default: 0.1ms min: 1µs max: 1000s</span>
0129 init.PrePolTslope = [0.1 1e-6 1e6];
0130
0131 <span class="comment">% --- PULSE ---</span>
Expand All @@ -208,7 +208,7 @@ <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" sr
0137 init.PulsePolarization = <span class="string">'circular'</span>;
0138 <span class="comment">% relaxation during pulse [0/1]</span>
0139 init.PulseRDP = 0;
0140 <span class="comment">% pulse length [ms] default: 20ms min: 1µs max: 1000s</span>
0140 <span class="comment">% pulse length [ms] default: 20ms min: 1µs max: 1000s</span>
0141 init.PulseTtau = [20 1e-6 1e6];
0142 <span class="comment">% pulse amplitude in units of [B0] default: 0.0061163 min: 1e-12 max: 1e6</span>
0143 init.PulseB1Factor = [0.0061163 1e-12 1e6];
Expand Down
2 changes: 1 addition & 1 deletion doc/blochus/functions/blochsim/fcn_BLOCHUS_ode.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" sr
0057
0058 <span class="keyword">switch</span> param.type
0059 <span class="keyword">case</span> <span class="string">'std'</span>
0060 B = B0*zunit;
0060 B = B0*zunit;
0061 <span class="comment">% dM/dt</span>
0062 dM = gamma*cross(m,B) - ( (m(1)*xunit+m(2)*yunit) / T2 ) - ( ((m(3)-M0(3))*zunit) / T1 );
0063
Expand Down
4 changes: 2 additions & 2 deletions doc/blochus/functions/blochsim/getMIDI_Tx.html
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" sr
0246 x(locu) = I*ones(size(locu));
0247
0248 <span class="comment">% now create an artificial y-component by shifting the original signal</span>
0249 <span class="comment">% (x-component) 90° (quarter of a full period)</span>
0249 <span class="comment">% (x-component) 90° (quarter of a full period)</span>
0250 <span class="comment">% get the length of a quarter period</span>
0251 t90 = dtL/4;
0252 <span class="comment">% cut out these first samples and put them to the end of the original signal</span>
Expand All @@ -330,7 +330,7 @@ <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" sr
0259 <span class="comment">% pulse this is already taken care of during assembling)</span>
0260 <span class="keyword">if</span> strcmp(param.Tx,<span class="string">'MIDI_OR'</span>) &amp;&amp; isfield(param,<span class="string">'PulseAxis'</span>)
0261 <span class="comment">% depending on the frequency, there is a different amount of time</span>
0262 <span class="comment">% steps for the &quot;90° phase shift&quot;</span>
0262 <span class="comment">% steps for the &quot;90° phase shift&quot;</span>
0263 shiftind = sum(t&lt;t90);
0264 <span class="comment">% now shift both components by the necessary amount of samples</span>
0265 <span class="keyword">switch</span> param.PulseAxis
Expand Down
89 changes: 46 additions & 43 deletions doc/blochus/functions/blochsim/getPulseTimeSeries.html
Original file line number Diff line number Diff line change
Expand Up @@ -214,50 +214,53 @@ <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" sr
0124 <span class="keyword">if</span> Imod.useQ &amp;&amp; Imod.Q &gt; 0
0125 <span class="comment">% get line (band) width -&gt; f_L/Q (simple bandwidth for bandpass)</span>
0126 Lwidth = abs(param.omega0/2/pi) / Imod.Q;
0127 <span class="comment">% apply &quot;Breit-Wigner&quot; formula (here already normalized to 1 by</span>
0128 <span class="comment">% multiplying with pi*Lwidth)</span>
0129 L = 1 ./ ( ((df+Imod.Qdf).^2 ./ Lwidth.^2) + 1 );
0130 I = I.*L;
0131 <span class="keyword">end</span>
0132
0133 <span class="comment">% get instantaneous phase due to frequency modulation</span>
0134 theta = <a href="getPulsePhase.html" class="code" title="function theta = getPulsePhase(t,df,param,flag)">getPulsePhase</a>(t,df,param,0);
0135
0136 <span class="keyword">switch</span> PulsePolarization
0137 <span class="keyword">case</span> <span class="string">'circular'</span>
0138 Bout = I.*Amp.*[cos(theta + phi + phi_ax + phi_ref) <span class="keyword">...</span>
0139 sin(theta + phi + phi_ax + phi_ref)];
0140 <span class="keyword">case</span> <span class="string">'linear'</span>
0141 Bout = 2.*I.*Amp.*[cos(theta + phi + phi_ax + phi_ref) <span class="keyword">...</span>
0142 0.*t];
0143 <span class="keyword">end</span>
0144 <span class="keyword">end</span>
0145 <span class="comment">% if B-field values are NaN, set them to zero</span>
0146 <span class="comment">% this can happen due to the interpolation at the end of the MIDI-pulses</span>
0147 Bout(isnan(Bout)) = 0;
0148
0149 <span class="keyword">end</span>
0150
0151 <span class="comment">%------------- END OF CODE --------------</span>
0152
0153 <span class="comment">%% License:</span>
0154 <span class="comment">% GNU GPLv3</span>
0155 <span class="comment">%</span>
0156 <span class="comment">% BLOCHUS</span>
0157 <span class="comment">% Copyright (C) 2019 Thomas Hiller</span>
0127 <span class="comment">% apply Cauchy-Lorentz type formula (here already normalized to</span>
0128 <span class="comment">% 1 by multiplying with pi*Lwidth)</span>
0129 <span class="comment">% this is basically a Cauchy distribution PDF of the form:</span>
0130 <span class="comment">% PDF = 1/pi * ( bw / ((f-f0)^2 + bw^2) )</span>
0131 <span class="comment">% tweaked with some algebra</span>
0132 L = 1 ./ ( ((df+Imod.Qdf).^2 ./ Lwidth.^2) + 1 );
0133 I = I.*L;
0134 <span class="keyword">end</span>
0135
0136 <span class="comment">% get instantaneous phase due to frequency modulation</span>
0137 theta = <a href="getPulsePhase.html" class="code" title="function theta = getPulsePhase(t,df,param,flag)">getPulsePhase</a>(t,df,param,0);
0138
0139 <span class="keyword">switch</span> PulsePolarization
0140 <span class="keyword">case</span> <span class="string">'circular'</span>
0141 Bout = I.*Amp.*[cos(theta + phi + phi_ax + phi_ref) <span class="keyword">...</span>
0142 sin(theta + phi + phi_ax + phi_ref)];
0143 <span class="keyword">case</span> <span class="string">'linear'</span>
0144 Bout = 2.*I.*Amp.*[cos(theta + phi + phi_ax + phi_ref) <span class="keyword">...</span>
0145 0.*t];
0146 <span class="keyword">end</span>
0147 <span class="keyword">end</span>
0148 <span class="comment">% if B-field values are NaN, set them to zero</span>
0149 <span class="comment">% this can happen due to the interpolation at the end of the MIDI-pulses</span>
0150 Bout(isnan(Bout)) = 0;
0151
0152 <span class="keyword">end</span>
0153
0154 <span class="comment">%------------- END OF CODE --------------</span>
0155
0156 <span class="comment">%% License:</span>
0157 <span class="comment">% GNU GPLv3</span>
0158 <span class="comment">%</span>
0159 <span class="comment">% This program is free software: you can redistribute it and/or modify</span>
0160 <span class="comment">% it under the terms of the GNU General Public License as published by</span>
0161 <span class="comment">% the Free Software Foundation, either version 3 of the License, or</span>
0162 <span class="comment">% (at your option) any later version.</span>
0163 <span class="comment">%</span>
0164 <span class="comment">% This program is distributed in the hope that it will be useful,</span>
0165 <span class="comment">% but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
0166 <span class="comment">% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
0167 <span class="comment">% GNU General Public License for more details.</span>
0168 <span class="comment">%</span>
0169 <span class="comment">% You should have received a copy of the GNU General Public License</span>
0170 <span class="comment">% along with this program. If not, see &lt;https://www.gnu.org/licenses/&gt;.</span></pre></div>
0159 <span class="comment">% BLOCHUS</span>
0160 <span class="comment">% Copyright (C) 2019 Thomas Hiller</span>
0161 <span class="comment">%</span>
0162 <span class="comment">% This program is free software: you can redistribute it and/or modify</span>
0163 <span class="comment">% it under the terms of the GNU General Public License as published by</span>
0164 <span class="comment">% the Free Software Foundation, either version 3 of the License, or</span>
0165 <span class="comment">% (at your option) any later version.</span>
0166 <span class="comment">%</span>
0167 <span class="comment">% This program is distributed in the hope that it will be useful,</span>
0168 <span class="comment">% but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
0169 <span class="comment">% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
0170 <span class="comment">% GNU General Public License for more details.</span>
0171 <span class="comment">%</span>
0172 <span class="comment">% You should have received a copy of the GNU General Public License</span>
0173 <span class="comment">% along with this program. If not, see &lt;https://www.gnu.org/licenses/&gt;.</span></pre></div>
<hr><address>Generated by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> &copy; 2005</address>
</body>
</html>
Loading

0 comments on commit 9843ea8

Please sign in to comment.