Commit 6b1c0bd4 authored by William Clarke's avatar William Clarke
Browse files

Test update and updated changelog.

parent 03a80b45
This document contains the FSL-MRS release history in reverse chronological order.
1.0.3 (Friday 10th July 2020)
-----------------------------
- Changed to pure python version of HLSVDPRO (hlsvdpropy). Slight speed penalty
but hopefully reduced cross-compilation issues.
- fsl_mrs_preproc now outputs zipped NIFTI files to match the rest of the command-line scripts.
- Apodisation option added to alignment in fsl_mrs_proc and fsl_mrs_preproc. Reduces effect of noise. Default value is 10 Hz of exponential apodisation.
- Fixed phasing subcommand added to fsl_mrs_proc allowing the user to apply a fixed 0th and 1st order phase.
- mrs_vis now handles folders as an input for MRS data (still handles folders of basis files).
- Conjugation command added to fsl_mrs_proc.
- fsl_mrs_preproc automatically conjugates input spectra if required.
- Typos and small bug fixes.
- Documentation expanded.
1.0.2 (Saturday 27th June 2020)
--------------------------------
- Add missing requirement (pillow)
......
......@@ -35,7 +35,8 @@ def main():
sp = p.add_subparsers(title='subcommands',
description='Preprocessing subcommands',
required=True)
required=True,
dest='subcommand')
# Coil combination subcommand
ccparser = sp.add_parser('coilcombine',
......@@ -920,7 +921,8 @@ def fixed_phase(dataobj, args):
phased[ijk],
d.dataheader['dwelltime'],
args['p1'],
args['p1'])
args['p1'],
samples=phased[ijk].size)
if args['generateReports'] and \
np.prod(d.data.shape[:3]) == 1 and \
......
......@@ -496,3 +496,97 @@ def test_fshift(svs_data, mrsi_data, tmp_path):
assert np.allclose(data, directRun)
# TODO: finish MRSI test
def test_conj(svs_data, mrsi_data, tmp_path):
""" Test fsl_mrs_proc conj"""
svsfile, mrsifile, svsdata, mrsidata = splitdata(svs_data, mrsi_data)
# Run remove on both sets of data using the command line
subprocess.check_call(['fsl_mrs_proc',
'conj',
'--file', svsfile[0],
'--output', tmp_path,
'--filename', 'tmp'])
# Load result for comparison
data, hdr = fsl_io.readNIFTI(op.join(tmp_path, 'tmp.nii.gz'),
squeezeSVS=True)
# Run using numpy directly
directRun = np.conj(svsdata[0])
assert np.allclose(data, directRun)
# Run coil combination on both sets of data using the command line
subprocess.check_call(['fsl_mrs_proc',
'conj',
'--file', mrsifile[0],
'--output', tmp_path,
'--filename', 'tmp'])
# Load result for comparison
data, hdr = fsl_io.readNIFTI(op.join(tmp_path, 'tmp.nii.gz'),
squeezeSVS=True)
# Run using preproc.py directly
directRun = np.conj(mrsidata[0][2, 2, 2, ...])
assert np.allclose(data[2, 2, 2, ...], directRun)
def test_fixed_phase(svs_data, mrsi_data, tmp_path):
""" Test fsl_mrs_proc fixed_phase"""
svsfile, mrsifile, svsdata, mrsidata = splitdata(svs_data, mrsi_data)
# Run remove on both sets of data using the command line
subprocess.check_call(['fsl_mrs_proc',
'fixed_phase',
'--file', svsfile[0],
'--p0', '90',
'--p1', '0.001',
'--output', tmp_path,
'--filename', 'tmp'])
# Load result for comparison
data, hdr = fsl_io.readNIFTI(op.join(tmp_path, 'tmp.nii.gz'),
squeezeSVS=True)
# Run using numpy directly
directRun = preproc.applyPhase(svsdata[0],
(np.pi/180.0)*90)
directRun, newDT = preproc.timeshift(
directRun,
1/4000,
0.001,
0.001,
samples=directRun.size)
assert np.allclose(data, directRun)
# Run coil combination on both sets of data using the command line
subprocess.check_call(['fsl_mrs_proc',
'fixed_phase',
'--file', mrsifile[0],
'--p0', '90',
'--p1', '0.001',
'--output', tmp_path,
'--filename', 'tmp'])
# Load result for comparison
data, hdr = fsl_io.readNIFTI(op.join(tmp_path, 'tmp.nii.gz'),
squeezeSVS=True)
# Run using preproc.py directly
directRun = preproc.applyPhase(mrsidata[0][2, 2, 2, ...],
(np.pi/180.0)*90)
directRun, newDT = preproc.timeshift(
directRun,
1/4000,
0.001,
0.001,
samples=directRun.size)
assert np.allclose(data[2, 2, 2, ...], directRun)
\ No newline at end of file
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