Commit cfcf3bd1 authored by Mo Shahdloo's avatar Mo Shahdloo
Browse files

tests updated

parent e95fbcb5
......@@ -147,7 +147,7 @@ def loop_mdh_read(fid, version, Nscans, scan, measOffset, measLength, print_prog
t.close()
if isEOF:
if isEOF or n_acq == len(filePos):
n_acq = n_acq - 1 # ignore the last attempt
# import pdb; pdb.set_trace()
filePos[n_acq] = cPos
......
......@@ -9,9 +9,31 @@ from core import mapVBVD
test_data_vb_broken = op.join(op.dirname(__file__), 'test_data', 'meas_MID111_sLaser_broken_FID4873.dat')
test_data_gre = op.join(op.dirname(__file__), 'test_data', 'meas_MID00058_FID12358_gre_3D.dat')
test_data_epi = op.join(op.dirname(__file__), 'test_data', 'meas_MID00053_FID12353_ep2d_QA_2mm_15ch_inplane_Grappa2_100.dat')
def test_flagRemoveOS():
twixObj = mapVBVD(test_data_gre, quiet=False)
twixObj[1].image.flagRemoveOS = False
assert np.allclose(twixObj[1].image.dataSize, [256, 15, 128, 96, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
twixObj[1].image.flagRemoveOS = True
assert np.allclose(twixObj[1].image.dataSize, [128, 15, 128, 96, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
# broken file
twixObj = mapVBVD(test_data_vb_broken, quiet=False)
twixObj.image.flagRemoveOS = False
assert np.allclose(twixObj.image.dataSize, [4096, 32, 1, 1, 1, 1, 1, 1, 1, 97, 1, 1, 1, 1, 1, 1])
twixObj.image.flagRemoveOS = True
assert np.allclose(twixObj.image.dataSize, [2048, 32, 1, 1, 1, 1, 1, 1, 1, 97, 1, 1, 1, 1, 1, 1])
def test_flagIgnoreSeg_flagDoAverage():
twixObj = mapVBVD(test_data_epi, quiet=False)
twixObj[1].image.flagIgnoreSeg = False
assert np.allclose(twixObj[1].image.dataSize, [86, 15, 86, 1, 36, 1, 1, 1, 100, 1, 2, 1, 1, 1, 1, 1])
twixObj[1].image.flagIgnoreSeg = True
assert np.allclose(twixObj[1].image.dataSize, [86, 15, 86, 1, 36, 1, 1, 1, 100, 1, 1, 1, 1, 1, 1, 1])
twixObj[1].refscanPC.flagDoAverage = False
assert np.allclose(twixObj[1].refscanPC.dataSize, [86, 15, 86, 1, 36, 1, 1, 1, 100, 1, 2, 1, 1, 1, 1, 1])
twixObj[1].refscanPC.flagDoAverage = True
assert np.allclose(twixObj[1].refscanPC.dataSize, [86, 15, 86, 1, 36, 1, 1, 1, 100, 1, 1, 1, 1, 1, 1, 1])
assert np.allclose(twixObj.image.fullSize, [4096, 32, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1])
......@@ -5,8 +5,7 @@ from core import mapVBVD
test_data_vb = op.join(op.dirname(__file__), 'test_data', 'meas_MID311_STEAM_wref1_FID115674.dat')
test_data_ve = op.join(op.dirname(__file__), 'test_data', 'meas_MID00305_FID74175_VOI_slaser_wref1.dat')
test_data_vb_broken = op.join(op.dirname(__file__), 'test_data', 'meas_MID111_sLaser_broken_FID4873.dat')
test_data_gre = op.join(op.dirname(__file__), 'test_data', 'meas_MID00058_FID12358_gre_3D.dat')
test_data_epi = op.join(op.dirname(__file__), 'test_data', 'meas_MID00053_FID12353_ep2d_QA_2mm_15ch_inplane_Grappa2_100.dat')
def test_vb():
twixObj = mapVBVD(test_data_vb, quiet=False)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment