"sig0" : 10000, "infer-vp" : True, }, # Model options { "ktrans" : [0.05, 0.1, 0.2, 0.4, 0.8], "ve" : [0.05, 0.1, 0.2, 0.4, 0.8], "vp" : 0.01, }, { "nt" : 25, "patchsize" : 5, "noise" : 5, } # Other options ] } save = "--save" in sys.argv try: for model, test_data in TEST_DATA.items(): rundata, params, kwargs = test_data log = self_test(model, rundata, params, save_input=save, save_output=save, invert=True, **kwargs) #print(log) except FabberException, e: print e.log traceback.print_exc() except: traceback.print_exc()
"repeats": 1, "nph": 8, "modfn": "fermi", "alpha": 55, "beta": 12 }, # Model options { "mag": [100, 200, 400], "phase": [-pi, -pi / 2, -pi / 4, 0, pi / 4, pi / 2, pi], "offset": [500, 1000] }, # Parameter values - at most 3 can vary { "nt": 8 } # Other options ] } try: for model, test_data in TEST_DATA.items(): rundata, params, kwargs = test_data ret = self_test(model, rundata, params, noise=50, patchsize=10, save_input=True, save_output=True, **kwargs) except: traceback.print_exc()
from fabber import self_test, FabberException save = "--save" in sys.argv try: rundata = { "model": "exp", # Exponential model "num-exps": 1, # Single exponential function "dt": 0.02, # With 100 time points time values will range from 0 to 2 } params = { "amp1": [1, 0.5], # Amplitude "r1": [1.0, 0.8], # Decay rate } test_config = { "nt": 100, # Number of time points "noise": 0.1, # Amplitude of Gaussian noise to add to simulated data "patchsize": 20, # Each patch is 20 voxels along each dimension } result, log = self_test("exp", rundata, params, save_input=save, save_output=save, invert=True, **test_config) except FabberException, e: print e.log traceback.print_exc() except: traceback.print_exc()
FSLDIR = os.environ["FSLDIR"] sys.path.insert(0, FSLDIR + "/lib/python") from fabber import self_test TEST_DATA = { "asl_multiphase": [ { "repeats": 1, "nph": 8, "modfn": "fermi", "alpha": 66, "beta": 21 }, # Model options { "mag": [10, 20, 40, 80, 160, 320], "phase": [0, 0.1, 0.2, 0.3, 0.4, 0.5], "offset": [500, 1000, 1500, 2000] }, # Parameter values - at most 3 can vary { "nt": 8 } # Other options ] } try: for model, test_data in TEST_DATA.items(): rundata, params, kwargs = test_data self_test(model, rundata, params, noise=0.01, **kwargs) except: traceback.print_exc()