Skip to content

Commit 5e13478

Browse files
committed
after comments from Chris
1 parent 42fe6d5 commit 5e13478

File tree

5 files changed

+17
-74
lines changed

5 files changed

+17
-74
lines changed

doc/devel/cmd_interface_devel.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ above example we have used the ``desc`` metadata which holds human readable
3939
description of the input. The ``mandatory`` flag forces Nipype to throw an
4040
exception if the input was not set. ``exists`` is a special flag that works only
4141
for ``File traits`` and checks if the provided file exists. More details can be
42-
found at :ref:`interface_specs`.
42+
found at :doc:`interface_specs`.
4343

4444
The input and output specifications have to be connected to the our example
4545
interface class:
@@ -80,7 +80,7 @@ symbols. For an input defined in InputSpec to be included into the executed
8080
commandline ``argstr`` has to be included. Additionally inside the main
8181
interface class you need to specify the name of the executable by assigning it
8282
to the ``_cmd`` field. Also the main interface class needs to inherit from
83-
:class:`CommandLine <nipype.interfaces.base.CommandLine>`:
83+
:class:`CommandLine <nipype.interfaces.base.core.CommandLine>`:
8484

8585
.. testcode::
8686

@@ -92,7 +92,7 @@ to the ``_cmd`` field. Also the main interface class needs to inherit from
9292
There is one more thing we need to take care of. When the executable finishes
9393
processing it will presumably create some output files. We need to know which
9494
files to look for, check if they exist and expose them to whatever node would
95-
like to use them. This is done by implementing :func:`_list_outputs <nipype.interfaces.base.BaseInterface._list_outputs>` method in the
95+
like to use them. This is done by implementing ``_list_outputs`` method in the
9696
main interface class. Basically what it does is assigning the expected output
9797
files to the fields of our output spec:
9898

doc/devel/matlab_interface_devel.rst

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -24,61 +24,6 @@ By subclassing :class:`nipype.interfaces.matlab.MatlabCommand` for your main
2424
class, and :class:`nipype.interfaces.matlab.MatlabInputSpec` for your input and
2525
output spec, you gain access to some useful MATLAB hooks
2626

27-
.. testcode::
28-
29-
import os
30-
from nipype.interfaces.base import File, traits
31-
from nipype.interfaces.matlab import MatlabCommand, MatlabInputSpec
32-
33-
class HelloWorldInputSpec( MatlabInputSpec):
34-
name = traits.Str(mandatory = True,
35-
desc = 'Name of person to say hello to')
36-
37-
class HelloWorldOutputSpec(MatlabInputSpec):
38-
matlab_output = traits.Str()
39-
40-
class HelloWorld(MatlabCommand):
41-
""" Basic Hello World that displays Hello <name> in MATLAB
42-
43-
Returns
44-
-------
45-
46-
matlab_output : capture of matlab output which may be
47-
parsed by user to get computation results
48-
49-
Examples
50-
--------
51-
52-
>>> hello = HelloWorld()
53-
>>> hello.inputs.name = 'hello_world'
54-
>>> out = hello.run()
55-
>>> print(out.outputs.matlab_output)
56-
"""
57-
input_spec = HelloWorldInputSpec
58-
output_spec = HelloWorldOutputSpec
59-
60-
def _my_script(self):
61-
"""This is where you implement your script"""
62-
script = """
63-
disp('Hello %s Python')
64-
two = 1 + 1
65-
"""%(self.inputs.name)
66-
return script
67-
68-
def run(self, **inputs):
69-
## inject your script
70-
self.inputs.script = self._my_script()
71-
results = super(MatlabCommand, self).run( **inputs)
72-
stdout = results.runtime.stdout
73-
# attach stdout to outputs to access matlab results
74-
results.outputs.matlab_output = stdout
75-
return results
76-
77-
def _list_outputs(self):
78-
outputs = self._outputs().get()
79-
return outputs
80-
81-
8227
.. literalinclude:: matlab_example2.py
8328

8429
.. admonition:: Example source code

doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
packages (e.g., ANTS_, SPM_, FSL_, FreeSurfer_, Camino_, MRtrix_, MNE_, AFNI_,
1919
Slicer_), eases the design of workflows within and between packages, and
2020
reduces the learning curve necessary to use different packages. Nipype is
21-
creating a collaborative platform for neuroimaging software development
21+
creating a collaborative platform for neuroimaging software development
2222
in a high-level language and addressing limitations of existing pipeline
2323
systems.
2424

examples/fmri_ants_openfmri.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,10 @@ def create_reg_workflow(name='registration'):
161161
"""
162162
Compute registration between the subject's structural and MNI template
163163
164-
* All parameters are set using the example from: \
165-
`newAntsExample.sh <https://github.com/stnava/ANTs/blob/master/Scripts/newAntsExample.sh>`_
166-
* This is currently set to perform a very quick registration. However,\
167-
the registration can be made significantly more accurate for cortical\
164+
* All parameters are set using the example from:
165+
#https://github.com/stnava/ANTs/blob/master/Scripts/newAntsExample.sh
166+
* This is currently set to perform a very quick registration. However,
167+
the registration can be made significantly more accurate for cortical
168168
structures by increasing the number of iterations.
169169
"""
170170

@@ -257,9 +257,7 @@ def create_reg_workflow(name='registration'):
257257

258258

259259
def get_aparc_aseg(files):
260-
"""
261-
Return the aparc+aseg.mgz file
262-
"""
260+
"""Return the aparc+aseg.mgz file"""
263261

264262
for name in files:
265263
if 'aparc+aseg.mgz' in name:
@@ -371,10 +369,10 @@ def create_fs_reg_workflow(name='registration'):
371369
"""
372370
Compute registration between the subject's structural and MNI template
373371
374-
* All parameters are set using the example from: \
375-
`newAntsExample.sh <https://github.com/stnava/ANTs/blob/master/Scripts/newAntsExample.sh>`_
376-
* This is currently set to perform a very quick registration. However,\
377-
the registration can be made significantly more accurate for cortical\
372+
* All parameters are set using the example from:
373+
#https://github.com/stnava/ANTs/blob/master/Scripts/newAntsExample.sh
374+
* This is currently set to perform a very quick registration. However,
375+
the registration can be made significantly more accurate for cortical
378376
structures by increasing the number of iterations.
379377
"""
380378

examples/rsfmri_vol_surface_preprocessing_nipy.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -444,10 +444,10 @@ def create_reg_workflow(name='registration'):
444444
"""
445445
Compute registration between the subject's structural and MNI template
446446
447-
* All parameters are set using the example from: \
448-
`newAntsExample.sh <https://github.com/stnava/ANTs/blob/master/Scripts/newAntsExample.sh>`_
449-
* This is currently set to perform a very quick registration. However,\
450-
the registration can be made significantly more accurate for cortical\
447+
* All parameters are set using the example from:
448+
#https://github.com/stnava/ANTs/blob/master/Scripts/newAntsExample.sh
449+
* This is currently set to perform a very quick registration. However,
450+
the registration can be made significantly more accurate for cortical
451451
structures by increasing the number of iterations.
452452
"""
453453

0 commit comments

Comments
 (0)