Skip to content

Commit

Permalink
fix inconsistency between design_2D_spgr and SPGR2D
Browse files Browse the repository at this point in the history
  • Loading branch information
mcencini committed Oct 31, 2024
1 parent 347b003 commit 3273409
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/pulserver/parsing/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__all__ = ["BaseParams", "ParamsParser"]

from dataclasses import dataclass, fields
from dataclasses import dataclass
from dataclasses import asdict as _asdict

import struct
Expand Down Expand Up @@ -53,7 +53,7 @@ def __init__(
"adc_dead_time": adc_dead_time,
}

self.opts = get_opts(_opts_dict)
self.opts_dict = get_opts(_opts_dict)

def asdict(self): # noqa
return vars(self)
Expand Down
13 changes: 8 additions & 5 deletions src/pulserver/parsing/_cartesian_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ def __init__(
Nslices: int | None = None,
slice_thickness: float | None = None,
slice_spacing: float | None = 0.0,
R: float | None = 1,
PF: float | None = 1.0,
Rplane: float | None = 1,
Rslice: float | None = 1,
Cplane: float | None = None,
TE: float | None = 0.0,
TR: float | None = 0.0,
flip: float | None = None,
Expand Down Expand Up @@ -53,7 +54,7 @@ def __init__(
if slice_thickness is None:
raise ValueError("Please provide slice_thickness")
self.slice_thickness = slice_thickness
self.slice_spacing = slice_spacing
self.slice_gap = slice_spacing

# Build matrix
if Nx is None:
Expand All @@ -80,8 +81,10 @@ def __init__(
self.TR = TR * 1e-3

# Accelerations
self.R = R
self.PF = PF
if Rplane is not None:
self.Ry = Rplane
if Cplane is not None:
self.Cy = Cplane

# apply fudge
if fudge_factor is not None and gmax is not None:
Expand Down
13 changes: 8 additions & 5 deletions src/pulserver/sequences/_design_2D_spgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def design_2D_spgr(
flip_angle: float,
TE: float = 0.0,
TR: float = 0.0,
R: int = 1,
PF: float = 1.0,
Ry: int = 1,
Cy: int | None = None,
opts_dict: str | dict | None = None,
slice_gap: float = 0.0,
dummy_scans=10,
Expand Down Expand Up @@ -60,10 +60,10 @@ def design_2D_spgr(
TR: float, optional
Target Repetition Time in ``[s]``. It is automatically extended to minimum TR.
The default is ``0.0``
R: int, optional
Ry: int, optional
Parallel Imaging undersampling factor. The default is ``1`` (no undersampling).
PF: float, optional
Partial Fourier acceleration factor. The default is ``1.0`` (no acceleration).
Cy: int | None, optional
Parallel Imaging autocalibration lines. The default is ``None`` (external calibration).
opts_dict : str | dict | None, optional
Either scanner identifier or a dictionary with the following keys:
Expand Down Expand Up @@ -225,6 +225,9 @@ def design_2D_spgr(
encoding_plan, _ = plan.cartesian2D(
g_slice_select=exc_block["gz"],
slice_thickness=slice_thickness,
slice_gap=slice_gap,
Ry=Ry,
calib=Cy,
n_slices=n_slices,
ny=Ny,
dummy_shots=calib_scans + dummy_scans,
Expand Down

0 comments on commit 3273409

Please sign in to comment.