MRArbGrad 3.1.0__tar.gz → 4.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0/MRArbGrad.egg-info}/PKG-INFO +2 -2
- {mrarbgrad-3.1.0/MRArbGrad.egg-info → mrarbgrad-4.0.0}/PKG-INFO +2 -2
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/README.md +1 -1
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/mrarbgrad_src/Function.py +3 -8
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/mrarbgrad_src/ext/main.cpp +4 -6
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/mrarbgrad_src/ext/traj/Shell3d.h +6 -6
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/mrarbgrad_src/ext/traj/VDSpiral.h +7 -6
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/mrarbgrad_src/ext/traj/Yarnball.h +22 -16
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/pyproject.toml +1 -1
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/LICENSE +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/MANIFEST.in +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/MRArbGrad.egg-info/SOURCES.txt +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/MRArbGrad.egg-info/dependency_links.txt +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/MRArbGrad.egg-info/requires.txt +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/MRArbGrad.egg-info/top_level.txt +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/example/example_BuiltInTraj.py +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/example/example_ExternalFunction2D.py +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/example/example_ExternalSamples2D.py +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/example/example_ExternalSamples3D.py +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/mrarbgrad_src/Utility.py +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/mrarbgrad_src/__init__.py +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/mrarbgrad_src/ext/mag/Mag.cpp +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/mrarbgrad_src/ext/mag/Mag.h +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/mrarbgrad_src/ext/traj/Cones.h +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/mrarbgrad_src/ext/traj/MrTraj.h +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/mrarbgrad_src/ext/traj/MrTraj_2D.h +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/mrarbgrad_src/ext/traj/Rosette.h +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/mrarbgrad_src/ext/traj/Seiffert.h +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/mrarbgrad_src/ext/traj/Spiral.h +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/mrarbgrad_src/ext/traj/TrajFunc.h +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/mrarbgrad_src/ext/utility/Intp.h +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/mrarbgrad_src/ext/utility/LinIntp.h +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/mrarbgrad_src/ext/utility/SplineIntp.h +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/mrarbgrad_src/ext/utility/global.cpp +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/mrarbgrad_src/ext/utility/global.h +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/mrarbgrad_src/ext/utility/v3.cpp +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/mrarbgrad_src/ext/utility/v3.h +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/mrarbgrad_src/trajfunc/__init__.py +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/mrarbgrad_src/trajfunc/main.py +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/setup.cfg +0 -0
- {mrarbgrad-3.1.0 → mrarbgrad-4.0.0}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: MRArbGrad
|
|
3
|
-
Version:
|
|
3
|
+
Version: 4.0.0
|
|
4
4
|
Summary: Gradient waveform design tool for arbitrary k-space trajectories.
|
|
5
5
|
Author-email: Ryan <ryan_shanghaitech@proton.me>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -41,7 +41,7 @@ You can also install via `pip install .` but remember to delete `*.egg-info` or
|
|
|
41
41
|
## Examples & Usages
|
|
42
42
|
Examples for generating gradient waveforms for either built-in trajectory (trajectory library) or external trajectory (expressed by trajectory function or trajectory samples) can be found in the `example` folder.
|
|
43
43
|
|
|
44
|
-
##
|
|
44
|
+
## Reference
|
|
45
45
|
If this project helps you, please cite [our paper](https://ieeexplore.ieee.org/document/11352950):
|
|
46
46
|
|
|
47
47
|
[1] Luo R, Huang H, Miao Q, Xu J, Hu P, Qi H. Real-Time Gradient Waveform Design for Arbitrary k-Space Trajectories. IEEE Transactions on Biomedical Engineering. 2026;1–12.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: MRArbGrad
|
|
3
|
-
Version:
|
|
3
|
+
Version: 4.0.0
|
|
4
4
|
Summary: Gradient waveform design tool for arbitrary k-space trajectories.
|
|
5
5
|
Author-email: Ryan <ryan_shanghaitech@proton.me>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -41,7 +41,7 @@ You can also install via `pip install .` but remember to delete `*.egg-info` or
|
|
|
41
41
|
## Examples & Usages
|
|
42
42
|
Examples for generating gradient waveforms for either built-in trajectory (trajectory library) or external trajectory (expressed by trajectory function or trajectory samples) can be found in the `example` folder.
|
|
43
43
|
|
|
44
|
-
##
|
|
44
|
+
## Reference
|
|
45
45
|
If this project helps you, please cite [our paper](https://ieeexplore.ieee.org/document/11352950):
|
|
46
46
|
|
|
47
47
|
[1] Luo R, Huang H, Miao Q, Xu J, Hu P, Qi H. Real-Time Gradient Waveform Design for Arbitrary k-Space Trajectories. IEEE Transactions on Biomedical Engineering. 2026;1–12.
|
|
@@ -27,7 +27,7 @@ You can also install via `pip install .` but remember to delete `*.egg-info` or
|
|
|
27
27
|
## Examples & Usages
|
|
28
28
|
Examples for generating gradient waveforms for either built-in trajectory (trajectory library) or external trajectory (expressed by trajectory function or trajectory samples) can be found in the `example` folder.
|
|
29
29
|
|
|
30
|
-
##
|
|
30
|
+
## Reference
|
|
31
31
|
If this project helps you, please cite [our paper](https://ieeexplore.ieee.org/document/11352950):
|
|
32
32
|
|
|
33
33
|
[1] Luo R, Huang H, Miao Q, Xu J, Hu P, Qi H. Real-Time Gradient Waveform Design for Arbitrary k-Space Trajectories. IEEE Transactions on Biomedical Engineering. 2026;1–12.
|
|
@@ -142,7 +142,6 @@ def getG_VDSpiral_RT\
|
|
|
142
142
|
|
|
143
143
|
kRhoPhi0: float64 = 0.5 / (8 * pi),
|
|
144
144
|
kRhoPhi1: float64 = 0.5 / (2 * pi),
|
|
145
|
-
nAcq: int64 = 128,
|
|
146
145
|
) -> tuple[list[NDArray], list[NDArray]]:
|
|
147
146
|
'''
|
|
148
147
|
:return: list of trajectory start, list of gradient waveforms
|
|
@@ -158,9 +157,7 @@ def getG_VDSpiral_RT\
|
|
|
158
157
|
float64(dt),
|
|
159
158
|
|
|
160
159
|
float64(kRhoPhi0),
|
|
161
|
-
float64(kRhoPhi1)
|
|
162
|
-
|
|
163
|
-
int64(nAcq)
|
|
160
|
+
float64(kRhoPhi1)
|
|
164
161
|
)
|
|
165
162
|
|
|
166
163
|
def getG_Rosette\
|
|
@@ -294,8 +291,7 @@ def getG_Yarnball_RT\
|
|
|
294
291
|
gLim: float64 = 50e-3 * 42.5756e6 * 0.256 / 256,
|
|
295
292
|
dt: float64 = 10e-6,
|
|
296
293
|
|
|
297
|
-
kRhoPhi: float64 = 0.5 / (2 * pi)
|
|
298
|
-
nAcq: int64 = 16384,
|
|
294
|
+
kRhoPhi: float64 = 0.5 / (2 * pi)
|
|
299
295
|
) -> tuple[list[NDArray], list[NDArray]]:
|
|
300
296
|
'''
|
|
301
297
|
:return: list of trajectory start, list of gradient waveforms
|
|
@@ -310,8 +306,7 @@ def getG_Yarnball_RT\
|
|
|
310
306
|
float64(gLim),
|
|
311
307
|
float64(dt),
|
|
312
308
|
|
|
313
|
-
float64(kRhoPhi)
|
|
314
|
-
int64(nAcq),
|
|
309
|
+
float64(kRhoPhi)
|
|
315
310
|
)
|
|
316
311
|
|
|
317
312
|
def getG_Seiffert\
|
|
@@ -451,7 +451,7 @@ PyObject* getG_VDSpiral(PyObject* self, PyObject* const* args, Py_ssize_t narg)
|
|
|
451
451
|
|
|
452
452
|
PyObject* getG_VDSpiral_RT(PyObject* self, PyObject* const* args, Py_ssize_t narg)
|
|
453
453
|
{
|
|
454
|
-
checkNarg(narg,
|
|
454
|
+
checkNarg(narg, 7);
|
|
455
455
|
|
|
456
456
|
MrTraj::GeoPara objGeoPara;
|
|
457
457
|
MrTraj::GradPara objGradPara;
|
|
@@ -459,8 +459,7 @@ PyObject* getG_VDSpiral_RT(PyObject* self, PyObject* const* args, Py_ssize_t nar
|
|
|
459
459
|
|
|
460
460
|
f64 kRhoPhi0 = (f64)PyFloat_AsDouble(args[5]);
|
|
461
461
|
f64 kRhoPhi1 = (f64)PyFloat_AsDouble(args[6]);
|
|
462
|
-
|
|
463
|
-
VDSpiral_RT traj(objGeoPara, objGradPara, kRhoPhi0, kRhoPhi1, nAcq);
|
|
462
|
+
VDSpiral_RT traj(objGeoPara, objGradPara, kRhoPhi0, kRhoPhi1);
|
|
464
463
|
|
|
465
464
|
vv3 vv3K0;
|
|
466
465
|
vvv3 vvv3G;
|
|
@@ -555,15 +554,14 @@ PyObject* getG_Yarnball(PyObject* self, PyObject* const* args, Py_ssize_t narg)
|
|
|
555
554
|
|
|
556
555
|
PyObject* getG_Yarnball_RT(PyObject* self, PyObject* const* args, Py_ssize_t narg)
|
|
557
556
|
{
|
|
558
|
-
checkNarg(narg,
|
|
557
|
+
checkNarg(narg, 6);
|
|
559
558
|
|
|
560
559
|
MrTraj::GeoPara objGeoPara;
|
|
561
560
|
MrTraj::GradPara objGradPara;
|
|
562
561
|
getGeoGradPara(args, &objGeoPara, &objGradPara);
|
|
563
562
|
|
|
564
563
|
f64 kRhoPhi = (f64)PyFloat_AsDouble(args[5]);
|
|
565
|
-
|
|
566
|
-
Yarnball_RT traj(objGeoPara, objGradPara, kRhoPhi, nAcq);
|
|
564
|
+
Yarnball_RT traj(objGeoPara, objGradPara, kRhoPhi);
|
|
567
565
|
|
|
568
566
|
vv3 vv3K0;
|
|
569
567
|
vvv3 vvv3G;
|
|
@@ -80,18 +80,18 @@ public:
|
|
|
80
80
|
{
|
|
81
81
|
bool ret = true;
|
|
82
82
|
const f64& rotang = m_rotang;
|
|
83
|
-
i64
|
|
84
|
-
i64
|
|
83
|
+
i64 iPhi = iAcq%m_nRot;
|
|
84
|
+
i64 iTht = iAcq/m_nRot%m_nRot;
|
|
85
85
|
|
|
86
86
|
if (pv3M0PE)
|
|
87
87
|
{
|
|
88
|
-
*pv3M0PE = m_vv3BaseM0PE[
|
|
89
|
-
ret &= v3::rotate(pv3M0PE, 2, rotang
|
|
88
|
+
*pv3M0PE = m_vv3BaseM0PE[iTht];
|
|
89
|
+
ret &= v3::rotate(pv3M0PE, 2, rotang*iPhi, *pv3M0PE);
|
|
90
90
|
}
|
|
91
91
|
if (pvv3GRO)
|
|
92
92
|
{
|
|
93
|
-
*pvv3GRO = m_vvv3BaseGRO[
|
|
94
|
-
ret &= v3::rotate(pvv3GRO, 2, rotang
|
|
93
|
+
*pvv3GRO = m_vvv3BaseGRO[iTht];
|
|
94
|
+
ret &= v3::rotate(pvv3GRO, 2, rotang*iPhi, *pvv3GRO);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
return ret;
|
|
@@ -70,20 +70,21 @@ class VDSpiral_RT: public MrTraj
|
|
|
70
70
|
{
|
|
71
71
|
// TODO: Goldang sampling is incomplete, shuffled sampling is incomplete.
|
|
72
72
|
public:
|
|
73
|
-
VDSpiral_RT(const GeoPara& objGeoPara, const GradPara& objGradPara, f64 kRhoPhi0, f64 kRhoPhi1
|
|
73
|
+
VDSpiral_RT(const GeoPara& objGeoPara, const GradPara& objGradPara, f64 kRhoPhi0, f64 kRhoPhi1):
|
|
74
74
|
/*
|
|
75
75
|
* nAcq: Num of Acq, used to preallocate an array to store PE M0
|
|
76
76
|
*/
|
|
77
|
-
MrTraj(objGeoPara,objGradPara,
|
|
77
|
+
MrTraj(objGeoPara,objGradPara,0,0)
|
|
78
78
|
{
|
|
79
79
|
m_kRhoPhi0 = kRhoPhi0;
|
|
80
80
|
m_kRhoPhi1 = kRhoPhi1;
|
|
81
81
|
m_nRot = calNRot(kRhoPhi1, objGeoPara.nPix);
|
|
82
82
|
m_dRotAng = 2e0*M_PI/m_nRot;
|
|
83
83
|
genRandIdx(&m_vi64Idx, m_nRot);
|
|
84
|
+
m_nAcq = m_nRot;
|
|
84
85
|
|
|
85
86
|
VDSpiral_TrajFunc tf(m_kRhoPhi0, m_kRhoPhi1, 0);
|
|
86
|
-
vv3 vv3GRO; calGrad(NULL, &vv3GRO, NULL, tf, m_objGradPara,
|
|
87
|
+
vv3 vv3GRO; calGrad(NULL, &vv3GRO, NULL, tf, m_objGradPara, 2);
|
|
87
88
|
m_nSampMax = vv3GRO.size();
|
|
88
89
|
}
|
|
89
90
|
|
|
@@ -93,9 +94,9 @@ public:
|
|
|
93
94
|
virtual bool getGrad(v3* pv3M0PE, vv3* pvv3GRO, i64 iAcq)
|
|
94
95
|
{
|
|
95
96
|
bool ret = true;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
ret &= calGrad(pv3M0PE, pvv3GRO, NULL, tf, m_objGradPara,
|
|
97
|
+
ASSERT(iAcq >= 0);
|
|
98
|
+
VDSpiral_TrajFunc tf(m_kRhoPhi0, m_kRhoPhi1, m_vi64Idx[iAcq%m_nRot]*m_dRotAng);
|
|
99
|
+
ret &= calGrad(pv3M0PE, pvv3GRO, NULL, tf, m_objGradPara, 2);
|
|
99
100
|
return ret;
|
|
100
101
|
}
|
|
101
102
|
|
|
@@ -80,14 +80,20 @@ public:
|
|
|
80
80
|
{
|
|
81
81
|
bool ret = true;
|
|
82
82
|
const f64& rotang = m_rotang;
|
|
83
|
-
i64
|
|
84
|
-
i64
|
|
83
|
+
i64 iPhi = iAcq%m_nRot;
|
|
84
|
+
i64 iTht = iAcq/m_nRot%m_nRot;
|
|
85
|
+
|
|
86
|
+
if (pv3M0PE)
|
|
87
|
+
{
|
|
88
|
+
*pv3M0PE = m_vv3BaseM0PE[iTht];
|
|
89
|
+
ret &= v3::rotate(pv3M0PE, 2, rotang*iPhi, *pv3M0PE);
|
|
90
|
+
}
|
|
91
|
+
if (pvv3GRO)
|
|
92
|
+
{
|
|
93
|
+
*pvv3GRO = m_vvv3BaseGRO[iTht];
|
|
94
|
+
ret &= v3::rotate(pvv3GRO, 2, rotang*iPhi, *pvv3GRO);
|
|
95
|
+
}
|
|
85
96
|
|
|
86
|
-
*pv3M0PE = m_vv3BaseM0PE[iSet];
|
|
87
|
-
*pvv3GRO = m_vvv3BaseGRO[iSet];
|
|
88
|
-
ret &= v3::rotate(pv3M0PE, 2, rotang*iRot, *pv3M0PE);
|
|
89
|
-
ret &= v3::rotate(pvv3GRO, 2, rotang*iRot, *pvv3GRO);
|
|
90
|
-
|
|
91
97
|
return ret;
|
|
92
98
|
}
|
|
93
99
|
|
|
@@ -100,20 +106,20 @@ protected:
|
|
|
100
106
|
vvv3 m_vvv3BaseGRO;
|
|
101
107
|
};
|
|
102
108
|
|
|
103
|
-
/* incomplete - we plan to test 2D real-time first before 3D */
|
|
104
109
|
class Yarnball_RT: public MrTraj
|
|
105
110
|
{
|
|
106
111
|
public:
|
|
107
|
-
Yarnball_RT(const GeoPara& objGeoPara, const GradPara& objGradPara, f64 kRhoPhi
|
|
108
|
-
MrTraj(objGeoPara,
|
|
112
|
+
Yarnball_RT(const GeoPara& objGeoPara, const GradPara& objGradPara, f64 kRhoPhi):
|
|
113
|
+
MrTraj(objGeoPara,objGradPara,0,0)
|
|
109
114
|
{
|
|
110
115
|
m_kRhoPhi = kRhoPhi;
|
|
111
116
|
m_nRot = calNRot(kRhoPhi, objGeoPara.nPix);
|
|
112
117
|
m_dRotAng = 2e0*M_PI/m_nRot;
|
|
113
118
|
genRandIdx(&m_vi64Idx, m_nRot);
|
|
119
|
+
m_nAcq = m_nRot*m_nRot;
|
|
114
120
|
|
|
115
121
|
Yarnball_TrajFunc tf(m_kRhoPhi, M_PI/2e0, 0);
|
|
116
|
-
vv3 vv3GRO; calGrad(NULL, &vv3GRO, NULL, tf, m_objGradPara,
|
|
122
|
+
vv3 vv3GRO; calGrad(NULL, &vv3GRO, NULL, tf, m_objGradPara, 2);
|
|
117
123
|
m_nSampMax = vv3GRO.size();
|
|
118
124
|
}
|
|
119
125
|
|
|
@@ -123,13 +129,13 @@ public:
|
|
|
123
129
|
virtual bool getGrad(v3* pv3M0PE, vv3* pvv3GRO, i64 iAcq)
|
|
124
130
|
{
|
|
125
131
|
bool ret = true;
|
|
126
|
-
|
|
127
|
-
i64 iPhi = iAcq
|
|
128
|
-
|
|
132
|
+
ASSERT(iAcq >= 0);
|
|
133
|
+
i64 iPhi = iAcq%m_nRot;
|
|
134
|
+
i64 iTht = iAcq/m_nRot%m_nRot;
|
|
129
135
|
f64 phi = m_dRotAng*m_vi64Idx[iPhi];
|
|
136
|
+
f64 tht = m_dRotAng*m_vi64Idx[iTht];
|
|
130
137
|
Yarnball_TrajFunc tf(m_kRhoPhi, tht, phi);
|
|
131
|
-
|
|
132
|
-
ret &= calGrad(pv3M0PE, pvv3GRO, NULL, tf, m_objGradPara, 4);
|
|
138
|
+
ret &= calGrad(pv3M0PE, pvv3GRO, NULL, tf, m_objGradPara, 2);
|
|
133
139
|
return ret;
|
|
134
140
|
}
|
|
135
141
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|