@@ -365,14 +365,15 @@ def XCAT_to_MR_DCE(XCAT, TR, TE, bvalue, D, f, Ds, b0=3, ivim_cont = True):
365
365
366
366
if __name__ == '__main__' :
367
367
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
369
369
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 )
371
371
# sig = np.flip(sig,axis=0)
372
372
# sig = np.flip(sig,axis=1)
373
373
res = np .eye (4 )
374
374
res [2 ]= 2
375
375
376
+ voxel_selector_fraction = 0.5
376
377
D , f , Ds = contrast_curve_calc ()
377
378
ignore = np .isnan (D )
378
379
generic_data = {}
@@ -383,9 +384,9 @@ def XCAT_to_MR_DCE(XCAT, TR, TE, bvalue, D, f, Ds, b0=3, ivim_cont = True):
383
384
voxels = sig [selector ]
384
385
if len (voxels ) < 1 :
385
386
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 ()
388
388
generic_data [name ] = {
389
+ 'noise' : noise ,
389
390
'D' : np .mean (Dim [selector ], axis = 0 ),
390
391
'f' : np .mean (fim [selector ], axis = 0 ),
391
392
'Dp' : np .mean (Dpim [selector ], axis = 0 ),
0 commit comments