Skip to content

Commit 56ee717

Browse files
committed
Changed the default value to the b_values.json and also move the download_data function outside of the function phantom to ensure that the download_data function is called only once
1 parent 163a187 commit 56ee717

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

phantoms/MR_XCAT_qMRI/sim_ivim_sig.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# This code generates a 4D IVIM phantom as nifti file
1313

1414
def phantom(bvalue, noise, TR=3000, TE=40, motion=False, rician=False, interleaved=False):
15-
download_data()
1615
np.random.seed(42)
1716
if motion:
1817
states = range(1,21)
@@ -412,12 +411,13 @@ def parse_bvalues_file(file_path):
412411
elif args.bvalue:
413412
bvalues = {"cmd": args.bvalue}
414413
else:
415-
bvalues = {"original": [0., 1, 2, 5, 10, 20, 30, 50, 75, 100, 150, 250, 350, 400, 550, 700, 850, 1000]}
414+
bvalues = parse_bvalues_file("b_values.json")
416415

417416

418417
noise = args.noise
419418
motion = args.motion
420419
interleaved = args.interleaved
420+
download_data()
421421
for key, bvalue in bvalues.items():
422422
bvalue = np.array(bvalue)
423423
sig, XCAT, Dim, fim, Dpim, legend = phantom(bvalue, noise, motion=motion, interleaved=interleaved)

0 commit comments

Comments
 (0)