forked from MAGNET4Cardiac7T/hackathon
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplot_final_results.py
More file actions
45 lines (32 loc) · 1.21 KB
/
plot_final_results.py
File metadata and controls
45 lines (32 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import matplotlib.pyplot as plt
def plot_final_results(B1plus_map_default, B1plus_map_bestConfig, SAR_default, SAR_bestConfig, simulation):
# Plot the results: I add a flag to the evaluation function to return the 3D B1+ map
# Compute B1 map with new config
B1plus_map_default = B1plus_map_default.detach().numpy()
B1plus_map_bestConfig = B1plus_map_bestConfig.detach().numpy()
SAR_default = SAR_default.detach().numpy()
SAR_bestConfig = SAR_bestConfig.detach().numpy()
mask = simulation.simulation_raw_data.subject[:,:,64].detach().numpy()
plt.figure()
plt.subplot(2,2,1)
plt.imshow(B1plus_map_default[:,:,64]*mask)
plt.title("B1 - Default fields config")
plt.colorbar()
#plt.show()
plt.subplot(2,2,2)
plt.imshow(B1plus_map_bestConfig[:,:,64]*mask)
plt.title("B1 - Best fields config")
plt.colorbar()
plt.subplot(2,2,3)
plt.imshow(SAR_default[:,:,64]*mask)
plt.title("SAR - Default fields config")
plt.colorbar()
#plt.show()
plt.subplot(2,2,4)
plt.imshow(SAR_bestConfig[:,:,64]*mask)
plt.title("SAR - Best fields config")
plt.colorbar()
#plt.show()
plt.tight_layout()
plt.savefig("results.png")
return 0