ReconResult

Contents

ReconResult#

class pulserver.recon.ReconResult[source]#

Bases: object

Image array for the runtime to package as an MRD image, or as DICOM.

The runtime builds the image header, so a plugin builds none. The field of view and matrix are those of the unit’s own encoding space; position, orientation, table position and physiology time stamps are those of reference; the acquisition time stamp is the earliest of the unit’s imaging acquisitions. Plugins may return ismrmrd.Image objects instead.

The MRD image holds the values of data unchanged, in float32 for real floating-point data and complex64 for complex data; wider types are downcast and integer types are kept. Integers are made only where DICOM is written, from the floating-point values, by one rescale mapping per series_index.

Parameters:
  • data (Any) – NumPy array or Torch tensor, on any device. A (z, y, x) array becomes one image per partition, each stating the smallest and largest value of the array, of its magnitude when complex, in its meta attributes ArrayMinimum and ArrayMaximum.

  • reference (Any) – Acquisition the image takes its geometry from, such as an element of ReconBuffer.headers. None is the unit’s reference acquisition, ReconBuffer.reference. An integer indexes the imaging acquisitions of the unit, negative values counting from the end, and is deprecated.

  • series_index (int) – MRD image_series_index, which also selects the DICOM series.

  • image_index (int | None) – MRD image_index; None numbers images consecutively.

  • image_type (str) – "magnitude", "phase", "real", "imaginary" or "complex".

  • attributes (collections.abc.Mapping[str, Any]) – MRD meta attributes, merged over the runtime’s defaults. In a DICOM image RescaleSlope and RescaleIntercept state the mapping value = stored * slope + intercept of its stored integers.

  • dicom (bool) – Convert the image to DICOM before sending it.

Examples

>>> import numpy as np
>>> import pulserver.recon as recon
>>> result = recon.ReconResult(np.zeros((4, 4)), series_index=2)
>>> result.data.shape, result.series_index, result.image_type
((4, 4), 2, 'magnitude')

Attributes