Skip to content

Commit f376657

Browse files
committed
Improved testing and added noise
1 parent 2d56992 commit f376657

File tree

3 files changed

+448
-418
lines changed

3 files changed

+448
-418
lines changed

phantoms/MR_XCAT_qMRI/sim_ivim_sig.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,14 +365,15 @@ def XCAT_to_MR_DCE(XCAT, TR, TE, bvalue, D, f, Ds, b0=3, ivim_cont = True):
365365

366366
if __name__ == '__main__':
367367
bvalue = np.array([0., 1, 2, 5, 10, 20, 30, 50, 75, 100, 150, 250, 350, 400, 550, 700, 850, 1000])
368-
noise = 0.0 # 0.005
368+
noise = 0.0005
369369
motion = False
370-
sig, XCAT, Dim, fim, Dpim, legend = phantom(bvalue, noise,motion=motion,interleaved=False)
370+
sig, XCAT, Dim, fim, Dpim, legend = phantom(bvalue, noise, motion=motion, interleaved=False)
371371
# sig = np.flip(sig,axis=0)
372372
# sig = np.flip(sig,axis=1)
373373
res=np.eye(4)
374374
res[2]=2
375375

376+
voxel_selector_fraction = 0.5
376377
D, f, Ds = contrast_curve_calc()
377378
ignore = np.isnan(D)
378379
generic_data = {}
@@ -383,9 +384,9 @@ def XCAT_to_MR_DCE(XCAT, TR, TE, bvalue, D, f, Ds, b0=3, ivim_cont = True):
383384
voxels = sig[selector]
384385
if len(voxels) < 1:
385386
continue
386-
signals = np.mean(voxels, axis=0).tolist()
387-
std = np.std(XCAT[selector], axis=0).tolist()
387+
signals = np.squeeze(voxels[int(voxels.shape[0] * voxel_selector_fraction)]).tolist()
388388
generic_data[name] = {
389+
'noise': noise,
389390
'D': np.mean(Dim[selector], axis=0),
390391
'f': np.mean(fim[selector], axis=0),
391392
'Dp': np.mean(Dpim[selector], axis=0),

0 commit comments

Comments
 (0)