Skip to content

Commit 594b22f

Browse files
BUG: skip doctests in example code
1 parent 0e0b7f2 commit 594b22f

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

nibabel/cifti2/cifti2_axes.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@
4949
We can create brain models covering the left cortex and left thalamus using:
5050
5151
>>> from nibabel import cifti2
52-
>>> bm_cortex = cifti2.BrainModel.from_mask(cortex_mask, brain_structure='cortex_left')
52+
>>> bm_cortex = cifti2.BrainModel.from_mask(cortex_mask,
53+
... brain_structure='cortex_left') # doctest: +SKIP
5354
>>> bm_thal = cifti2.BrainModel.from_mask(thalamus_mask, affine=affine,
54-
brain_structure='thalamus_left')
55+
... brain_structure='thalamus_left') # doctest: +SKIP
5556
5657
Brain structure names automatically get converted to valid CIfTI2 indentifiers using
5758
:meth:`BrainModel.to_cifti_brain_structure_name`.
@@ -61,20 +62,20 @@
6162
These can be concatenated in a single brain model covering the left cortex and thalamus by
6263
simply adding them together
6364
64-
>>> bm_full = bm_cortex + bm_thal
65+
>>> bm_full = bm_cortex + bm_thal # doctest: +SKIP
6566
6667
Brain models covering the full HCP grayordinate space can be constructed by adding all the
6768
volumetric and surface brain models together like this (or by reading one from an already
6869
existing HCP file).
6970
7071
Getting a specific brain region from the full brain model is as simple as:
7172
72-
>>> assert bm_full[bm_full.name == 'CIFTI_STRUCTURE_CORTEX_LEFT'] == bm_cortex
73-
>>> assert bm_full[bm_full.name == 'CIFTI_STRUCTURE_THALAMUS_LEFT'] == bm_thal
73+
>>> assert bm_full[bm_full.name == 'CIFTI_STRUCTURE_CORTEX_LEFT'] == bm_cortex # doctest: +SKIP
74+
>>> assert bm_full[bm_full.name == 'CIFTI_STRUCTURE_THALAMUS_LEFT'] == bm_thal # doctest: +SKIP
7475
7576
You can also iterate over all brain structures in a brain model:
7677
77-
>>> for name, slc, bm in bm_full.iter_structures(): ...
78+
>>> for name, slc, bm in bm_full.iter_structures(): ... # doctest: +SKIP
7879
7980
In this case there will be two iterations, namely:
8081
('CIFTI_STRUCTURE_CORTEX_LEFT', slice(0, <size of cortex mask>), bm_cortex)
@@ -84,25 +85,26 @@
8485
Parcels can be constructed from selections of these brain models:
8586
8687
>>> parcel = cifti2.Parcels.from_brain_models([
87-
('surface_parcel', bm_cortex[:100]), # contains first 100 cortical vertices
88-
('volume_parcel', bm_thal), # contains thalamus
89-
('combined_parcel', bm_full[[1, 8, 10, 50, 120, 127]) # contains selected voxels/vertices
90-
])
88+
... ('surface_parcel', bm_cortex[:100]), # contains first 100 cortical vertices
89+
... ('volume_parcel', bm_thal), # contains thalamus
90+
... ('combined_parcel', bm_full[[1, 8, 10, 50, 120, 127]) # contains selected voxels/vertices
91+
... ]) # doctest: +SKIP
9192
9293
Time series are represented by their starting time (typically 0), step size
9394
(i.e. sampling time or TR), and number of elements:
9495
95-
>>> series = cifti2.Series(start=0, step=100, size=5000)
96+
>>> series = cifti2.Series(start=0, step=100, size=5000) # doctest: +SKIP
9697
9798
So a header for fMRI data with a TR of 100 ms covering the left cortex and thalamus with
9899
5000 timepoints could be created with
99100
100-
>>> cifti2.Cifti2Header.from_axes((series, bm_cortex + bm_thal))
101+
>>> cifti2.Cifti2Header.from_axes((series, bm_cortex + bm_thal)) # doctest: +SKIP
101102
102103
Similarly the curvature and cortical thickness on the left cortex could be stored using a header
103104
like:
104105
105-
>>> cifti2.Cifti2Header.from_axes((cifti.Scalar(['curvature', 'thickness'], bm_cortex))
106+
>>> cifti2.Cifti2Header.from_axes((cifti.Scalar(['curvature', 'thickness'],
107+
... bm_cortex)) # doctest: +SKIP
106108
"""
107109
import numpy as np
108110
from . import cifti2

0 commit comments

Comments
 (0)