seqeyes-python 0.4.0__py3-none-any.whl → 0.4.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- seqeyes/__init__.py +1 -1
- seqeyes/_plot.py +1 -1
- seqeyes/_renderer.py +6 -5
- seqeyes/resources/pulseq-bundle.js +11 -4
- seqeyes/resources/viewer.html +3 -3
- seqeyes/resources/webview-bundle.js +1180 -7
- {seqeyes_python-0.4.0.dist-info → seqeyes_python-0.4.1.dist-info}/METADATA +1 -1
- seqeyes_python-0.4.1.dist-info/RECORD +10 -0
- seqeyes_python-0.4.0.dist-info/RECORD +0 -10
- {seqeyes_python-0.4.0.dist-info → seqeyes_python-0.4.1.dist-info}/WHEEL +0 -0
seqeyes/__init__.py
CHANGED
seqeyes/_plot.py
CHANGED
|
@@ -120,7 +120,7 @@ def _ensure_patched() -> None:
|
|
|
120
120
|
show_blocks: bool = False,
|
|
121
121
|
time_range: Any = (0, float("inf")),
|
|
122
122
|
time_disp: str = "s",
|
|
123
|
-
grad_disp: str = "
|
|
123
|
+
grad_disp: str = "mT/m",
|
|
124
124
|
**kwargs: Any,
|
|
125
125
|
) -> None:
|
|
126
126
|
# Merge globals — per‑call args take precedence
|
seqeyes/_renderer.py
CHANGED
|
@@ -76,7 +76,7 @@ def _read_viewer_template() -> str:
|
|
|
76
76
|
|
|
77
77
|
def _normalize_grad_disp(unit: str) -> str:
|
|
78
78
|
"""Return a viewer-supported gradient unit."""
|
|
79
|
-
return unit if unit in _VALID_GRAD_UNITS else "
|
|
79
|
+
return unit if unit in _VALID_GRAD_UNITS else "mT/m"
|
|
80
80
|
|
|
81
81
|
|
|
82
82
|
def _build_html(
|
|
@@ -88,7 +88,7 @@ def _build_html(
|
|
|
88
88
|
show_blocks: bool = False,
|
|
89
89
|
time_range: tuple = (0, float("inf")),
|
|
90
90
|
time_disp: str = "s",
|
|
91
|
-
grad_disp: str = "
|
|
91
|
+
grad_disp: str = "mT/m",
|
|
92
92
|
) -> str:
|
|
93
93
|
"""Assemble the complete viewer HTML.
|
|
94
94
|
|
|
@@ -109,7 +109,8 @@ def _build_html(
|
|
|
109
109
|
time_disp : str
|
|
110
110
|
Initial time display unit (``"s"``, ``"ms"``, ``"us"``).
|
|
111
111
|
grad_disp : str
|
|
112
|
-
Initial gradient display unit (``"
|
|
112
|
+
Initial gradient display unit (``"mT/m"``, the default, ``"Hz/m"``
|
|
113
|
+
or ``"G/cm"``).
|
|
113
114
|
"""
|
|
114
115
|
template = _read_viewer_template()
|
|
115
116
|
grad_disp = _normalize_grad_disp(grad_disp)
|
|
@@ -189,7 +190,7 @@ class SeqEyesViewer:
|
|
|
189
190
|
time_disp : str
|
|
190
191
|
Time axis unit — ``"s"``, ``"ms"``, or ``"us"``.
|
|
191
192
|
grad_disp : str
|
|
192
|
-
Gradient axis unit — ``"
|
|
193
|
+
Gradient axis unit — ``"mT/m"`` (default), ``"Hz/m"``, or ``"G/cm"``.
|
|
193
194
|
theme : str or None
|
|
194
195
|
Colour theme.
|
|
195
196
|
width : str
|
|
@@ -206,7 +207,7 @@ class SeqEyesViewer:
|
|
|
206
207
|
show_blocks: bool = False,
|
|
207
208
|
time_range: tuple = (0, float("inf")),
|
|
208
209
|
time_disp: str = "s",
|
|
209
|
-
grad_disp: str = "
|
|
210
|
+
grad_disp: str = "mT/m",
|
|
210
211
|
theme: Optional[str] = None,
|
|
211
212
|
width: str = "100%",
|
|
212
213
|
height: str = "550px",
|
|
@@ -90,7 +90,7 @@ var Pulseq = (() => {
|
|
|
90
90
|
});
|
|
91
91
|
|
|
92
92
|
// package.json
|
|
93
|
-
var version = "0.4.
|
|
93
|
+
var version = "0.4.1";
|
|
94
94
|
|
|
95
95
|
// src/pulseq/decompressor.ts
|
|
96
96
|
function decompressShape(compressed, numSamples) {
|
|
@@ -2648,7 +2648,8 @@ var Pulseq = (() => {
|
|
|
2648
2648
|
if (useM4) reduceM4Range(time, values, clipped.start, clipped.end, this.cap, this.emit);
|
|
2649
2649
|
else reduceUniformRange(time, values, clipped.start, clipped.end, this.cap, this.emit);
|
|
2650
2650
|
this.wrapPhase = false;
|
|
2651
|
-
|
|
2651
|
+
const kept = this.cursor - origin;
|
|
2652
|
+
return kept < clipped.end - clipped.start ? { o: origin, n: kept, r: true } : { o: origin, n: kept };
|
|
2652
2653
|
}
|
|
2653
2654
|
};
|
|
2654
2655
|
function discard() {
|
|
@@ -2824,9 +2825,11 @@ var Pulseq = (() => {
|
|
|
2824
2825
|
band.polarFlipDeg,
|
|
2825
2826
|
band.mz
|
|
2826
2827
|
]);
|
|
2827
|
-
|
|
2828
|
+
const packed = {
|
|
2828
2829
|
s: rf.startTime,
|
|
2829
2830
|
d: rf.duration,
|
|
2831
|
+
// Absolute effective centre, the point TE and TR are measured from.
|
|
2832
|
+
c: rf.centerTime,
|
|
2830
2833
|
// `t`/`m` (magnitude) and `pt`/`p` (phase) buffer spans.
|
|
2831
2834
|
o: magnitude.o,
|
|
2832
2835
|
n: magnitude.n,
|
|
@@ -2845,9 +2848,11 @@ var Pulseq = (() => {
|
|
|
2845
2848
|
u: rf.use || "u"
|
|
2846
2849
|
// 'e'=excitation, 'r'=refocusing, 'i'=inversion, 's'=saturation, 'u'=undefined
|
|
2847
2850
|
};
|
|
2851
|
+
if (magnitude.r) packed.r = 1;
|
|
2852
|
+
return packed;
|
|
2848
2853
|
}
|
|
2849
2854
|
function packGrad(grad, ref) {
|
|
2850
|
-
|
|
2855
|
+
const packed = {
|
|
2851
2856
|
s: grad.startTime,
|
|
2852
2857
|
d: grad.duration,
|
|
2853
2858
|
o: ref.o,
|
|
@@ -2856,6 +2861,8 @@ var Pulseq = (() => {
|
|
|
2856
2861
|
ty: grad.type,
|
|
2857
2862
|
ch: grad.channel
|
|
2858
2863
|
};
|
|
2864
|
+
if (ref.r) packed.r = 1;
|
|
2865
|
+
return packed;
|
|
2859
2866
|
}
|
|
2860
2867
|
function waveformMagnitudeMetrics(time, values) {
|
|
2861
2868
|
const count = Math.min(time.length, values.length);
|
seqeyes/resources/viewer.html
CHANGED
|
@@ -114,7 +114,7 @@ body.layout-vertical #rc{flex-direction:row;gap:4px;top:6px;left:4px}
|
|
|
114
114
|
<span class="ulbl">Theme:</span><select id="theme"><option value="system">System</option><option value="light">Light</option><option value="dark">Dark</option><option value="dracula">Dracula</option><option value="nord">Nord</option><option value="onelight">One Light</option><option value="onedark">One Dark</option><option value="githublight">GitHub Light</option><option value="github">GitHub</option></select>
|
|
115
115
|
<div class="sep"></div>
|
|
116
116
|
<span class="ulbl">Time:</span><select id="tu"><option value="s">s</option><option value="ms" selected>ms</option><option value="us">µs</option></select>
|
|
117
|
-
<span class="ulbl">Grad:</span><select id="gu"><option value="Hz/m"
|
|
117
|
+
<span class="ulbl">Grad:</span><select id="gu"><option value="Hz/m">Hz/m</option><option value="mT/m" selected>mT/m</option><option value="G/cm">G/cm</option></select>
|
|
118
118
|
<div class="sep"></div>
|
|
119
119
|
<label class="li" id="bbt" title="Toggle block boundary lines"><input type="checkbox" id="bbc" style="margin:0;cursor:pointer"><span style="font-size:11px;color:var(--fg)">Blocks</span></label>
|
|
120
120
|
<div class="sep"></div><div class="lg" id="legend"></div>
|
|
@@ -171,7 +171,7 @@ var CH_ORDER=[0,1,2,3,4,5,6,11,7,8,9,10];
|
|
|
171
171
|
var ox=0,sc=1;
|
|
172
172
|
var dr=false,dsx=0,dso=0;
|
|
173
173
|
var cursorT=0,cursorActive=false;
|
|
174
|
-
var timeUnit='ms',gradUnit='
|
|
174
|
+
var timeUnit='ms',gradUnit='mT/m';
|
|
175
175
|
var showBB=false;
|
|
176
176
|
var GAMMA=42576;
|
|
177
177
|
var ampZoom=[1,1,1,1,1,1,1,1,1,1,1,1];
|
|
@@ -201,7 +201,7 @@ function scheduleViewerDraw(includeMinimap){
|
|
|
201
201
|
// ── Unit conversion ──
|
|
202
202
|
function gradConv(v){if(gradUnit==='mT/m')return v/GAMMA;if(gradUnit==='G/cm')return v/(GAMMA*10);return v;}
|
|
203
203
|
function gradUnitStr(){return gradUnit;}
|
|
204
|
-
function normalizeGradUnit(unit){return(unit==='mT/m'||unit==='G/cm'||unit==='Hz/m')?unit:'
|
|
204
|
+
function normalizeGradUnit(unit){return(unit==='mT/m'||unit==='G/cm'||unit==='Hz/m')?unit:'mT/m';}
|
|
205
205
|
function timeConv(t){if(timeUnit==='ms')return t*1e3;if(timeUnit==='us')return t*1e6;return t;}
|
|
206
206
|
function timeUnitStr(){return timeUnit;}
|
|
207
207
|
|