mrzerocore 0.2.10__cp37-abi3-win_amd64.whl → 0.2.11__cp37-abi3-win_amd64.whl
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.
- MRzeroCore/_prepass.pyd +0 -0
- MRzeroCore/phantom/brainweb/brainweb_data.json +1 -1
- MRzeroCore/simulation/main_pass.py +21 -8
- {MRzeroCore-0.2.10.dist-info → MRzeroCore-0.2.11.dist-info}/METADATA +2 -2
- {MRzeroCore-0.2.10.dist-info → MRzeroCore-0.2.11.dist-info}/RECORD +7 -7
- {MRzeroCore-0.2.10.dist-info → MRzeroCore-0.2.11.dist-info}/WHEEL +0 -0
- {MRzeroCore-0.2.10.dist-info → MRzeroCore-0.2.11.dist-info}/license_files/LICENSE +0 -0
MRzeroCore/_prepass.pyd
CHANGED
|
Binary file
|
|
@@ -18,12 +18,9 @@ def execute_graph(graph: Graph,
|
|
|
18
18
|
min_emitted_signal: float = 1e-2,
|
|
19
19
|
min_latent_signal: float = 1e-2,
|
|
20
20
|
print_progress: bool = True,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
This function can optionally return the + or z magnetisation and the
|
|
25
|
-
encoding of all states, if requested. The encoding consists of the signal
|
|
26
|
-
of a distribution and its k-t space trajectory.
|
|
21
|
+
return_mag_z: int | bool | None = None,
|
|
22
|
+
) -> torch.Tensor | list:
|
|
23
|
+
"""Calculate the signal of the sequence by executing the phase graph.
|
|
27
24
|
|
|
28
25
|
Parameters
|
|
29
26
|
----------
|
|
@@ -40,11 +37,18 @@ def execute_graph(graph: Graph,
|
|
|
40
37
|
Should be <= than min_emitted_signal.
|
|
41
38
|
print_progress : bool
|
|
42
39
|
If true, the current repetition is printed while simulating.
|
|
40
|
+
return_mag_z : int or bool, optional
|
|
41
|
+
If set, returns the longitudinal magnetisation of either the given
|
|
42
|
+
repetition (int) or all repetitions (``True``).
|
|
43
|
+
|
|
43
44
|
|
|
44
45
|
Returns
|
|
45
46
|
-------
|
|
46
47
|
signal : torch.Tensor
|
|
47
48
|
The simulated signal of the sequence.
|
|
49
|
+
mag_z : torch.Tensor | list[torch.Tensor]
|
|
50
|
+
The longitudinal magnetisation of the specified or all repetition(s).
|
|
51
|
+
|
|
48
52
|
"""
|
|
49
53
|
if seq.normalized_grads:
|
|
50
54
|
grad_scale = 1 / data.size
|
|
@@ -67,6 +71,7 @@ def execute_graph(graph: Graph,
|
|
|
67
71
|
# Calculate kt_vec ourselves for autograd
|
|
68
72
|
graph[0][0].kt_vec = torch.zeros(4, device=data.device)
|
|
69
73
|
|
|
74
|
+
mag_z = []
|
|
70
75
|
for i, (dists, rep) in enumerate(zip(graph[1:], seq)):
|
|
71
76
|
if print_progress:
|
|
72
77
|
print(f"\rCalculating repetition {i+1} / {len(seq)}", end='')
|
|
@@ -129,7 +134,8 @@ def execute_graph(graph: Graph,
|
|
|
129
134
|
# Use the same adc phase for all coils
|
|
130
135
|
adc_rot = torch.exp(1j * rep.adc_phase).unsqueeze(1)
|
|
131
136
|
|
|
132
|
-
|
|
137
|
+
mag_z_rep = []
|
|
138
|
+
mag_z.append(mag_z_rep)
|
|
133
139
|
for dist in dists:
|
|
134
140
|
# Create a list only containing ancestors that were simulated
|
|
135
141
|
ancestors = list(filter(
|
|
@@ -142,6 +148,9 @@ def execute_graph(graph: Graph,
|
|
|
142
148
|
continue # skip dists for which no ancestors were simulated
|
|
143
149
|
|
|
144
150
|
dist.mag = sum([calc_mag(ancestor) for ancestor in ancestors])
|
|
151
|
+
if dist.dist_type in ['z0', 'z'] and return_mag_z in [i, True]:
|
|
152
|
+
mag_z_rep.append(dist.mag)
|
|
153
|
+
|
|
145
154
|
# The pre_pass already calculates kt_vec, but that does not
|
|
146
155
|
# work with autograd -> we need to calculate it with torch
|
|
147
156
|
if dist.dist_type == 'z0':
|
|
@@ -224,6 +233,10 @@ def execute_graph(graph: Graph,
|
|
|
224
233
|
print(" - done")
|
|
225
234
|
|
|
226
235
|
# Only return measured samples
|
|
227
|
-
|
|
236
|
+
measured = torch.cat([
|
|
228
237
|
sig[rep.adc_usage > 0, :] for sig, rep in zip(signal, seq)
|
|
229
238
|
])
|
|
239
|
+
if return_mag_z is not None:
|
|
240
|
+
return measured, mag_z
|
|
241
|
+
else:
|
|
242
|
+
return measured
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: MRzeroCore
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.11
|
|
4
4
|
Classifier: Programming Language :: Rust
|
|
5
5
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
6
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
@@ -18,9 +18,9 @@ Summary: Core functionality of MRzero
|
|
|
18
18
|
Author-email: Jonathan Endres <jonathan.endres@uk-erlangen.de>
|
|
19
19
|
Requires-Python: >=3.9
|
|
20
20
|
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
21
|
+
Project-URL: Documentation, https://mrzero-core.readthedocs.io/
|
|
21
22
|
Project-URL: MRzero-Paper, https://arxiv.org/abs/2002.04265
|
|
22
23
|
Project-URL: Repository, https://github.com/MRsources/MRzero-Core
|
|
23
|
-
Project-URL: Documentation, https://mrzero-core.readthedocs.io/
|
|
24
24
|
|
|
25
25
|
[](https://mrzero-core.readthedocs.io/en/latest/?badge=latest)
|
|
26
26
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
MRzeroCore-0.2.
|
|
2
|
-
MRzeroCore-0.2.
|
|
3
|
-
MRzeroCore-0.2.
|
|
4
|
-
MRzeroCore/phantom/brainweb/brainweb_data.json,sha256=
|
|
1
|
+
MRzeroCore-0.2.11.dist-info/METADATA,sha256=ULVaZLNX8Qy54JZKAmjfHcRW2-Mft47DQ3AqoMbdkuo,3801
|
|
2
|
+
MRzeroCore-0.2.11.dist-info/WHEEL,sha256=ZnSmVnashXVUiLCKmp20reANrPJdUjOt4GHgJoJkZ3E,96
|
|
3
|
+
MRzeroCore-0.2.11.dist-info/license_files/LICENSE,sha256=rd_IFJ484uAluv8CigP2CpXg4l2GJLLKENqB6-RXPp4,35112
|
|
4
|
+
MRzeroCore/phantom/brainweb/brainweb_data.json,sha256=El9J5dfEIwGi4_SoRif6ic6IVSMKh01jK0hNRbBYNqA,1794
|
|
5
5
|
MRzeroCore/phantom/brainweb/brainweb_data_sources.txt,sha256=Sh6NFLU1bhdaD0pp12D_Hc70cA_UC1s7KdHcuoGTKuA,1853
|
|
6
6
|
MRzeroCore/phantom/brainweb/output/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
MRzeroCore/phantom/brainweb/__init__.py,sha256=R48NlkMNpMgyKKwFm-5iUlhxBKctQ6dXx7yCmyVwm6E,6828
|
|
@@ -28,9 +28,9 @@ MRzeroCore/pulseq/pulseq_loader/__init__.py,sha256=6OLwC3k9LSjl8aRin9pV4-Rb-Q3YS
|
|
|
28
28
|
MRzeroCore/reconstruction.py,sha256=LGk5EdgQ4AkhWN-7Q81YMkIEEW0T9Q37O2Pat0d-d4o,4277
|
|
29
29
|
MRzeroCore/sequence.py,sha256=wqRwpUIKdX9mgmctmIL2Ttr3eZPJ_H1ACLamkzPp7sY,27647
|
|
30
30
|
MRzeroCore/simulation/isochromat_sim.py,sha256=u6KbN7S8REOHiKqzDGMma7937cKX4bnmj3gXoAiNLi0,9185
|
|
31
|
-
MRzeroCore/simulation/main_pass.py,sha256=
|
|
31
|
+
MRzeroCore/simulation/main_pass.py,sha256=DNXEJmN7AEWuqNbMma6AWqJpHH4ihhC3YRJKRhoi4RU,9830
|
|
32
32
|
MRzeroCore/simulation/pre_pass.py,sha256=5wmXKxgFeGwA7yrqTkOjcWoFuGuRYEPzedRGqkx2Evg,5117
|
|
33
33
|
MRzeroCore/util.py,sha256=39TPselHu7f218BRdjHB4_kCSPnFuCC45YmdGotc4uA,11460
|
|
34
34
|
MRzeroCore/__init__.py,sha256=8WViV9GQRwnksnopAAfKWRmtRYk75DC3ke4OQwLx-fU,850
|
|
35
|
-
MRzeroCore/_prepass.pyd,sha256=
|
|
36
|
-
MRzeroCore-0.2.
|
|
35
|
+
MRzeroCore/_prepass.pyd,sha256=PKuaSg_6q18ENCstF-oQripTAfEbOg-s_2Qcqmy7CuI,398848
|
|
36
|
+
MRzeroCore-0.2.11.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|