Skip to content

Commit 6a1497d

Browse files
author
Shoshana Berleant
committed
use relative paths in doctests
1 parent ea60782 commit 6a1497d

File tree

1 file changed

+29
-2
lines changed

1 file changed

+29
-2
lines changed

nipype/algorithms/compcor.py

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# -*- coding: utf-8 -*-
2+
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
3+
# vi: set ft=python sts=4 ts=4 sw=4 et:
4+
'''
5+
Miscellaneous algorithms
6+
7+
Change directory to provide relative paths for doctests
8+
>>> import os
9+
>>> filepath = os.path.dirname(os.path.realpath(__file__))
10+
>>> datadir = os.path.realpath(os.path.join(filepath, '../testing/data'))
11+
>>> os.chdir(datadir)
12+
13+
'''
114
from ..interfaces.base import (BaseInterfaceInputSpec, TraitedSpec,
215
BaseInterface, traits, File)
316
from ..pipeline import engine as pe
@@ -38,8 +51,8 @@ class CompCor(BaseInterface):
3851
-------
3952
4053
>>> ccinterface = CompCor()
41-
>>> ccinterface.inputs.realigned_file = 'nipype/testing/data/functional.nii'
42-
>>> ccinterface.inputs.mask_file = 'nipype/testing/data/mask.nii'
54+
>>> ccinterface.inputs.realigned_file = 'functional.nii'
55+
>>> ccinterface.inputs.mask_file = 'mask.nii'
4356
>>> ccinterface.inputs.num_components = 1
4457
>>> ccinterface.inputs.use_regress_poly = True
4558
>>> ccinterface.inputs.regress_poly_degree = 2
@@ -112,6 +125,20 @@ class TCompCorInputSpec(CompCorInputSpec):
112125
'with the highest variance are used.')
113126

114127
class TCompCor(CompCor):
128+
'''
129+
Interface for tCompCor. Computes a ROI mask based on variance of voxels.
130+
131+
Example
132+
-------
133+
134+
>>> ccinterface = TCompCor()
135+
>>> ccinterface.inputs.realigned_file = 'functional.nii'
136+
>>> ccinterface.inputs.mask_file = 'mask.nii'
137+
>>> ccinterface.inputs.num_components = 1
138+
>>> ccinterface.inputs.use_regress_poly = True
139+
>>> ccinterface.inputs.regress_poly_degree = 2
140+
>>> ccinterface.inputs.percentile_threshold = .03
141+
'''
115142

116143
input_spec = TCompCorInputSpec
117144
output_spec = CompCorOutputSpec

0 commit comments

Comments
 (0)