Add Export Fused ROI CSV export
Lets a user export the current ROI as one CSV with a column per selected angle's value (RF peak freq, Bias A, Bias B, or velocity), once angles share a common (x, y) grid -- either via a live Fusion alignment result or because the open file is itself a previous Alignment Wizard export whose angles already share one grid on disk. Never triggers a background compute; angles without cached/stored data for the chosen value type are simply unavailable in the picker. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -770,6 +770,24 @@ class SrasFile:
|
||||
def y_positions_mm(self, angle_idx: int) -> np.ndarray:
|
||||
return self._y_pos_per_angle[angle_idx]
|
||||
|
||||
def angles_share_raw_grid(self) -> bool:
|
||||
"""True iff every angle's raw (x, y) pixel grid is literally the same
|
||||
array as angle 0's -- the case for a .sras file the viewer's own
|
||||
Alignment Wizard exported (see scan_format.md, "Files written by the
|
||||
viewer's Alignment Wizard"): the writer packs one Per-Angle Geometry
|
||||
record and one Row Table span and repeats those same bytes for every
|
||||
angle, so re-parsed arrays are bit-identical copies rather than
|
||||
independently re-derived numbers -- a bare np.array_equal is the
|
||||
correct test here, no tolerance needed.
|
||||
"""
|
||||
if self.n_angles <= 1:
|
||||
return True
|
||||
x0 = self.x_axis_mm(0)
|
||||
y0 = self.y_positions_mm(0)
|
||||
return all(np.array_equal(self.x_axis_mm(a), x0)
|
||||
and np.array_equal(self.y_positions_mm(a), y0)
|
||||
for a in range(1, self.n_angles))
|
||||
|
||||
def time_axis_ns(self) -> np.ndarray:
|
||||
return np.arange(self.samples_per_frame) / self.sample_rate_hz * 1e9
|
||||
|
||||
|
||||
Reference in New Issue
Block a user