Skip to content

Commit de56b4c

Browse files
committed
Merge branch 'master' into enh/MRTrix3
2 parents 15dd7a8 + 1bef289 commit de56b4c

File tree

3 files changed

+44
-18
lines changed

3 files changed

+44
-18
lines changed

doc/quickstart.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,13 @@ Developer guides
5050
devel/gitwash/index
5151

5252
.. include:: links_names.txt
53+
54+
Useful links for beginners
55+
===========================
56+
57+
Getting started with Python - Tutorials. `Available here`__
58+
59+
Python for Beginners `Available here`__
60+
61+
__ http://www.codecademy.com/en/tracks/python
62+
__ https://www.python.org/about/gettingstarted/

doc/users/tutorial_101.rst

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,15 @@ This results in a workflow containing two isolated nodes:
9999

100100
**5. Connecting nodes to each other**
101101

102-
We want to connect the output produced by realignment to the input of
103-
smoothing. This is done as follows.
102+
We want to connect the output produced by the node realignment to the input of
103+
the node smoothing. This is done as follows.
104104

105105
.. testcode::
106106

107107
workflow.connect(realigner, 'realigned_files', smoother, 'in_files')
108108

109-
or alternatively, a more flexible notation can be used. Although not shown here,
110-
the following notation can be used to connect multiple outputs from one node to
109+
110+
Although not shown here, the following notation can be used to connect multiple outputs from one node to
111111
multiple inputs (see step 7 below).
112112

113113
.. testcode::
@@ -189,3 +189,22 @@ inside which are three folders: realign, smooth and artdetect (the names
189189
of the nodes). The outputs of these routines are in these folders.
190190

191191
.. include:: ../links_names.txt
192+
193+
.. glossary::
194+
195+
pipeline
196+
Connected series of processes (processes can be run parallel and or sequential)
197+
198+
workflow
199+
(kind of synonymous to pipeline) = hosting the nodes
200+
201+
node
202+
= switching-point within a pipeline, you can give it a name (in the above example e.g. realigner),
203+
a node usually requires an or several inputs and will produce an or several outputs
204+
205+
interface
206+
= specific software (e.g. FSL, SPM ...) are wrapped in interfaces, within a node instances of an
207+
interface can be run
208+
209+
modules
210+
for each interface the according modules have to be imported in the usual pythonic manner

nipype/utils/nipype2boutiques.py

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,29 +40,27 @@ def print_inputs(tool_name, module=None, function=None):
4040
tool_outputs = []
4141

4242
for name, spec in sorted(interface.inputs.traits(transient=None).items()):
43-
44-
#FIXME: optional inputs are not supported yet
45-
if not ( hasattr(spec, "mandatory") and spec.mandatory ):
46-
continue
4743

4844
input = {}
45+
4946
input['name'] = name
5047
type = spec.full_info(inputs, name, None)
51-
if not "an existing file name" in type:
52-
type = "String"
48+
if "an existing file name" in type:
49+
type = "File"
5350
else:
54-
type = "File"
51+
type = "String"
5552
input['type'] = type
5653
input['description'] = "\n".join(interface._get_trait_desc(inputs, name, spec))[len(name)+2:].replace("\n\t\t",". ")
5754
command_line_key = "["+str(input_counter)+"_"+name.upper()+"]"
5855
input_counter += 1
5956
input['command-line-key'] = command_line_key
6057
input['cardinality'] = "Single"
61-
tool_inputs.append(input)
62-
63-
if not ( hasattr(spec, "mandatory") and spec.mandatory ):
64-
command_line+= "--%s"%name+" " # unreachable code as long as optional inputs are not supported
58+
if not ( hasattr(spec, "mandatory") and spec.mandatory ):
59+
input['optional'] = "true"
60+
input['command-line-flag'] = "--%s"%name+" "
6561

62+
tool_inputs.append(input)
63+
6664
command_line+= command_line_key+" "
6765

6866
# add value to input so that output names can be generated
@@ -89,8 +87,7 @@ def print_inputs(tool_name, module=None, function=None):
8987
output['value-template'] = os.path.basename(output_value)
9088

9189
output['cardinality'] = "Single"
92-
if output['value-template'] != "": # outputs with no templates would certainly crash.
93-
tool_outputs.append(output)
90+
tool_outputs.append(output)
9491

9592
# remove all temporary file names from inputs
9693
for input in tool_inputs:
@@ -101,7 +98,7 @@ def print_inputs(tool_name, module=None, function=None):
10198
tool_desc['command-line'] = command_line
10299
tool_desc['docker-image'] = 'docker.io/robdimsdale/nipype'
103100
tool_desc['docker-index'] = 'http://index.docker.io'
104-
tool_desc['schema-version'] = '0.1'
101+
tool_desc['schema-version'] = '0.2-snapshot'
105102
print json.dumps(tool_desc, indent=4, separators=(',', ': '))
106103

107104
def main(argv):

0 commit comments

Comments
 (0)