Commit 1f89bd3c authored by William Clarke's avatar William Clarke
Browse files

Fix test issues and new jmrui multi fid loader.

parent 0e8e692d
......@@ -143,7 +143,7 @@ def test_basis_manipulations(synth_data):
assert mrs.basis.shape == (2048, 1)
assert mrs.numBasis == 1
mrs.add_MM_peaks(gamma=10, sigma=10)
mrs.add_default_MM_peaks(gamma=10, sigma=10)
assert mrs.basis.shape == (2048, 6)
assert mrs.numBasis == 6
assert mrs.names == ['ppm_2', 'MM09', 'MM12', 'MM14', 'MM17', 'MM21']
......
......@@ -82,6 +82,7 @@ def test_shift():
index = basis.names.index('NAA')
amount_in_hz = 1.0 * basis.cf
t = basis.original_time_axis
t -= t[0]
shifted_fid = basis.original_basis_array[:, index] * np.exp(-1j * 2 * np.pi * t * amount_in_hz)
assert np.allclose(shifted.original_basis_array[:, index], shifted_fid)
......
This source diff could not be displayed because it is stored in LFS. You can view the blob instead.
......@@ -18,6 +18,13 @@ def readjMRUItxt_fid(txtfile):
'''
data, header = readjMRUItxt(txtfile)
# Nsig, Npoints to Npoints, Nsig
data = data.T
if data.shape[1] > 1:
dim_tags = ['DIM_USER_0', None, None]
else:
dim_tags = [None, None, None]
if 'TypeOfNucleus' in header['jmrui']:
nucleus = header['jmrui']['TypeOfNucleus']
......@@ -29,7 +36,7 @@ def readjMRUItxt_fid(txtfile):
data = data.reshape((1, 1, 1) + data.shape)
return gen_new_nifti_mrs(data, header['dwelltime'], header['centralFrequency'], nucleus=nucleus)
return gen_new_nifti_mrs(data, header['dwelltime'], header['centralFrequency'], nucleus=nucleus, dim_tags=dim_tags)
# Read jMRUI .txt files containing basis
......
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