Commit 4cd47b10 authored by William Clarke's avatar William Clarke
Browse files

Add test for mrsi_segment.

parent 1c3324e8
......@@ -5,36 +5,38 @@
# Author: William Clarke <william.clarke@ndcn.ox.ac.uk>
# Saad Jbabdi <saad@fmrib.ox.ac.uk>
#
# Copyright (C) 2019 University of Oxford
# Copyright (C) 2019 University of Oxford
# SHBASECOPYRIGHT
# Quick imports
import argparse
from fsl_mrs import __version__
from fsl_mrs.utils.splash import splash
# Imports required for multi-threading function
import copy
import numpy as np
from fsl_mrs.denmatsim import simseq as sim
from fsl_mrs.utils.mrs_io import fsl_io,lcm_io,jmrui_io
import os,datetime
from fsl_mrs.utils.mrs_io import fsl_io, lcm_io, jmrui_io
import os
import datetime
def main():
p = argparse.ArgumentParser(description='FSL Magnetic Resonance Spectroscopy Tools')
p.add_argument('-v','--version', action='version', version=__version__)
required = p.add_argument_group('required arguments')
mutual = required.add_mutually_exclusive_group(required=True)
optional = p.add_argument_group('optional arguments')
p = argparse.ArgumentParser(
description='FSL Magnetic Resonance Spectroscopy Tools')
p.add_argument('-v', '--version', action='version', version=__version__)
required = p.add_argument_group('required arguments')
mutual = required.add_mutually_exclusive_group(required=True)
optional = p.add_argument_group('optional arguments')
# positional REQUIRED ARGUMENTS
p.add_argument('seqFile',type=str,metavar='SEQUENCE',
help='pulse sequence file or previous results file')
p.add_argument('seqFile', type=str, metavar='SEQUENCE',
help='pulse sequence file or previous results file')
# Mutual required arguments
mutual.add_argument('-m','--metab',type=str, metavar='METAB',
help='Single metabolite string')
mutual.add_argument('-m', '--metab', type=str, metavar='METAB',
help='Single metabolite string')
mutual.add_argument('-b','--batch',type=str, metavar='METAB_FILE',
help='Batch simulate metabolites. Path to file containing metabolite list.')
......
# Test the mrsi segmentation script
# Imports
import subprocess
from pathlib import Path
# Files
testsPath = Path(__file__).parent
anat = testsPath / 'testdata/mrsi_segment/T1.anat'
mrsi = testsPath / 'testdata/fsl_mrsi/FID_metab.nii.gz'
def test_mrsi_segment(tmp_path):
subprocess.check_call(['mrsi_segment',
'-a', anat,
'-o', tmp_path,
mrsi])
assert (tmp_path / 'mrsi_seg_wm.nii.gz').exists()
assert (tmp_path / 'mrsi_seg_gm.nii.gz').exists()
assert (tmp_path / 'mrsi_seg_csf.nii.gz').exists()
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