Skip to content

Commit 9c29cfc

Browse files
committed
TESTS improve coverage
1 parent 5726875 commit 9c29cfc

File tree

4 files changed

+16
-44
lines changed

4 files changed

+16
-44
lines changed

.coveragerc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
[run]
22
omit =
33
./setup.py
4-
./setupegg.py
5-
./sphinx_pypi_upload.py
64
./doc/*
7-
/home/travis/virtualenv/*
5+
./tests/fetch_config.py

.gitlab-ci.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

nisnap/xnat.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -403,18 +403,18 @@ def plot_segment(config, experiment_id, savefig=None, slices=None,
403403
log.warning(msg)
404404
raw = True
405405

406+
options = ['aparc+aseg.mgz']
407+
fn0 = '%s.hippoAmygLabels-T1.v21.%s.FSvoxelSpace.mgz'
408+
for side in ['lh', 'rh']:
409+
for each in ['CA', 'HBT', 'FS60']:
410+
options.append(fn0 % (side, each))
406411
if resource_name == 'FREESURFER7_EXTRAS':
407412
options = ['hypothalamic_subunits_seg.v1.mgz',
408413
'ThalamicNuclei.v12.T1.FSvoxelSpace.mgz',
409414
'brainstemSsLabels.v12.FSvoxelSpace.mgz']
410415
if fn not in options:
411416
raise Exception('`fn` should be among %s' % options)
412417
elif resource_name.startswith('FREESURFER'):
413-
options = ['aparc+aseg.mgz']
414-
fn0 = '%s.hippoAmygLabels-T1.v21.%s.FSvoxelSpace.mgz'
415-
for side in ['lh', 'rh']:
416-
for each in ['CA', 'HBT', 'FS60']:
417-
options.append(fn0 % (side, each))
418418
if fn not in options:
419419
raise Exception('`fn` should be among %s' % options)
420420

tests/tests.py

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -178,19 +178,13 @@ def test_xnat_freesurfer_009(self):
178178
samebox=True, labels=[9, 17, 48, 53])
179179

180180
def test_xnat_freesurfer7_extras_010(self):
181-
from nisnap import xnat, snap
182-
from nisnap.utils import aseg
183-
184-
filepaths = xnat.download_resources(config='.xnat.cfg',
185-
experiment_id='BBRCDEV_E02823',
186-
resource_name='FREESURFER7_EXTRAS',
187-
destination='/tmp/')
188-
aseg_fp = filepaths[-1]
189-
aseg.__swap_fs__(aseg_fp)
190-
try:
191-
aseg.__preproc_aseg__(aseg_fp, filepaths[1])
192-
except Exception:
193-
pass
194-
snap.plot_segment(aseg_fp, bg=filepaths[1], axes='x', opacity=70,
195-
rowsize=4, figsize=(15, 15), savefig='/tmp/test.png',
196-
animated=False, samebox=True)
181+
from nisnap import xnat
182+
xnat.plot_segment(config='.xnat.cfg',
183+
experiment_id='BBRCDEV_E02823',
184+
resource_name='FREESURFER7_EXTRAS',
185+
savefig='/tmp/test.png',
186+
fn='hypothalamic_subunits_seg.v1.mgz')
187+
xnat.plot_segment(config='.xnat.cfg',
188+
experiment_id='BBRCDEV_E02823',
189+
resource_name='FREESURFER7',
190+
savefig='/tmp/test.png')

0 commit comments

Comments
 (0)