v0.3.0
What's Changed
- add lock by @headmeister in #105
- Fix PV-360 loading add new datasets by @headmeister in #106
- purge remainder of Ser support by @headmeister in #107
- random access fixes by @headmeister in #108
- study manipulation fixes by @headmeister in #109
- mark zenodo data optional by @headmeister in #110
- cli fix, normalization fix by @headmeister in #111
- JCAMPDX fixes by @headmeister in #112
scheme_idis a name-only PULPROG allow-list with no fallback — radi… by @headmeister in #113- PV7/PV360
2dseqgeometry silently degrades to an identity affine by @headmeister in #114 - EPI
encoding_spaceassumesPVM_DigNp == PVM_EncMatrixproduct — r… by @headmeister in #115 Datasettype detection has no subtype allow-list —.npz/.json… by @headmeister in #116- relax traj loading error by @headmeister in #117
Schema2dseq._scale_framesBW branch is not the inverse of FW — writ… by @headmeister in #118Folder.__getattr__raisesKeyErrorinstead ofAttributeError— … by @headmeister in #119- CSI:
_reorder_fid_linescrashes with a broadcastValueErroron no… by @headmeister in #120 _read_binary_file: every size mismatch reported as "dimension misma… by @headmeister in #121scheme_id: ZTE is shadowed by RADIAL — dedicated ZTE branches are d… by @headmeister in #122_reorder_fid_linesno-op guard compares argsort indices to raw `PVM… by @headmeister in #123- EPI acquisition-trim assumes the discarded region is at the front by @headmeister in #124
Dataset._sub_parametersuses globalstr.replace, corrupting prefi… by @headmeister in #125- Dev jv by @headmeister in #126
- Dev jv by @headmeister in #127
Full Changelog: v0.2.6...v0.3.0
brukerapi 0.3.0 — Breaking changes
Version 0.3.0 substantially improves support for ParaVision 5.1, 6.0.1, 7,
and PV360 data. It also corrects several long-standing parsing, layout, and
serialization defects. Some corrections change public names, accepted inputs,
array layouts, or numeric results.
Migration checklist
- Replace
UnsuportedDatasetTypewithUnsupportedDatasetType. - Replace
DatasetTypeMissmatchwithDatasetTypeMismatch. - Replace the FID property
acq_lenghtwithacq_length. - Replace
SchemaRawdata.seralize(...)with
SchemaRawdata.serialize(...). - Stop constructing
serdatasets; TopSpin/NMRseris not supported. - If raw
FG_COMPLEXframes are required, construct 2dseq datasets with
combine_complex=False. - Remove any downstream slice reversal, phase-line reordering, or 2dseq
scaling workarounds that compensated for the old behavior. - Review code that catches
KeyErrorfrom missingFolderattributes; these
misses now correctly raiseAttributeError. - Review consumers of
Dataset.to_dict(): internaltypeandsubtypekeys
are no longer included.
Renamed and removed API
Corrected exception names
The misspelled exception classes were renamed without compatibility aliases:
| Before | 0.3.0 |
|---|---|
UnsuportedDatasetType |
UnsupportedDatasetType |
DatasetTypeMissmatch |
DatasetTypeMismatch |
Imports and exception handlers using the old names must be updated.
Corrected FID property name
The public/configured property acq_lenght is now acq_length. This affects
attribute access, custom property recipes, reports, and saved reference data.
Removed ser support
The incomplete ser implementation, including SchemaSer and the
DEFAULT_STATES["ser"] entry, was removed. Attempting to construct a ser
dataset now raises UnsupportedDatasetType instead of failing later with an
internal exception.
Removed misspelled serialization alias
The unused SchemaRawdata.seralize alias was removed. Use
SchemaRawdata.serialize.
JCAMP-DX helper signatures
The serialization helpers now require the JCAMP-DX version:
serialize_value(value, version)
serialize_list(value, version)
serialize_nested_list(values, version)
serialize_ndarray(value, version)Direct positional construction of GenericParameter and DataParameter must
use the corrected order:
(key_str, size_str, val_str, version)Dataset discovery and validation
Dataset suffixes are now checked against a supported-subtype allow-list.
Sidecars such as fid.npz, 2dseq.json, and arbitrary rawdata.* files are
rejected instead of being misidentified as scanner data.
The auxiliary files fid.spiral, fid.navFid, and fid.orig are loaded as
FID companion subdatasets and exposed through:
dataset.fid_companionsFolder discovery likewise ignores unsupported rawdata.<suffix> sidecars.
Code that relied on these files appearing in the dataset tree will observe a
different inventory.
Array dtype, shape, and ordering
Complex 2dseq images
COMPLEX_IMAGE/FG_COMPLEX reconstructions are now returned as complex arrays
by default. The former real-valued FG_COMPLEX frame axis is removed during
assembly.
To retain the raw frame representation:
dataset = Dataset(path, combine_complex=False)Real-only FID acquisition
For AQ_mod=qf, FID data remains real. It is no longer incorrectly
deinterleaved as real/imaginary sample pairs.
Slice and phase ordering
VisuCoreDiskSliceOrder=disk_reverse_slice_orderis normalized on read.- RARE/EPI phase-line reordering uses corrected indices and guards.
- CSI reordering no longer assumes square encoding dimensions.
- ZTE reaches its dedicated layout instead of being shadowed by RADIAL.
- Ramp/navigator EPI layouts use the actual digitized sample count.
- EPI acquisition trimming now accounts for the stored block layout.
Applications that manually corrected any of these layouts should remove those
workarounds to avoid applying the correction twice.
Numeric values and geometry
2dseq scaling now consistently implements:
real = stored * slope + offset
stored = (real - offset) / slope
RECO_map_slope and RECO_map_offset are used when the corresponding Visu
values are unavailable. Previously serialized data may therefore differ from
0.3.0 output, and values loaded from incomplete Visu metadata may now be
scaled.
PV7 and PV360 2dseq geometry now uses version-independent Visu geometry as a
fallback. Affines that previously degraded silently to identity matrices will
now contain the derived spacing and orientation.
Custom radial, UTE, CSI, and other non-Cartesian sequences can now infer a
scheme from acquisition metadata. Code that used load failure to identify an
unknown sequence should inspect dataset.scheme_id instead. An explicit
override remains available:
dataset = Dataset(path, scheme_id="RADIAL")JCAMP-DX parsing and serialization
Correct parsing can change values returned for:
- angle-bracket strings containing commas or parentheses;
@N*(value)compression occurring anywhere in an array;- exponential and non-numeric compressed values;
- multiline values;
(XY..XY)data records; and- compact size declarations such as
(2).
Serialized JCAMP-DX output now:
- preserves
$$comments; - emits
##END=without trailing whitespace; - keeps lines within Bruker's 78-column convention; and
- correctly serializes floats, lists, nested arrays, and data parameters.
Files written by 0.3.0 may therefore differ byte-for-byte from files written
by earlier releases.
Exceptions, queries, and reports
- Missing
Folderattributes now raiseAttributeError, as required by
Python's attribute protocol. Dictionary-style access continues to raise
KeyError. - Malformed
Dataset.query()expressions raiseFilterEvalFalserather than
leakingNameError,SyntaxError, orTypeError. - Query evaluation uses a restricted namespace. Expressions relying on
arbitrary builtins, imports, or module globals are no longer supported. Dataset.to_dict()excludes internaltypeandsubtypefields and
preserves property order.- Empty reconstructions, Git LFS pointer files, unsupported suffixes, missing
parameter files, and binary-size mismatches now produce more specific
diagnostics. Code matching older exception strings may need adjustment.
Compatibility and test coverage
The test suite covers ParaVision 5.1, 6.0.1, 7.0.0, and PV360 3.x corpora,
including rawdata jobs, corrected 2dseq geometry/scaling, and random access.
PV360 external corpus coverage remains soft in environments where that corpus
is unavailable.