Beispiel #1
0
    def test_stspa_3d_nonexplicit(self):
        nz = 3
        target, sens = self.problem_3d(3, nz)
        dim = target.shape[0]

        g, k1, t, s = rf.spiral_arch(0.24, dim, 4e-6, 200, 0.035)
        k1 = k1 / dim

        k1 = rf.stack_of(k1, nz, 0.1)
        A = sp.mri.linop.Sense(sens,
                               k1,
                               weights=None,
                               tseg=None,
                               ishape=target.shape).H

        pulses = sp.mri.rf.stspa(target,
                                 sens,
                                 st=None,
                                 coord=k1,
                                 dt=4e-6,
                                 max_iter=30,
                                 alpha=10,
                                 tol=1E-3,
                                 phase_update_interval=200,
                                 explicit=False)

        npt.assert_array_almost_equal(A * pulses, target, 1E-3)
Beispiel #2
0
    def test_stspa_spiral(self):

        target, sens = self.problem_2d(8)

        fov = 0.55
        gts = 6.4e-6
        gslew = 190
        gamp = 40
        R = 1
        dx = 0.025  # in m
        # construct a trajectory
        g, k, t, s = rf.spiral_arch(fov / R, dx, gts, gslew, gamp)

        A = linop.Sense(sens, coord=k, ishape=target.shape).H

        pulses = rf.stspa(target,
                          sens,
                          k,
                          dt=4e-6,
                          alpha=1,
                          b0=None,
                          st=None,
                          explicit=False,
                          max_iter=100,
                          tol=1E-4)

        npt.assert_array_almost_equal(A * pulses, target, 1E-3)
Beispiel #3
0
    def test_stspa_3d_explicit(self):
        nz = 4
        target, sens = self.problem_3d(3, nz)
        dim = target.shape[0]

        g, k1, t, s = rf.spiral_arch(0.24, dim, 4e-6, 200, 0.035)
        k1 = k1 / dim

        k1 = rf.stack_of(k1, nz, 0.1)
        A = rf.linop.PtxSpatialExplicit(sens,
                                        k1,
                                        dt=4e-6,
                                        img_shape=target.shape,
                                        b0=None)

        pulses = sp.mri.rf.stspa(target,
                                 sens,
                                 st=None,
                                 coord=k1,
                                 dt=4e-6,
                                 max_iter=30,
                                 alpha=10,
                                 tol=1E-3,
                                 phase_update_interval=200,
                                 explicit=True)

        npt.assert_array_almost_equal(A * pulses, target, 1E-3)
import sigpy.mri as mr
import sigpy.mri.rf as rf
import numpy as np
import sigpy.plot as pl
import matplotlib

dim = 32
Nc = 8
img_shape = [dim, dim]
sens_shape = [Nc, dim, dim]
sens = mr.birdcage_maps(sens_shape)
pl.ImagePlot(sens)

fov = 0.55  # FOV in m
N = dim  # matrix size
gts = 6.4e-6  # hardware dwell time, s
gslew = 150  # gradient slew rate in mT/m/ms
gamp = 30  # maximum gradient amplitude in mT/m
densamp = 10000  # duration of full density sampling (in samples)
dentrans = 10000  # duration of transition from low-high density (in samples)
R = 1 / 2  # degree of undersampling of outer region of trajectory- let's oversample by a factor of 2
dx = 0.025  # in m
rewinder = False
# construct a trajectory
g, k, t, s = rf.spiral_arch(fov / R, dx, gts, gslew, gamp)

#Note that this trajectory is a spiral-out trajectory.
#We will simply time-reverse it to create a spiral-in.
k = np.flipud(k)
g = np.flipud(g)