seqeyes-python 0.4.0__tar.gz → 0.4.1__tar.gz

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.
Files changed (22) hide show
  1. {seqeyes_python-0.4.0 → seqeyes_python-0.4.1}/PKG-INFO +1 -1
  2. {seqeyes_python-0.4.0 → seqeyes_python-0.4.1}/examples/demo.ipynb +1 -1
  3. {seqeyes_python-0.4.0 → seqeyes_python-0.4.1}/pyproject.toml +1 -1
  4. {seqeyes_python-0.4.0 → seqeyes_python-0.4.1}/src/seqeyes/__init__.py +1 -1
  5. {seqeyes_python-0.4.0 → seqeyes_python-0.4.1}/src/seqeyes/_plot.py +1 -1
  6. {seqeyes_python-0.4.0 → seqeyes_python-0.4.1}/src/seqeyes/_renderer.py +6 -5
  7. {seqeyes_python-0.4.0 → seqeyes_python-0.4.1}/src/seqeyes/resources/pulseq-bundle.js +11 -4
  8. {seqeyes_python-0.4.0 → seqeyes_python-0.4.1}/src/seqeyes/resources/viewer.html +3 -3
  9. {seqeyes_python-0.4.0 → seqeyes_python-0.4.1}/src/seqeyes/resources/webview-bundle.js +1180 -7
  10. {seqeyes_python-0.4.0 → seqeyes_python-0.4.1}/tests/test_plot.py +3 -3
  11. {seqeyes_python-0.4.0 → seqeyes_python-0.4.1}/.gitignore +0 -0
  12. {seqeyes_python-0.4.0 → seqeyes_python-0.4.1}/README.md +0 -0
  13. {seqeyes_python-0.4.0 → seqeyes_python-0.4.1}/examples/demo.py +0 -0
  14. {seqeyes_python-0.4.0 → seqeyes_python-0.4.1}/src/seqeyes/resources/seqeyes-labels.js +0 -0
  15. {seqeyes_python-0.4.0 → seqeyes_python-0.4.1}/tests/conftest.py +0 -0
  16. {seqeyes_python-0.4.0 → seqeyes_python-0.4.1}/tests/debug_full.html +0 -0
  17. {seqeyes_python-0.4.0 → seqeyes_python-0.4.1}/tests/debug_minimal.html +0 -0
  18. {seqeyes_python-0.4.0 → seqeyes_python-0.4.1}/tests/debug_viewer.html +0 -0
  19. {seqeyes_python-0.4.0 → seqeyes_python-0.4.1}/tests/debug_viewer.py +0 -0
  20. {seqeyes_python-0.4.0 → seqeyes_python-0.4.1}/tests/integration_test.py +0 -0
  21. {seqeyes_python-0.4.0 → seqeyes_python-0.4.1}/tests/test_ismrmrd_fixture.py +0 -0
  22. {seqeyes_python-0.4.0 → seqeyes_python-0.4.1}/tests/test_renderer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: seqeyes-python
3
- Version: 0.4.0
3
+ Version: 0.4.1
4
4
  Summary: Interactive Pulseq MRI sequence viewer for Jupyter — lightweight, beautiful, replaces seq.plot() in pypulseq.
5
5
  Project-URL: Homepage, https://github.com/bughht/seqeyes_plugin
6
6
  Project-URL: Repository, https://github.com/bughht/seqeyes_plugin
@@ -311,7 +311,7 @@
311
311
  "| `show_blocks` | `False` | Show block‑boundary lines |\n",
312
312
  "| `time_range` | `(0, inf)` | Zoom to `(start_sec, end_sec)` |\n",
313
313
  "| `time_disp` | `\"s\"` | Time unit: `\"s\"`, `\"ms\"`, `\"us\"` |\n",
314
- "| `grad_disp` | `\"Hz/m\"` | Gradient unit: `\"Hz/m\"`, `\"Hz/m\"`, `\"mT/m\"`, `\"G/cm\"` |\n",
314
+ "| `grad_disp` | `\"mT/m\"` | Gradient unit: `\"mT/m\"`, `\"Hz/m\"`, `\"G/cm\"` |\n",
315
315
  "| `theme` | `\"system\"` | `\"light\"`, `\"dark\"`, `\"dracula\"`, `\"nord\"`, ... |"
316
316
  ]
317
317
  },
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "seqeyes-python"
7
- version = "0.4.0"
7
+ version = "0.4.1"
8
8
  description = "Interactive Pulseq MRI sequence viewer for Jupyter — lightweight, beautiful, replaces seq.plot() in pypulseq."
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
@@ -29,4 +29,4 @@ from seqeyes._plot import set, reset
29
29
  from seqeyes._renderer import SeqEyesViewer
30
30
 
31
31
  __all__ = ["set", "reset", "SeqEyesViewer"]
32
- __version__ = "0.4.0"
32
+ __version__ = "0.4.1"
@@ -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 = "Hz/m",
123
+ grad_disp: str = "mT/m",
124
124
  **kwargs: Any,
125
125
  ) -> None:
126
126
  # Merge globals — per‑call args take precedence
@@ -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 "Hz/m"
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 = "Hz/m",
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 (``"Hz/m"``, ``"mT/m"``, ``"G/cm"``).
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 — ``"Hz/m"``, ``"mT/m"``, or ``"G/cm"``.
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 = "Hz/m",
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.0";
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
- return { o: origin, n: this.cursor - origin };
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
- return {
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
- return {
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);
@@ -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" selected>Hz/m</option><option value="mT/m">mT/m</option><option value="G/cm">G/cm</option></select>
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='Hz/m';
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:'Hz/m';}
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