Commit a56da37b authored by William Clarke's avatar William Clarke
Browse files

Add mrs_info command.

parent e4266bb9
This document contains the FSL-MRS release history in reverse chronological order.
1.1.0 (WIP)
---------------------------------
1.1.0 (Thursday 18th February 2021)
-----------------------------------
- Support for NIfTI-MRS format.
- Preprocessing scripts reoriented around NIfTI-MRS framework
- New script results_to_spectrum for generating full fits in NIfTI-MRS format from fsl_mrs results.
- Documentation and example data updated for move to NIfTI-MRS.
- Added mrs_info command to give quick text summary of NIfTI-MRS file contents.
- Updates to the WIP dynamic fitting module.
1.0.6 (Tuesday 12th January 2021)
---------------------------------
......
#!/usr/bin/env python
# mrs_info - quick NIfTI MRS information
#
# Author: William Clarke <william.clarke@ndcn.ox.ac.uk>
#
# Copyright (C) 2021 University of Oxford
# SHBASECOPYRIGHT
import argparse
from pathlib import Path
def main():
p = argparse.ArgumentParser(description='FSL MRS Tools: NIfTI-MRS information')
p.add_argument('file', type=Path, metavar='FILE or list of FILEs',
help='NIfTI MRS file(s)', nargs= '+')
args = p.parse_args()
from fsl_mrs.utils.mrs_io import read_FID
from fsl_mrs.utils.constants import GYRO_MAG_RATIO
for file in args.file:
data = read_FID(str(file))
print(f'\nRead file {file.name} ({file.parent.resolve()}).')
print(f'NIfTI-MRS version {data.mrs_nifti_version}')
print(f'Data shape {data.shape}')
print(f'Dimension tags: {data.dim_tags}')
print(f'Spectrometer Frequency: {data.spectrometer_frequency[0]} MHz')
print(f'Dwelltime (Bandwidth): {data.dwelltime:0.3E}s ({data.bandwidth:0.0f} Hz)')
print(f'Nucleus: {data.nucleus[0]}')
if data.nucleus[0] in GYRO_MAG_RATIO:
field_strength = data.spectrometer_frequency[0] / GYRO_MAG_RATIO[data.nucleus[0]]
print(f'Field Strength: {field_strength:0.2f} T')
print()
if __name__ == '__main__':
main()
......@@ -4,7 +4,7 @@ from setuptools import setup
import versioneer
with open('requirements.txt', 'rt') as f:
install_requires = [l.strip() for l in f.readlines()]
install_requires = [line.strip() for line in f.readlines()]
with open("README.md", "r") as fh:
long_description = fh.read()
......@@ -13,8 +13,8 @@ setup(name='fsl_mrs',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description='FSL Tools for Spectroscopy',
author=['Saad Jbabdi','William Clarke'],
author_email=['saad@fmrib.ox.ac.uk','william.clarke@ndcn.ox.ac.uk'],
author=['Saad Jbabdi', 'William Clarke'],
author_email=['saad@fmrib.ox.ac.uk', 'william.clarke@ndcn.ox.ac.uk'],
url='www.fmrib.ox.ac.uk/fsl',
long_description=long_description,
long_description_content_type="text/markdown",
......@@ -30,19 +30,20 @@ setup(name='fsl_mrs',
'fsl_mrs.mmbasis',
'fsl_mrs.auxiliary'
],
package_data={'fsl_mrs.denmatsim':['spinSystems.json'],
'fsl_mrs.mmbasis':['mmbasis.json'],
'fsl_mrs.utils.preproc':['templates/*.html'],
'fsl_mrs':['pkg_data/mrs_fitting_challenge/*/*']},
package_data={'fsl_mrs.denmatsim': ['spinSystems.json'],
'fsl_mrs.mmbasis': ['mmbasis.json'],
'fsl_mrs.utils.preproc': ['templates/*.html'],
'fsl_mrs': ['pkg_data/mrs_fitting_challenge/*/*']},
install_requires=install_requires,
scripts=['fsl_mrs/scripts/fsl_mrs',
'fsl_mrs/scripts/fsl_mrsi',
'fsl_mrs/scripts/fsl_mrs_preproc',
'fsl_mrs/scripts/fsl_mrs_proc',
'fsl_mrs/scripts/fsl_mrs_sim',
'fsl_mrs/scripts/mrs_vis',
'fsl_mrs/scripts/merge_mrs_reports',
'fsl_mrs/scripts/svs_segment',
'fsl_mrs/scripts/mrsi_segment',
'fsl_mrs/scripts/results_to_spectrum']
)
'fsl_mrs/scripts/fsl_mrsi',
'fsl_mrs/scripts/fsl_mrs_preproc',
'fsl_mrs/scripts/fsl_mrs_proc',
'fsl_mrs/scripts/fsl_mrs_sim',
'fsl_mrs/scripts/mrs_vis',
'fsl_mrs/scripts/mrs_info',
'fsl_mrs/scripts/merge_mrs_reports',
'fsl_mrs/scripts/svs_segment',
'fsl_mrs/scripts/mrsi_segment',
'fsl_mrs/scripts/results_to_spectrum']
)
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