Commit 080f479c authored by William Clarke's avatar William Clarke
Browse files

Merge branch 'bf/win_script_support' into 'dev/windows_support'

BF/win script support

See merge request !49
parents 60322251 a369ba62
Pipeline #14522 passed with stages
in 19 minutes and 19 seconds
This document contains the FSL-MRS release history in reverse chronological order.
1.1.13 (Monday 30th May)
------------------------
- Updated setup script to allow command line scripts to run on MS Windows.
- Unde the hood changes to call all FSL cmd line scripts through fslpy runfsl method.
- Updated install instructions for Windows.
1.1.12 (Wednesday 20th April)
-----------------------------
- Update to fslpy version (to 3.9.0) to substantially speed up MRSI preprocessing.
......
......@@ -3,20 +3,11 @@
Installation Instructions
=========================
FSL-MRS can currently be installed using one of two methods.
FSL-MRS should be installed using the conda package manager (option 1) or via the main FSL installer (option 2). Building from source code is possible using the instructions in option 3. For installation on MS Windows machines please see the specific setup instructions below.
Option 1: From GitLab
~~~~~~~~~~~~~~~~~~~~~
Download or clone from |fslmrs_gitlab|_. To get FSL-MRS with example data and example Jupyter notebooks, download the full package from gitlab. `Git LFS <https://git-lfs.github.com/>`_ must be installed to download package data.
::
git clone --recurse-submodules https://git.fmrib.ox.ac.uk/fsl/fsl_mrs.git
cd fsl_mrs
pip install .
Option 2: From Conda
~~~~~~~~~~~~~~~~~~~~
Option 1: Using Conda
~~~~~~~~~~~~~~~~~~~~~
The primary installation method is via *conda*. After installing conda and creating or activating a suitable you can install FSL-MRS from the FSL conda channel. See our page on setting up a :ref:`conda enviroment
<conda>` for a step by step guide.
......@@ -39,7 +30,34 @@ Example data with conda
-----------------------
Installation with conda is easy, but you won't get the packaged example data and notebooks. This can be downloaded separately here: |fslmrs_pkg_data_notebooks|_.
Option 2: FSL install script
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Follow the instructions on the main `FSL wiki installation page <https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FslInstallation>`_.
Option 3: From GitLab
~~~~~~~~~~~~~~~~~~~~~
Download or clone from |fslmrs_gitlab|_. To get FSL-MRS with example data and example Jupyter notebooks, download the full package from gitlab. `Git LFS <https://git-lfs.github.com/>`_ must be installed to download package data.
::
git clone --recurse-submodules https://git.fmrib.ox.ac.uk/fsl/fsl_mrs.git
cd fsl_mrs
conda install -c conda-forge -c defaults \
-c https://fsl.fmrib.ox.ac.uk/fsldownloads/fslconda/public/ \
--file requirements.txt
pip install --no-deps .
Windows Operating System
~~~~~~~~~~~~~~~~~~~~~~~~
FSL-MRS has been tested thoroughly on Mac and Linux operating systems but is not currently tested on MS Windows. However there are two routes for using FSL-MRS on Windows.
The first option is to install (as above) the FSL-MRS or complete FSL package using `Windows Subsystem for Linux <https://docs.microsoft.com/en-us/windows/wsl/install-win10>`_ (or WSL2). This offers an easy way of running a linux environment on a Windows machine. To install the full FSL package in WSL, follow the `instructions online <https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FslInstallation/Windows#Windows_Subsystem_for_Linux>`_
Alternatively, as of V1.1.13 of FSL-MRS the python-only FSL-MRS package can be run in native Windows alongside a WSL FSL installation. This can be achieved as follows:
1. Enable WSL and install FSL into WSL as described in the `FSL install instructions <https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FslInstallation/Windows#Windows_Subsystem_for_Linux>`_.
2. Add an :code:`FSLDIR` enviroment variable on the host Windows machine. This should be set to :code:`\\wsl$\usr\local\fsl` assuming the default install directory for FSL on the WSL guest. In Powershell this can be done with the command :code:`$env:FSLDIR = "\\wsl$\usr\local\fsl"`.
Operating systems
~~~~~~~~~~~~~~~~~
FSL-MRS has been tested thoroughly on Mac and Linux operating systems. FSL-MRS dependencies and FSL-MRS is available on native Windows installations, but has not currently been tested. `Windows Subsystem for Linux <https://docs.microsoft.com/en-us/windows/wsl/install-win10>`_ (or WSL2) offers a Linux interface on Windows. FSL-MRS has been tested on WSL.
\ No newline at end of file
3. Install FSL-MRS on the native Windows machine by following the conda installation guide in Option 1.
\ No newline at end of file
......@@ -338,7 +338,13 @@ class MRSI(object):
if indicies is None:
indicies = self.get_indicies_in_order()
nt = data_list[0].size
# Deal with the variable types (float vs np.float64) that pandas
# seems to generate depending on (python?) version.
if isinstance(data_list[0], (float, int)):
nt = 1
else:
nt = data_list[0].size
if nt > 1:
data = np.zeros(self.spatial_shape + (nt,), dtype=dtype)
else:
......
......@@ -359,6 +359,7 @@ def main():
for metab in metabs:
metab_conc_list = [res[0].getConc(scaling=scale, metab=metab)
for res in results]
file_nm = os.path.join(cur_fldr, metab + '.nii.gz')
save_img_output(file_nm,
mrsi.list_to_matched_array(
......
......@@ -19,6 +19,7 @@ setup(name='fsl_mrs',
long_description=long_description,
long_description_content_type="text/markdown",
packages=['fsl_mrs',
'fsl_mrs.scripts',
'fsl_mrs.core',
'fsl_mrs.utils',
'fsl_mrs.utils.mrs_io',
......@@ -36,16 +37,20 @@ setup(name='fsl_mrs',
'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_preproc_edit',
'fsl_mrs/scripts/fsl_mrs_proc',
'fsl_mrs/scripts/fsl_mrs_sim',
'fsl_mrs/scripts/mrs_tools',
'fsl_mrs/scripts/basis_tools',
'fsl_mrs/scripts/merge_mrs_reports',
'fsl_mrs/scripts/svs_segment',
'fsl_mrs/scripts/mrsi_segment',
'fsl_mrs/scripts/results_to_spectrum']
entry_points={
'console_scripts': [
'fsl_mrs = fsl_mrs.scripts.fsl_mrs:main',
'fsl_mrsi = fsl_mrs.scripts.fsl_mrsi:main',
'fsl_mrs_preproc = fsl_mrs.scripts.fsl_mrs_preproc:main',
'fsl_mrs_preproc_edit = fsl_mrs.scripts.fsl_mrs_preproc_edit:main',
'fsl_mrs_proc = fsl_mrs.scripts.fsl_mrs_proc:main',
'fsl_mrs_sim = fsl_mrs.scripts.fsl_mrs_sim:main',
'mrs_tools = fsl_mrs.scripts.mrs_tools:main',
'basis_tools = fsl_mrs.scripts.basis_tools:main',
'merge_mrs_reports = fsl_mrs.scripts.merge_mrs_reports:main',
'svs_segment = fsl_mrs.scripts.svs_segment:main',
'mrsi_segment = fsl_mrs.scripts.mrsi_segment:main',
'results_to_spectrum = fsl_mrs.scripts.results_to_spectrum:main'
]
}
)
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