ReconBuffer#
- class pulserver.recon.ReconBuffer[source]#
Bases:
objectK-space of one encoding space, filled one acquisition at a time.
Along the readout of a Cartesian space, the samples of an acquisition from
discard_pretonumber_of_samples - discard_postare placed so that its echo,center_sample, lies at samplesamples // 2of the buffer. Along an encoded axis of a Cartesian space, a counter is placed atcounter - center + extent // 2,centerbeing the counter of the k-space centre the header’s limits state, so the centre line lies atextent // 2whatever the counters start at. A non-Cartesian space places a readout right-aligned and a counter as it is. The axes are those ofspace: its counters that vary and were asked for, then the encoded axes.- Parameters:
space – Encoding space to lay out.
coils – Channels to allocate;
space.coilswhen not given. Fewer than the header declares is valid, for data compressed before placement.samples – Samples to allocate along the readout;
space.readoutwhen not given.crop –
{axis: (first, stop)}for thephase_encodeandpartitionaxes: the positions of the space’s grid the buffer holds, the whole axis where an axis is not named.dtype – Complex dtype of
kspace.
- Attributes:
kspace (ndarray) – Shaped as
axesnames.mask (ndarray) – Boolean,
kspacewithout the coil axis: samples that were placed.origin (dict of str to int) – Position on the space’s grid of the first entry of each placement axis of
axes; 0 along an axis that is not cropped.readout (tuple of int or None) – First and last sample of the readout axis placed, inclusive;
Noneuntil an acquisition is placed. The samples outside it are zero fill.trajectory (ndarray or None) –
(dimensions, ...)over the axes ofmask, in the units the acquisitions carry.Noneuntil an acquisition carries a trajectory; widened to the most dimensions any acquisition carried, missing trailing dimensions reading 0.center_sample (int or None) – Echo index along the readout axis.
samples // 2in a Cartesian space, where every echo is placed there; in a non-Cartesian space that of the first acquisition that states it, after alignment.sample_time (float or None) – Dwell time in seconds, from the first acquisition that states it.
headers (list) – Placed acquisitions, in placement order.
Examples
>>> import pulserver.recon as recon >>> import pulserver.mrd as mrd >>> space = mrd.EncodingSpace( ... index=0, coils=4, readout=64, phase_encodes=32, partitions=1, ... loops=("slice",), loop_sizes=(2,), recon_matrix=(32, 32), ... ) >>> buffer = recon.ReconBuffer(space) >>> buffer.kspace.shape (4, 2, 32, 64) >>> buffer.extents {'coil': 4, 'slice': 2, 'phase_encode': 32, 'readout': 64} >>> buffer.image_shape (32, 32)
Methods
Place one acquisition where its counters and echo say it belongs. |
|
Return the trajectory in grid units, laid out as |
|
Return the trajectory at one position, indexed as |
|
Index along each placement axis of |
|
Return the |
Attributes
Name of every axis of |
|
Extent of each axis of |
|
Image matrix the header prescribes; see |
|
Sample times relative to the echo, |
|
The placed acquisition nearest the k-space centre, |