|
22 | 22 | # Specify b values that are in the data
|
23 | 23 | bvalues = [0, 15, 150, 500]
|
24 | 24 |
|
| 25 | +# Specifiy if you want to plot the results |
| 26 | +plot_results = False |
| 27 | + |
25 | 28 | # Generate ADC map and define the min and max b value that will be used for ADC fitting
|
26 | 29 | ADClog, b0_intercept, used_bvalues = generate_ADC_standalone(DWI_data,bvalues, bmin=150, bmax=500)
|
27 | 30 |
|
|
30 | 33 | ADClog, perfFrac, Dstar = generate_IVIMmaps_standalone(DWI_data, bvalues, bminADC=150, bmaxADC=500, bmaxDstar=150)
|
31 | 34 | Slice = 5
|
32 | 35 |
|
33 |
| -# Plot the ADC, f and D* maps |
34 |
| -fig, axes = plt.subplots(1, 3, figsize=(10, 5)) |
35 |
| - |
36 |
| -axes[0].imshow(ADClog[:,Slice,:], cmap='viridis', vmin=0, vmax=5) |
37 |
| -axes[0].set_title("ADC") |
38 |
| -axes[0].axis('off') |
| 36 | +if plot_results == True: |
| 37 | + # Plot the ADC, f and D* maps |
| 38 | + fig, axes = plt.subplots(1, 3, figsize=(10, 5)) |
39 | 39 |
|
40 |
| -axes[1].imshow(perfFrac[:,Slice,:], cmap='viridis', vmin=0, vmax=1) |
41 |
| -axes[1].set_title("f map") |
42 |
| -axes[1].axis('off') |
| 40 | + axes[0].imshow(ADClog[:,Slice,:], cmap='viridis', vmin=0, vmax=5) |
| 41 | + axes[0].set_title("ADC") |
| 42 | + axes[0].axis('off') |
43 | 43 |
|
44 |
| -axes[2].imshow(Dstar[:,Slice,:], cmap='viridis', vmin=0, vmax=200) |
45 |
| -axes[2].set_title("D*") |
46 |
| -axes[2].axis('off') |
| 44 | + axes[1].imshow(perfFrac[:,Slice,:], cmap='viridis', vmin=0, vmax=1) |
| 45 | + axes[1].set_title("f map") |
| 46 | + axes[1].axis('off') |
47 | 47 |
|
48 |
| -plt.tight_layout() # Adjust spacing between subplots |
49 |
| -plt.show() |
| 48 | + axes[2].imshow(Dstar[:,Slice,:], cmap='viridis', vmin=0, vmax=200) |
| 49 | + axes[2].set_title("D*") |
| 50 | + axes[2].axis('off') |
50 | 51 |
|
| 52 | + plt.tight_layout() # Adjust spacing between subplots |
| 53 | + plt.show() |
51 | 54 |
|
52 | 55 | print("finish")
|
53 | 56 |
|
|
0 commit comments