Skip to content

Commit 8225f39

Browse files
authored
Merge branch 'main' into Dev_Issue_templates
2 parents 8d918db + 5da6bbf commit 8225f39

File tree

3 files changed

+47
-30
lines changed

3 files changed

+47
-30
lines changed

.github/pull_request_template.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
### Describe the changes you have made in this PR
2+
3+
_A clear and concise description of what you want to happen_
4+
5+
### Link this PR to an issue [optional]
6+
7+
Fixes _#ISSUE-NUMBER_
8+
9+
### Checklist
10+
11+
- [ ] Self-review of changed code
12+
- [ ] Added automated tests where applicable
13+
- [ ] Update Docs & Guides

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.idea*
22
.github/*
3-
!.github/ISSUE_TEMPLATE/
3+
.github/ISSUE_TEMPLATE/
4+
.github/pull_request_template.md
45
__pycache__/
56
*.nii.gz
67
bvals.txt

src/original/PvH_KB_NKI/DWI_Examples.py

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,44 +14,47 @@
1414
import matplotlib.pyplot as plt
1515
import pathlib
1616

17-
#Load some DWI data
18-
file=pathlib.Path(__file__)
19-
file_path = file.with_name('IVIM_b0_15_150_500.npy').as_posix()
20-
DWI_data = np.load(file_path)
17+
def example():
18+
#Load some DWI data
19+
file=pathlib.Path(__file__)
20+
file_path = file.with_name('IVIM_b0_15_150_500.npy').as_posix()
21+
DWI_data = np.load(file_path)
2122

22-
# Specify b values that are in the data
23-
bvalues = [0, 15, 150, 500]
23+
# Specify b values that are in the data
24+
bvalues = [0, 15, 150, 500]
2425

25-
# Specifiy if you want to plot the results
26-
plot_results = False
26+
# Specifiy if you want to plot the results
27+
plot_results = False
2728

28-
# Generate ADC map and define the min and max b value that will be used for ADC fitting
29-
ADClog, b0_intercept, used_bvalues = generate_ADC_standalone(DWI_data,bvalues, bmin=150, bmax=500)
29+
# Generate ADC map and define the min and max b value that will be used for ADC fitting
30+
ADClog, b0_intercept, used_bvalues = generate_ADC_standalone(DWI_data,bvalues, bmin=150, bmax=500)
3031

31-
# Generate ADC and define the min and max b value that will be used for ADC fitting as well as the max b value
32-
# that will be used for separate Dstar fitting
33-
ADClog, perfFrac, Dstar = generate_IVIMmaps_standalone(DWI_data, bvalues, bminADC=150, bmaxADC=500, bmaxDstar=150)
34-
Slice = 5
32+
# Generate ADC and define the min and max b value that will be used for ADC fitting as well as the max b value
33+
# that will be used for separate Dstar fitting
34+
ADClog, perfFrac, Dstar = generate_IVIMmaps_standalone(DWI_data, bvalues, bminADC=150, bmaxADC=500, bmaxDstar=150)
35+
Slice = 5
3536

36-
if plot_results == True:
37-
# Plot the ADC, f and D* maps
38-
fig, axes = plt.subplots(1, 3, figsize=(10, 5))
37+
if plot_results == True:
38+
# Plot the ADC, f and D* maps
39+
fig, axes = plt.subplots(1, 3, figsize=(10, 5))
3940

40-
axes[0].imshow(ADClog[:,Slice,:], cmap='viridis', vmin=0, vmax=5)
41-
axes[0].set_title("ADC")
42-
axes[0].axis('off')
41+
axes[0].imshow(ADClog[:,Slice,:], cmap='viridis', vmin=0, vmax=5)
42+
axes[0].set_title("ADC")
43+
axes[0].axis('off')
4344

44-
axes[1].imshow(perfFrac[:,Slice,:], cmap='viridis', vmin=0, vmax=1)
45-
axes[1].set_title("f map")
46-
axes[1].axis('off')
45+
axes[1].imshow(perfFrac[:,Slice,:], cmap='viridis', vmin=0, vmax=1)
46+
axes[1].set_title("f map")
47+
axes[1].axis('off')
4748

48-
axes[2].imshow(Dstar[:,Slice,:], cmap='viridis', vmin=0, vmax=200)
49-
axes[2].set_title("D*")
50-
axes[2].axis('off')
49+
axes[2].imshow(Dstar[:,Slice,:], cmap='viridis', vmin=0, vmax=200)
50+
axes[2].set_title("D*")
51+
axes[2].axis('off')
5152

52-
plt.tight_layout() # Adjust spacing between subplots
53-
plt.show()
53+
plt.tight_layout() # Adjust spacing between subplots
54+
plt.show()
5455

55-
print("finish")
56+
print("finish")
5657

5758

59+
if __name__ == '__main__':
60+
example()

0 commit comments

Comments
 (0)