Inheritance diagram for nipype.interfaces.base:
Package contains interfaces for using existing functionality in other packages
Exaples FSL, matlab/SPM , afni
Requires Packages to be installed
Bases: nipype.interfaces.base.Interface
Implements common interface functionality.
Attributes
output_spec |
Methods
aggregate_outputs([runtime, needed_outputs]) | Collate expected outputs and check for existence |
help([returnhelp]) | Prints class help |
input_spec | |
run(**inputs) | Execute this interface. |
Collate expected outputs and check for existence
Prints class help
alias of BaseInterfaceInputSpec
Execute this interface.
This interface will not raise an exception if runtime.returncode is non-zero.
Parameters: | inputs : allows the interface settings to be updated |
---|---|
Returns: | results : an InterfaceResult object containing a copy of the instance that was executed, provenance information and, if successful, results : |
Bases: nipype.interfaces.base.TraitedSpec
Methods
add_class_trait(name, *trait) | Adds a named trait attribute to this class. |
add_trait(name, *trait) | Adds a trait attribute to this object. |
add_trait_category(category) | Adds a trait category to a class. |
add_trait_listener(object[, prefix]) | |
all_trait_names() | Returns the list of all trait names, including implicitly defined |
base_trait(name) | Returns the base trait definition for a trait attribute. |
class_default_traits_view() | Returns the name of the default traits view for the class. |
class_editable_traits() | Returns an alphabetically sorted list of the names of non-event |
class_trait_names(**metadata) | Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified. |
class_trait_view([name, view_element]) | |
class_trait_view_elements() | Returns the ViewElements object associated with the class. |
class_traits(**metadata) | Returns a dictionary containing the definitions of all of the trait attributes of the class that match the set of metadata criteria. |
clone_traits([traits, memo, copy]) | Clones a new object from this one, optionally copying only a specified set of traits. |
configure_traits([filename, view, kind, ...]) | Creates and displays a dialog box for editing values of trait |
copy_traits(other[, traits, memo, copy]) | Copies another object’s trait attributes into this one. |
copyable_trait_names(**metadata) | Returns the list of trait names to copy or clone by default. |
default_traits_view() | Returns the name of the default traits view for the object’s class. |
edit_traits([view, parent, kind, context, ...]) | Displays a user interface window for editing trait attribute values. |
editable_traits() | Returns an alphabetically sorted list of the names of non-event |
get(**kwargs) | Returns traited class as a dict |
get_hashval([hash_method]) | Return a dictionary of our items with hashes for each file. |
get_traitsfree(**kwargs) | Returns traited class as a dict |
has_traits_interface(*interfaces) | Returns whether the object implements a specified traits interface. |
items() | Name, trait generator for user modifiable traits |
on_trait_change(handler[, name, remove, ...]) | Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association. |
on_trait_event(handler[, name, remove, ...]) | Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association. |
print_traits([show_help]) | Prints the values of all explicitly-defined, non-event trait attributes on the current object, in an easily readable format. |
remove_trait(name) | Removes a trait attribute from this object. |
remove_trait_listener(object[, prefix]) | |
reset_traits([traits]) | Resets some or all of an object’s trait attributes to their default values. |
set([trait_change_notify]) | Shortcut for setting object trait attributes. |
set_trait_dispatch_handler(name, klass[, ...]) | Sets a trait notification dispatch handler. |
sync_trait(trait_name, object[, alias, ...]) | Synchronizes the value of a trait attribute on this object with a trait attribute on another object. |
trait(name[, force, copy]) | Returns the trait definition for the name trait attribute. |
trait_context() | Returns the default context to use for editing or configuring |
trait_get(*names, **metadata) | Shortcut for getting object trait attributes. |
trait_items_event(event_trait,name,items_event) | |
trait_monitor(handler[, remove]) | Adds or removes the specified handler from the list of active monitors. |
trait_names(**metadata) | Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified. |
trait_property_changed(...) | |
trait_set([trait_change_notify]) | Shortcut for setting object trait attributes. |
trait_setq(**traits) | Shortcut for setting object trait attributes. |
trait_subclasses([all]) | Returns a list of the immediate (or all) subclasses of this class. |
trait_view([name, view_element]) | Gets or sets a ViewElement associated with an object’s class. |
trait_view_elements() | Returns the ViewElements object associated with the object’s |
trait_views([klass]) | Returns a list of the names of all view elements associated with the current object’s class. |
traits(**metadata) | Returns a dictionary containing the definitions of all of the trait attributes of this object that match the set of metadata criteria. |
traits_init() | |
traits_inited([True]) | |
validate_trait(name, value) | Validates whether a value is legal for a trait. |
Initialize handlers and inputs
Adds a named trait attribute to this class.
Parameters: | name : string
trait : a trait or a value that can be converted to a trait using Trait()
|
---|
Adds a trait attribute to this object.
Parameters: | name : string
trait : trait or a value that can be converted to a trait by Trait()
|
---|
Adds a trait category to a class.
Returns the list of all trait names, including implicitly defined traits.
Returns the base trait definition for a trait attribute.
Parameters: | name : string
|
---|
Returns the name of the default traits view for the class.
Returns an alphabetically sorted list of the names of non-event trait attributes associated with the current class.
Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified.
Parameters: | metadata : dictionary
|
---|
Returns the ViewElements object associated with the class.
The returned object can be used to access all the view elements associated with the class.
Returns a dictionary containing the definitions of all of the trait attributes of the class that match the set of metadata criteria.
Parameters: | metadata : dictionary
|
---|
Clones a new object from this one, optionally copying only a specified set of traits.
Parameters: | traits : list of strings
memo : dictionary
copy : None | ‘deep’ | ‘shallow’
|
---|---|
Returns: | The newly cloned object. : |
Creates and displays a dialog box for editing values of trait attributes, as if it were a complete, self-contained GUI application.
Parameters: | filename : string
view : view or string
kind : string
edit : Boolean
context : object or dictionary
handler : Handler object
id : string
scrollable : Boolean
|
---|
Copies another object’s trait attributes into this one.
Parameters: | other : object
traits : list of strings
memo : dictionary
copy : None | ‘deep’ | ‘shallow’
|
---|---|
Returns: | A list of attributes that the method was unable to copy, : which is empty if all the attributes were successfully copied. : |
Returns the list of trait names to copy or clone by default.
Returns the name of the default traits view for the object’s class.
Displays a user interface window for editing trait attribute values.
Parameters: | view : view or string
parent : window handle
kind : string
context : object or dictionary
handler : Handler object
id : string
scrollable : Boolean
|
---|
Returns an alphabetically sorted list of the names of non-event trait attributes associated with the current object.
Returns traited class as a dict
Augments the trait get function to return a dictionary without notification handles
Return a dictionary of our items with hashes for each file.
Searches through dictionary items and if an item is a file, it calculates the md5 hash of the file contents and stores the file name and hash value as the new key value.
However, the overall bunch hash is calculated only on the hash value of a file. The path and name of the file are not used in the overall hash calculation.
Returns: | dict_withhash : dict
hashvalue : str
|
---|
Returns traited class as a dict
Augments the trait get function to return a dictionary without any traits. The dictionary does not contain any attributes that were Undefined
Returns whether the object implements a specified traits interface.
Parameters: | interfaces : one or more traits Interface (sub)classes. |
---|
Name, trait generator for user modifiable traits
Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association.
Parameters: | handler : function
name : string
remove : Boolean
dispatch : string
|
---|
Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association.
Parameters: | handler : function
name : string
remove : Boolean
dispatch : string
|
---|
Prints the values of all explicitly-defined, non-event trait attributes on the current object, in an easily readable format.
Parameters: | show_help : Boolean
|
---|
Removes a trait attribute from this object.
Parameters: | name : string
|
---|
Resets some or all of an object’s trait attributes to their default values.
Parameters: | traits : list of strings
|
---|---|
Returns: | A list of attributes that the method was unable to reset, which is empty : if all the attributes were successfully reset. : |
Shortcut for setting object trait attributes.
Parameters: | trait_change_notify : Boolean
traits : list of key/value pairs
|
---|---|
Returns: | self :
|
Sets a trait notification dispatch handler.
Synchronizes the value of a trait attribute on this object with a trait attribute on another object.
Parameters: | name : string
object : object
alias : string
mutual : Boolean or integer
remove : Boolean or integer
|
---|
Returns the trait definition for the name trait attribute.
Parameters: | name : string
force : Boolean
copy : Boolean
|
---|
Returns the default context to use for editing or configuring traits.
Shortcut for getting object trait attributes.
Parameters: | names : list of trait attribute names
|
---|---|
Returns: | A dictionary whose keys are the names passed as arguments and whose : values are the corresponding trait values : |
Adds or removes the specified handler from the list of active monitors.
Parameters: | handler : function
remove : boolean
|
---|
Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified.
Parameters: | metadata : dictionary
|
---|
Shortcut for setting object trait attributes.
Parameters: | trait_change_notify : Boolean
traits : list of key/value pairs
|
---|---|
Returns: | self :
|
Shortcut for setting object trait attributes.
Parameters: | traits : list of key/value pairs
|
---|---|
Returns: | self :
|
Returns a list of the immediate (or all) subclasses of this class.
Parameters: | all : Boolean
|
---|
Gets or sets a ViewElement associated with an object’s class.
Parameters: | name : string
view_element : a ViewElement object
|
---|---|
Returns: | A view element. : |
Returns the ViewElements object associated with the object’s class.
The returned object can be used to access all the view elements associated with the class.
Returns a list of the names of all view elements associated with the current object’s class.
Parameters: | klass : a class
|
---|
Returns a dictionary containing the definitions of all of the trait attributes of this object that match the set of metadata criteria.
Parameters: | metadata : dictionary
|
---|
Validates whether a value is legal for a trait.
Returns the validated value if it is valid.
Bases: traits.has_traits.HasTraits
Provide a few methods necessary to support nipype interface api
The inputs attribute of interfaces call certain methods that are not available in traits.HasTraits. These are provided here.
new metadata:
new attribute:
XXX Reconsider this in the long run, but it seems like the best solution to move forward on the refactoring.
Methods
add_class_trait(name, *trait) | Adds a named trait attribute to this class. |
add_trait(name, *trait) | Adds a trait attribute to this object. |
add_trait_category(category) | Adds a trait category to a class. |
add_trait_listener(object[, prefix]) | |
all_trait_names() | Returns the list of all trait names, including implicitly defined |
base_trait(name) | Returns the base trait definition for a trait attribute. |
class_default_traits_view() | Returns the name of the default traits view for the class. |
class_editable_traits() | Returns an alphabetically sorted list of the names of non-event |
class_trait_names(**metadata) | Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified. |
class_trait_view([name, view_element]) | |
class_trait_view_elements() | Returns the ViewElements object associated with the class. |
class_traits(**metadata) | Returns a dictionary containing the definitions of all of the trait attributes of the class that match the set of metadata criteria. |
clone_traits([traits, memo, copy]) | Clones a new object from this one, optionally copying only a specified set of traits. |
configure_traits([filename, view, kind, ...]) | Creates and displays a dialog box for editing values of trait |
copy_traits(other[, traits, memo, copy]) | Copies another object’s trait attributes into this one. |
copyable_trait_names(**metadata) | Returns the list of trait names to copy or clone by default. |
default_traits_view() | Returns the name of the default traits view for the object’s class. |
edit_traits([view, parent, kind, context, ...]) | Displays a user interface window for editing trait attribute values. |
editable_traits() | Returns an alphabetically sorted list of the names of non-event |
get(**kwargs) | Returns traited class as a dict |
get_hashval([hash_method]) | Return a dictionary of our items with hashes for each file. |
get_traitsfree(**kwargs) | Returns traited class as a dict |
has_traits_interface(*interfaces) | Returns whether the object implements a specified traits interface. |
items() | Name, trait generator for user modifiable traits |
on_trait_change(handler[, name, remove, ...]) | Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association. |
on_trait_event(handler[, name, remove, ...]) | Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association. |
print_traits([show_help]) | Prints the values of all explicitly-defined, non-event trait attributes on the current object, in an easily readable format. |
remove_trait(name) | Removes a trait attribute from this object. |
remove_trait_listener(object[, prefix]) | |
reset_traits([traits]) | Resets some or all of an object’s trait attributes to their default values. |
set([trait_change_notify]) | Shortcut for setting object trait attributes. |
set_trait_dispatch_handler(name, klass[, ...]) | Sets a trait notification dispatch handler. |
sync_trait(trait_name, object[, alias, ...]) | Synchronizes the value of a trait attribute on this object with a trait attribute on another object. |
trait(name[, force, copy]) | Returns the trait definition for the name trait attribute. |
trait_context() | Returns the default context to use for editing or configuring |
trait_get(*names, **metadata) | Shortcut for getting object trait attributes. |
trait_items_event(event_trait,name,items_event) | |
trait_monitor(handler[, remove]) | Adds or removes the specified handler from the list of active monitors. |
trait_names(**metadata) | Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified. |
trait_property_changed(...) | |
trait_set([trait_change_notify]) | Shortcut for setting object trait attributes. |
trait_setq(**traits) | Shortcut for setting object trait attributes. |
trait_subclasses([all]) | Returns a list of the immediate (or all) subclasses of this class. |
trait_view([name, view_element]) | Gets or sets a ViewElement associated with an object’s class. |
trait_view_elements() | Returns the ViewElements object associated with the object’s |
trait_views([klass]) | Returns a list of the names of all view elements associated with the current object’s class. |
traits(**metadata) | Returns a dictionary containing the definitions of all of the trait attributes of this object that match the set of metadata criteria. |
traits_init() | |
traits_inited([True]) | |
validate_trait(name, value) | Validates whether a value is legal for a trait. |
Initialize handlers and inputs
Adds a named trait attribute to this class.
Parameters: | name : string
trait : a trait or a value that can be converted to a trait using Trait()
|
---|
Adds a trait attribute to this object.
Parameters: | name : string
trait : trait or a value that can be converted to a trait by Trait()
|
---|
Adds a trait category to a class.
Returns the list of all trait names, including implicitly defined traits.
Returns the base trait definition for a trait attribute.
Parameters: | name : string
|
---|
Returns the name of the default traits view for the class.
Returns an alphabetically sorted list of the names of non-event trait attributes associated with the current class.
Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified.
Parameters: | metadata : dictionary
|
---|
Returns the ViewElements object associated with the class.
The returned object can be used to access all the view elements associated with the class.
Returns a dictionary containing the definitions of all of the trait attributes of the class that match the set of metadata criteria.
Parameters: | metadata : dictionary
|
---|
Clones a new object from this one, optionally copying only a specified set of traits.
Parameters: | traits : list of strings
memo : dictionary
copy : None | ‘deep’ | ‘shallow’
|
---|---|
Returns: | The newly cloned object. : |
Creates and displays a dialog box for editing values of trait attributes, as if it were a complete, self-contained GUI application.
Parameters: | filename : string
view : view or string
kind : string
edit : Boolean
context : object or dictionary
handler : Handler object
id : string
scrollable : Boolean
|
---|
Copies another object’s trait attributes into this one.
Parameters: | other : object
traits : list of strings
memo : dictionary
copy : None | ‘deep’ | ‘shallow’
|
---|---|
Returns: | A list of attributes that the method was unable to copy, : which is empty if all the attributes were successfully copied. : |
Returns the list of trait names to copy or clone by default.
Returns the name of the default traits view for the object’s class.
Displays a user interface window for editing trait attribute values.
Parameters: | view : view or string
parent : window handle
kind : string
context : object or dictionary
handler : Handler object
id : string
scrollable : Boolean
|
---|
Returns an alphabetically sorted list of the names of non-event trait attributes associated with the current object.
Returns traited class as a dict
Augments the trait get function to return a dictionary without notification handles
Return a dictionary of our items with hashes for each file.
Searches through dictionary items and if an item is a file, it calculates the md5 hash of the file contents and stores the file name and hash value as the new key value.
However, the overall bunch hash is calculated only on the hash value of a file. The path and name of the file are not used in the overall hash calculation.
Returns: | dict_withhash : dict
hashvalue : str
|
---|
Returns traited class as a dict
Augments the trait get function to return a dictionary without any traits. The dictionary does not contain any attributes that were Undefined
Returns whether the object implements a specified traits interface.
Parameters: | interfaces : one or more traits Interface (sub)classes. |
---|
Name, trait generator for user modifiable traits
Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association.
Parameters: | handler : function
name : string
remove : Boolean
dispatch : string
|
---|
Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association.
Parameters: | handler : function
name : string
remove : Boolean
dispatch : string
|
---|
Prints the values of all explicitly-defined, non-event trait attributes on the current object, in an easily readable format.
Parameters: | show_help : Boolean
|
---|
Removes a trait attribute from this object.
Parameters: | name : string
|
---|
Resets some or all of an object’s trait attributes to their default values.
Parameters: | traits : list of strings
|
---|---|
Returns: | A list of attributes that the method was unable to reset, which is empty : if all the attributes were successfully reset. : |
Shortcut for setting object trait attributes.
Parameters: | trait_change_notify : Boolean
traits : list of key/value pairs
|
---|---|
Returns: | self :
|
Sets a trait notification dispatch handler.
Synchronizes the value of a trait attribute on this object with a trait attribute on another object.
Parameters: | name : string
object : object
alias : string
mutual : Boolean or integer
remove : Boolean or integer
|
---|
Returns the trait definition for the name trait attribute.
Parameters: | name : string
force : Boolean
copy : Boolean
|
---|
Returns the default context to use for editing or configuring traits.
Shortcut for getting object trait attributes.
Parameters: | names : list of trait attribute names
|
---|---|
Returns: | A dictionary whose keys are the names passed as arguments and whose : values are the corresponding trait values : |
Adds or removes the specified handler from the list of active monitors.
Parameters: | handler : function
remove : boolean
|
---|
Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified.
Parameters: | metadata : dictionary
|
---|
Shortcut for setting object trait attributes.
Parameters: | trait_change_notify : Boolean
traits : list of key/value pairs
|
---|---|
Returns: | self :
|
Shortcut for setting object trait attributes.
Parameters: | traits : list of key/value pairs
|
---|---|
Returns: | self :
|
Returns a list of the immediate (or all) subclasses of this class.
Parameters: | all : Boolean
|
---|
Gets or sets a ViewElement associated with an object’s class.
Parameters: | name : string
view_element : a ViewElement object
|
---|---|
Returns: | A view element. : |
Returns the ViewElements object associated with the object’s class.
The returned object can be used to access all the view elements associated with the class.
Returns a list of the names of all view elements associated with the current object’s class.
Parameters: | klass : a class
|
---|
Returns a dictionary containing the definitions of all of the trait attributes of this object that match the set of metadata criteria.
Parameters: | metadata : dictionary
|
---|
Validates whether a value is legal for a trait.
Returns the validated value if it is valid.
Bases: object
Dictionary-like class that provides attribute-style access to it’s items.
A Bunch is a simple container that stores it’s items as class attributes. Internally all items are stored in a dictionary and the class exposes several of the dictionary methods.
Notes
The Bunch pattern came from the Python Cookbook:
[R1] | A. Martelli, D. Hudgeon, “Collecting a Bunch of Named Items”, Python Cookbook, 2nd Ed, Chapter 4.18, 2005. |
Examples
>>> from nipype.interfaces.base import Bunch
>>> inputs = Bunch(infile='subj.nii', fwhm=6.0, register_to_mean=True)
>>> inputs
Bunch(fwhm=6.0, infile='subj.nii', register_to_mean=True)
>>> inputs.register_to_mean = False
>>> inputs
Bunch(fwhm=6.0, infile='subj.nii', register_to_mean=False)
Methods
dictcopy() | returns a deep copy of existing Bunch as a dictionary |
get(*args) | Support dictionary get() functionality |
items() | iterates over bunch attributes as key, value pairs |
iteritems() | iterates over bunch attributes as key, value pairs |
set(**kwargs) | Support dictionary get() functionality |
update(*args, **kwargs) | update existing attribute, or create new attribute |
returns a deep copy of existing Bunch as a dictionary
Support dictionary get() functionality
iterates over bunch attributes as key, value pairs
iterates over bunch attributes as key, value pairs
Support dictionary get() functionality
update existing attribute, or create new attribute
Note: update is very much like HasTraits.set
Bases: nipype.interfaces.base.BaseInterface
Implements functionality to interact with command line programs class must be instantiated with a command argument
Parameters: | command : string
args : string, optional
|
---|
Examples
>>> from nipype.interfaces.base import CommandLine
>>> cli = CommandLine(command='ls', environ={'DISPLAY': ':1'})
>>> cli.inputs.args = '-al'
>>> cli.cmdline
'ls -al'
>>> cli.inputs.trait_get()
{'ignore_exception': False, 'terminal_output': 'stream',
'environ': {'DISPLAY': ':1'}, 'args': '-al'}
>>> cli.inputs.get_hashval()
({'args': '-al'}, 'a2f45e04a34630c5f33a75ea2a533cdd')
Attributes
output_spec |
Methods
aggregate_outputs([runtime, needed_outputs]) | Collate expected outputs and check for existence |
help([returnhelp]) | |
input_spec | |
raise_exception(runtime) | |
run(**inputs) | Execute this interface. |
set_default_terminal_output(output_type) | Set the default output type for FSL classes. |
version_from_command([flag]) |
Collate expected outputs and check for existence
sets base command, immutable
command plus any arguments (args) validates arguments and generates command line
alias of CommandLineInputSpec
Execute this interface.
This interface will not raise an exception if runtime.returncode is non-zero.
Parameters: | inputs : allows the interface settings to be updated |
---|---|
Returns: | results : an InterfaceResult object containing a copy of the instance that was executed, provenance information and, if successful, results : |
Set the default output type for FSL classes.
This method is used to set the default output type for all fSL subclasses. However, setting this will not update the output type for any existing instances. For these, assign the <instance>.inputs.output_type.
Bases: nipype.interfaces.base.BaseInterfaceInputSpec
Methods
add_class_trait(name, *trait) | Adds a named trait attribute to this class. |
add_trait(name, *trait) | Adds a trait attribute to this object. |
add_trait_category(category) | Adds a trait category to a class. |
add_trait_listener(object[, prefix]) | |
all_trait_names() | Returns the list of all trait names, including implicitly defined |
base_trait(name) | Returns the base trait definition for a trait attribute. |
class_default_traits_view() | Returns the name of the default traits view for the class. |
class_editable_traits() | Returns an alphabetically sorted list of the names of non-event |
class_trait_names(**metadata) | Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified. |
class_trait_view([name, view_element]) | |
class_trait_view_elements() | Returns the ViewElements object associated with the class. |
class_traits(**metadata) | Returns a dictionary containing the definitions of all of the trait attributes of the class that match the set of metadata criteria. |
clone_traits([traits, memo, copy]) | Clones a new object from this one, optionally copying only a specified set of traits. |
configure_traits([filename, view, kind, ...]) | Creates and displays a dialog box for editing values of trait |
copy_traits(other[, traits, memo, copy]) | Copies another object’s trait attributes into this one. |
copyable_trait_names(**metadata) | Returns the list of trait names to copy or clone by default. |
default_traits_view() | Returns the name of the default traits view for the object’s class. |
edit_traits([view, parent, kind, context, ...]) | Displays a user interface window for editing trait attribute values. |
editable_traits() | Returns an alphabetically sorted list of the names of non-event |
get(**kwargs) | Returns traited class as a dict |
get_hashval([hash_method]) | Return a dictionary of our items with hashes for each file. |
get_traitsfree(**kwargs) | Returns traited class as a dict |
has_traits_interface(*interfaces) | Returns whether the object implements a specified traits interface. |
items() | Name, trait generator for user modifiable traits |
on_trait_change(handler[, name, remove, ...]) | Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association. |
on_trait_event(handler[, name, remove, ...]) | Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association. |
print_traits([show_help]) | Prints the values of all explicitly-defined, non-event trait attributes on the current object, in an easily readable format. |
remove_trait(name) | Removes a trait attribute from this object. |
remove_trait_listener(object[, prefix]) | |
reset_traits([traits]) | Resets some or all of an object’s trait attributes to their default values. |
set([trait_change_notify]) | Shortcut for setting object trait attributes. |
set_trait_dispatch_handler(name, klass[, ...]) | Sets a trait notification dispatch handler. |
sync_trait(trait_name, object[, alias, ...]) | Synchronizes the value of a trait attribute on this object with a trait attribute on another object. |
trait(name[, force, copy]) | Returns the trait definition for the name trait attribute. |
trait_context() | Returns the default context to use for editing or configuring |
trait_get(*names, **metadata) | Shortcut for getting object trait attributes. |
trait_items_event(event_trait,name,items_event) | |
trait_monitor(handler[, remove]) | Adds or removes the specified handler from the list of active monitors. |
trait_names(**metadata) | Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified. |
trait_property_changed(...) | |
trait_set([trait_change_notify]) | Shortcut for setting object trait attributes. |
trait_setq(**traits) | Shortcut for setting object trait attributes. |
trait_subclasses([all]) | Returns a list of the immediate (or all) subclasses of this class. |
trait_view([name, view_element]) | Gets or sets a ViewElement associated with an object’s class. |
trait_view_elements() | Returns the ViewElements object associated with the object’s |
trait_views([klass]) | Returns a list of the names of all view elements associated with the current object’s class. |
traits(**metadata) | Returns a dictionary containing the definitions of all of the trait attributes of this object that match the set of metadata criteria. |
traits_init() | |
traits_inited([True]) | |
validate_trait(name, value) | Validates whether a value is legal for a trait. |
Initialize handlers and inputs
Adds a named trait attribute to this class.
Parameters: | name : string
trait : a trait or a value that can be converted to a trait using Trait()
|
---|
Adds a trait attribute to this object.
Parameters: | name : string
trait : trait or a value that can be converted to a trait by Trait()
|
---|
Adds a trait category to a class.
Returns the list of all trait names, including implicitly defined traits.
Returns the base trait definition for a trait attribute.
Parameters: | name : string
|
---|
Returns the name of the default traits view for the class.
Returns an alphabetically sorted list of the names of non-event trait attributes associated with the current class.
Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified.
Parameters: | metadata : dictionary
|
---|
Returns the ViewElements object associated with the class.
The returned object can be used to access all the view elements associated with the class.
Returns a dictionary containing the definitions of all of the trait attributes of the class that match the set of metadata criteria.
Parameters: | metadata : dictionary
|
---|
Clones a new object from this one, optionally copying only a specified set of traits.
Parameters: | traits : list of strings
memo : dictionary
copy : None | ‘deep’ | ‘shallow’
|
---|---|
Returns: | The newly cloned object. : |
Creates and displays a dialog box for editing values of trait attributes, as if it were a complete, self-contained GUI application.
Parameters: | filename : string
view : view or string
kind : string
edit : Boolean
context : object or dictionary
handler : Handler object
id : string
scrollable : Boolean
|
---|
Copies another object’s trait attributes into this one.
Parameters: | other : object
traits : list of strings
memo : dictionary
copy : None | ‘deep’ | ‘shallow’
|
---|---|
Returns: | A list of attributes that the method was unable to copy, : which is empty if all the attributes were successfully copied. : |
Returns the list of trait names to copy or clone by default.
Returns the name of the default traits view for the object’s class.
Displays a user interface window for editing trait attribute values.
Parameters: | view : view or string
parent : window handle
kind : string
context : object or dictionary
handler : Handler object
id : string
scrollable : Boolean
|
---|
Returns an alphabetically sorted list of the names of non-event trait attributes associated with the current object.
Returns traited class as a dict
Augments the trait get function to return a dictionary without notification handles
Return a dictionary of our items with hashes for each file.
Searches through dictionary items and if an item is a file, it calculates the md5 hash of the file contents and stores the file name and hash value as the new key value.
However, the overall bunch hash is calculated only on the hash value of a file. The path and name of the file are not used in the overall hash calculation.
Returns: | dict_withhash : dict
hashvalue : str
|
---|
Returns traited class as a dict
Augments the trait get function to return a dictionary without any traits. The dictionary does not contain any attributes that were Undefined
Returns whether the object implements a specified traits interface.
Parameters: | interfaces : one or more traits Interface (sub)classes. |
---|
Name, trait generator for user modifiable traits
Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association.
Parameters: | handler : function
name : string
remove : Boolean
dispatch : string
|
---|
Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association.
Parameters: | handler : function
name : string
remove : Boolean
dispatch : string
|
---|
Prints the values of all explicitly-defined, non-event trait attributes on the current object, in an easily readable format.
Parameters: | show_help : Boolean
|
---|
Removes a trait attribute from this object.
Parameters: | name : string
|
---|
Resets some or all of an object’s trait attributes to their default values.
Parameters: | traits : list of strings
|
---|---|
Returns: | A list of attributes that the method was unable to reset, which is empty : if all the attributes were successfully reset. : |
Shortcut for setting object trait attributes.
Parameters: | trait_change_notify : Boolean
traits : list of key/value pairs
|
---|---|
Returns: | self :
|
Sets a trait notification dispatch handler.
Synchronizes the value of a trait attribute on this object with a trait attribute on another object.
Parameters: | name : string
object : object
alias : string
mutual : Boolean or integer
remove : Boolean or integer
|
---|
Returns the trait definition for the name trait attribute.
Parameters: | name : string
force : Boolean
copy : Boolean
|
---|
Returns the default context to use for editing or configuring traits.
Shortcut for getting object trait attributes.
Parameters: | names : list of trait attribute names
|
---|---|
Returns: | A dictionary whose keys are the names passed as arguments and whose : values are the corresponding trait values : |
Adds or removes the specified handler from the list of active monitors.
Parameters: | handler : function
remove : boolean
|
---|
Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified.
Parameters: | metadata : dictionary
|
---|
Shortcut for setting object trait attributes.
Parameters: | trait_change_notify : Boolean
traits : list of key/value pairs
|
---|---|
Returns: | self :
|
Shortcut for setting object trait attributes.
Parameters: | traits : list of key/value pairs
|
---|---|
Returns: | self :
|
Returns a list of the immediate (or all) subclasses of this class.
Parameters: | all : Boolean
|
---|
Gets or sets a ViewElement associated with an object’s class.
Parameters: | name : string
view_element : a ViewElement object
|
---|---|
Returns: | A view element. : |
Returns the ViewElements object associated with the object’s class.
The returned object can be used to access all the view elements associated with the class.
Returns a list of the names of all view elements associated with the current object’s class.
Parameters: | klass : a class
|
---|
Returns a dictionary containing the definitions of all of the trait attributes of this object that match the set of metadata criteria.
Parameters: | metadata : dictionary
|
---|
Validates whether a value is legal for a trait.
Returns the validated value if it is valid.
Bases: nipype.interfaces.base.BaseTraitedSpec
A subclass to handle dynamic traits
This class is a workaround for add_traits and clone_traits not functioning well together.
Methods
add_class_trait(name, *trait) | Adds a named trait attribute to this class. |
add_trait(name, *trait) | Adds a trait attribute to this object. |
add_trait_category(category) | Adds a trait category to a class. |
add_trait_listener(object[, prefix]) | |
all_trait_names() | Returns the list of all trait names, including implicitly defined |
base_trait(name) | Returns the base trait definition for a trait attribute. |
class_default_traits_view() | Returns the name of the default traits view for the class. |
class_editable_traits() | Returns an alphabetically sorted list of the names of non-event |
class_trait_names(**metadata) | Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified. |
class_trait_view([name, view_element]) | |
class_trait_view_elements() | Returns the ViewElements object associated with the class. |
class_traits(**metadata) | Returns a dictionary containing the definitions of all of the trait attributes of the class that match the set of metadata criteria. |
clone_traits([traits, memo, copy]) | Clones a new object from this one, optionally copying only a specified set of traits. |
configure_traits([filename, view, kind, ...]) | Creates and displays a dialog box for editing values of trait |
copy_traits(other[, traits, memo, copy]) | Copies another object’s trait attributes into this one. |
copyable_trait_names(**metadata) | Returns the list of trait names to copy or clone by default. |
default_traits_view() | Returns the name of the default traits view for the object’s class. |
edit_traits([view, parent, kind, context, ...]) | Displays a user interface window for editing trait attribute values. |
editable_traits() | Returns an alphabetically sorted list of the names of non-event |
get(**kwargs) | Returns traited class as a dict |
get_hashval([hash_method]) | Return a dictionary of our items with hashes for each file. |
get_traitsfree(**kwargs) | Returns traited class as a dict |
has_traits_interface(*interfaces) | Returns whether the object implements a specified traits interface. |
items() | Name, trait generator for user modifiable traits |
on_trait_change(handler[, name, remove, ...]) | Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association. |
on_trait_event(handler[, name, remove, ...]) | Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association. |
print_traits([show_help]) | Prints the values of all explicitly-defined, non-event trait attributes on the current object, in an easily readable format. |
remove_trait(name) | Removes a trait attribute from this object. |
remove_trait_listener(object[, prefix]) | |
reset_traits([traits]) | Resets some or all of an object’s trait attributes to their default values. |
set([trait_change_notify]) | Shortcut for setting object trait attributes. |
set_trait_dispatch_handler(name, klass[, ...]) | Sets a trait notification dispatch handler. |
sync_trait(trait_name, object[, alias, ...]) | Synchronizes the value of a trait attribute on this object with a trait attribute on another object. |
trait(name[, force, copy]) | Returns the trait definition for the name trait attribute. |
trait_context() | Returns the default context to use for editing or configuring |
trait_get(*names, **metadata) | Shortcut for getting object trait attributes. |
trait_items_event(event_trait,name,items_event) | |
trait_monitor(handler[, remove]) | Adds or removes the specified handler from the list of active monitors. |
trait_names(**metadata) | Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified. |
trait_property_changed(...) | |
trait_set([trait_change_notify]) | Shortcut for setting object trait attributes. |
trait_setq(**traits) | Shortcut for setting object trait attributes. |
trait_subclasses([all]) | Returns a list of the immediate (or all) subclasses of this class. |
trait_view([name, view_element]) | Gets or sets a ViewElement associated with an object’s class. |
trait_view_elements() | Returns the ViewElements object associated with the object’s |
trait_views([klass]) | Returns a list of the names of all view elements associated with the current object’s class. |
traits(**metadata) | Returns a dictionary containing the definitions of all of the trait attributes of this object that match the set of metadata criteria. |
traits_init() | |
traits_inited([True]) | |
validate_trait(name, value) | Validates whether a value is legal for a trait. |
Initialize handlers and inputs
Adds a named trait attribute to this class.
Parameters: | name : string
trait : a trait or a value that can be converted to a trait using Trait()
|
---|
Adds a trait attribute to this object.
Parameters: | name : string
trait : trait or a value that can be converted to a trait by Trait()
|
---|
Adds a trait category to a class.
Returns the list of all trait names, including implicitly defined traits.
Returns the base trait definition for a trait attribute.
Parameters: | name : string
|
---|
Returns the name of the default traits view for the class.
Returns an alphabetically sorted list of the names of non-event trait attributes associated with the current class.
Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified.
Parameters: | metadata : dictionary
|
---|
Returns the ViewElements object associated with the class.
The returned object can be used to access all the view elements associated with the class.
Returns a dictionary containing the definitions of all of the trait attributes of the class that match the set of metadata criteria.
Parameters: | metadata : dictionary
|
---|
Clones a new object from this one, optionally copying only a specified set of traits.
Parameters: | traits : list of strings
memo : dictionary
copy : None | ‘deep’ | ‘shallow’
|
---|---|
Returns: | The newly cloned object. : |
Creates and displays a dialog box for editing values of trait attributes, as if it were a complete, self-contained GUI application.
Parameters: | filename : string
view : view or string
kind : string
edit : Boolean
context : object or dictionary
handler : Handler object
id : string
scrollable : Boolean
|
---|
Copies another object’s trait attributes into this one.
Parameters: | other : object
traits : list of strings
memo : dictionary
copy : None | ‘deep’ | ‘shallow’
|
---|---|
Returns: | A list of attributes that the method was unable to copy, : which is empty if all the attributes were successfully copied. : |
Returns the list of trait names to copy or clone by default.
Returns the name of the default traits view for the object’s class.
Displays a user interface window for editing trait attribute values.
Parameters: | view : view or string
parent : window handle
kind : string
context : object or dictionary
handler : Handler object
id : string
scrollable : Boolean
|
---|
Returns an alphabetically sorted list of the names of non-event trait attributes associated with the current object.
Returns traited class as a dict
Augments the trait get function to return a dictionary without notification handles
Return a dictionary of our items with hashes for each file.
Searches through dictionary items and if an item is a file, it calculates the md5 hash of the file contents and stores the file name and hash value as the new key value.
However, the overall bunch hash is calculated only on the hash value of a file. The path and name of the file are not used in the overall hash calculation.
Returns: | dict_withhash : dict
hashvalue : str
|
---|
Returns traited class as a dict
Augments the trait get function to return a dictionary without any traits. The dictionary does not contain any attributes that were Undefined
Returns whether the object implements a specified traits interface.
Parameters: | interfaces : one or more traits Interface (sub)classes. |
---|
Name, trait generator for user modifiable traits
Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association.
Parameters: | handler : function
name : string
remove : Boolean
dispatch : string
|
---|
Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association.
Parameters: | handler : function
name : string
remove : Boolean
dispatch : string
|
---|
Prints the values of all explicitly-defined, non-event trait attributes on the current object, in an easily readable format.
Parameters: | show_help : Boolean
|
---|
Removes a trait attribute from this object.
Parameters: | name : string
|
---|
Resets some or all of an object’s trait attributes to their default values.
Parameters: | traits : list of strings
|
---|---|
Returns: | A list of attributes that the method was unable to reset, which is empty : if all the attributes were successfully reset. : |
Shortcut for setting object trait attributes.
Parameters: | trait_change_notify : Boolean
traits : list of key/value pairs
|
---|---|
Returns: | self :
|
Sets a trait notification dispatch handler.
Synchronizes the value of a trait attribute on this object with a trait attribute on another object.
Parameters: | name : string
object : object
alias : string
mutual : Boolean or integer
remove : Boolean or integer
|
---|
Returns the trait definition for the name trait attribute.
Parameters: | name : string
force : Boolean
copy : Boolean
|
---|
Returns the default context to use for editing or configuring traits.
Shortcut for getting object trait attributes.
Parameters: | names : list of trait attribute names
|
---|---|
Returns: | A dictionary whose keys are the names passed as arguments and whose : values are the corresponding trait values : |
Adds or removes the specified handler from the list of active monitors.
Parameters: | handler : function
remove : boolean
|
---|
Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified.
Parameters: | metadata : dictionary
|
---|
Shortcut for setting object trait attributes.
Parameters: | trait_change_notify : Boolean
traits : list of key/value pairs
|
---|---|
Returns: | self :
|
Shortcut for setting object trait attributes.
Parameters: | traits : list of key/value pairs
|
---|---|
Returns: | self :
|
Returns a list of the immediate (or all) subclasses of this class.
Parameters: | all : Boolean
|
---|
Gets or sets a ViewElement associated with an object’s class.
Parameters: | name : string
view_element : a ViewElement object
|
---|---|
Returns: | A view element. : |
Returns the ViewElements object associated with the object’s class.
The returned object can be used to access all the view elements associated with the class.
Returns a list of the names of all view elements associated with the current object’s class.
Parameters: | klass : a class
|
---|
Returns a dictionary containing the definitions of all of the trait attributes of this object that match the set of metadata criteria.
Parameters: | metadata : dictionary
|
---|
Validates whether a value is legal for a trait.
Returns the validated value if it is valid.
Bases: nipype.interfaces.base.MultiPath
Implements a user friendly traits that accepts one or more paths to files or directories. This is the input version which always returns a list. Default value of this trait is _Undefined. It does not accept empty lists.
XXX This should only be used as a final resort. We should stick to established Traits to the extent possible.
XXX This needs to be vetted by somebody who understands traits
>>> from nipype.interfaces.base import InputMultiPath
>>> class A(TraitedSpec):
... foo = InputMultiPath(File(exists=False))
>>> a = A()
>>> a.foo
<undefined>
>>> a.foo = '/software/temp/foo.txt'
>>> a.foo
['/software/temp/foo.txt']
>>> a.foo = ['/software/temp/foo.txt']
>>> a.foo
['/software/temp/foo.txt']
>>> a.foo = ['/software/temp/foo.txt', '/software/temp/goo.txt']
>>> a.foo
['/software/temp/foo.txt', '/software/temp/goo.txt']
Attributes
editor | |
info_trait |
Methods
__call__(*args, **kw) | Allows a derivative trait to be defined from this one. |
arg_error(method, arg_num, object, name, value) | Raises a TraitError exception to notify the user that a method on |
as_ctrait() | Returns a CTrait corresponding to the trait defined by this class. |
clone([default_value]) | Clones the contents of this object into a new instance of the same class, and then modifies the cloned copy using the specified default_value and metadata. |
create_editor() | Returns the default UI editor for the trait. |
dup_arg_error(method, arg_num, object, name) | Raises a TraitError exception to notify the user that a method on |
error(object, name, value) | Raises a TraitError exception. |
full_info(object, name, value) | Returns a description of the trait. |
get_default_value() | Returns a tuple of the form: (default_value_type, default_value) which describes the default value for this trait. |
get_editor([trait]) | Returns a trait editor that allows the user to modify the trait trait. |
get_value(object, name[, trait]) | Returns the current value of a property-based trait. |
info() | Must return a string describing the type of value accepted by the trait handler. |
init() | Allows the trait to perform any additional initialization needed. |
inner_traits() | Returns the inner trait (or traits) for this trait. |
is_valid(object, name, value) | |
items_event() | |
keyword_error(method, object, name, value) | Raises a TraitError exception to notify the user that a method on |
missing_arg_error(method, arg_num, object, name) | Raises a TraitError exception to notify the user that a method on |
repr(value) | Returns a printable representation of a value along with its type. |
return_error(method, object, value) | Raises a TraitError exception to notify the user that a method on |
set_value(object, name, value) | Sets the cached value of a property-based trait and fires the |
validate(object, name, value) |
Returns a List trait.
Parameters: | trait : a trait or value that can be converted to a trait using Trait()
value : :
minlen : integer
maxlen : integer
The length of the list assigned to the trait must be such that:: :
|
---|
Raises a TraitError exception to notify the user that a method on an instance received a positional argument of an incorrect type.
Parameters: | method : function
arg_num : integer
object : object
name : string
value : object
|
---|
Returns a CTrait corresponding to the trait defined by this class.
Clones the contents of this object into a new instance of the same class, and then modifies the cloned copy using the specified default_value and metadata. Returns the cloned object as the result.
Note that subclasses can change the signature of this method if needed, but should always call the ‘super’ method if possible.
Returns the default UI editor for the trait.
Raises a TraitError exception to notify the user that a method on an instance received an argument as both a keyword argument and a positional argument.
Parameters: | method : function
arg_num : integer
object : object
name : string
|
---|
Raises a TraitError exception.
Parameters: | object : object
name : string
value : object
|
---|
Returns a description of the trait.
Returns a tuple of the form: (default_value_type, default_value) which describes the default value for this trait. The default implementation analyzes the value of the trait’s default_value attribute and determines an appropriate default_value_type for default_value. If you need to override this method to provide a different result tuple, the following values are valid values for default_value_type:
- 0, 1: The default_value item of the tuple is the default value.
- 2: The object containing the trait is the default value.
- 3: A new copy of the list specified by default_value is the default value.
- 4: A new copy of the dictionary specified by default_value is the default value.
- 5: A new instance of TraitListObject constructed using the default_value list is the default value.
- 6: A new instance of TraitDictObject constructed using the default_value dictionary is the default value.
- 7: default_value is a tuple of the form: (callable, args, kw), where callable is a callable, args is a tuple, and kw is either a dictionary or None. The default value is the result obtained by invoking callable(*args, **kw).
- 8: default_value is a callable. The default value is the result obtained by invoking default_value*(*object), where object is the object containing the trait. If the trait has a validate() method, the validate() method is also called to validate the result.
- 9: A new instance of TraitSetObject constructed using the default_value set is the default value.
Returns a trait editor that allows the user to modify the trait trait.
Parameters: | trait : trait
|
---|
Returns the current value of a property-based trait.
Must return a string describing the type of value accepted by the trait handler.
The string should be a phrase describing the type defined by the TraitHandler subclass, rather than a complete sentence. For example, use the phrase, “a square sprocket” instead of the sentence, “The value must be a square sprocket.” The value returned by info() is combined with other information whenever an error occurs and therefore makes more sense to the user if the result is a phrase. The info() method is similar in purpose and use to the info attribute of a validator function.
Note that the result can include information specific to the particular trait handler instance. For example, TraitRange instances return a string indicating the range of values acceptable to the handler (e.g., “an integer in the range from 1 to 9”). If the info() method is not overridden, the default method returns the value of the ‘info_text’ attribute.
Allows the trait to perform any additional initialization needed.
Returns the inner trait (or traits) for this trait.
Raises a TraitError exception to notify the user that a method on an instance received a keyword argument of an incorrect type.
Parameters: | method : function
object : object
name : string
value :
|
---|
Raises a TraitError exception to notify the user that a method on an instance failed to receive a required positional argument.
Parameters: | method : function
arg_num : integer
object : object
name : string
|
---|
Returns a printable representation of a value along with its type.
DEPRECATED: This functionality was only used to provide readable error messages. This functionality has been incorporated into TraitError itself.
Parameters: | value : object
|
---|
Raises a TraitError exception to notify the user that a method on an instance returned a value of incorrect type.
Parameters: | method : function
object : object
value :
|
---|
Sets the cached value of a property-based trait and fires the appropriate trait change event.
Bases: object
This is an abstract definition for Interface objects.
It provides no functionality. It defines the necessary attributes and methods all Interface objects should have.
Attributes
input_spec | |
output_spec |
Methods
aggregate_outputs([runtime, needed_outputs]) | Called to populate outputs |
help() | Prints class help |
run() | Execute the command. |
Initialize command with given args and inputs.
Called to populate outputs
Prints class help
Execute the command.
Bases: object
Object that contains the results of running a particular Interface.
Attributes
Bases: nipype.interfaces.base.CommandLine
Implements functionality to interact with command line programs that can be run with MPI (i.e. using ‘mpiexec’).
Examples
>>> from nipype.interfaces.base import MpiCommandLine
>>> mpi_cli = MpiCommandLine(command='my_mpi_prog')
>>> mpi_cli.inputs.args = '-v'
>>> mpi_cli.cmdline
'my_mpi_prog -v'
>>> mpi_cli.inputs.use_mpi = True
>>> mpi_cli.inputs.n_procs = 8
>>> mpi_cli.cmdline
'mpiexec -n 8 my_mpi_prog -v'
Attributes
output_spec |
Methods
aggregate_outputs([runtime, needed_outputs]) | Collate expected outputs and check for existence |
help([returnhelp]) | |
input_spec | |
raise_exception(runtime) | |
run(**inputs) | Execute this interface. |
set_default_terminal_output(output_type) | Set the default output type for FSL classes. |
version_from_command([flag]) |
Collate expected outputs and check for existence
sets base command, immutable
Adds ‘mpiexec’ to begining of command
alias of MpiCommandLineInputSpec
Execute this interface.
This interface will not raise an exception if runtime.returncode is non-zero.
Parameters: | inputs : allows the interface settings to be updated |
---|---|
Returns: | results : an InterfaceResult object containing a copy of the instance that was executed, provenance information and, if successful, results : |
Set the default output type for FSL classes.
This method is used to set the default output type for all fSL subclasses. However, setting this will not update the output type for any existing instances. For these, assign the <instance>.inputs.output_type.
Bases: nipype.interfaces.base.CommandLineInputSpec
Methods
add_class_trait(name, *trait) | Adds a named trait attribute to this class. |
add_trait(name, *trait) | Adds a trait attribute to this object. |
add_trait_category(category) | Adds a trait category to a class. |
add_trait_listener(object[, prefix]) | |
all_trait_names() | Returns the list of all trait names, including implicitly defined |
base_trait(name) | Returns the base trait definition for a trait attribute. |
class_default_traits_view() | Returns the name of the default traits view for the class. |
class_editable_traits() | Returns an alphabetically sorted list of the names of non-event |
class_trait_names(**metadata) | Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified. |
class_trait_view([name, view_element]) | |
class_trait_view_elements() | Returns the ViewElements object associated with the class. |
class_traits(**metadata) | Returns a dictionary containing the definitions of all of the trait attributes of the class that match the set of metadata criteria. |
clone_traits([traits, memo, copy]) | Clones a new object from this one, optionally copying only a specified set of traits. |
configure_traits([filename, view, kind, ...]) | Creates and displays a dialog box for editing values of trait |
copy_traits(other[, traits, memo, copy]) | Copies another object’s trait attributes into this one. |
copyable_trait_names(**metadata) | Returns the list of trait names to copy or clone by default. |
default_traits_view() | Returns the name of the default traits view for the object’s class. |
edit_traits([view, parent, kind, context, ...]) | Displays a user interface window for editing trait attribute values. |
editable_traits() | Returns an alphabetically sorted list of the names of non-event |
get(**kwargs) | Returns traited class as a dict |
get_hashval([hash_method]) | Return a dictionary of our items with hashes for each file. |
get_traitsfree(**kwargs) | Returns traited class as a dict |
has_traits_interface(*interfaces) | Returns whether the object implements a specified traits interface. |
items() | Name, trait generator for user modifiable traits |
on_trait_change(handler[, name, remove, ...]) | Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association. |
on_trait_event(handler[, name, remove, ...]) | Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association. |
print_traits([show_help]) | Prints the values of all explicitly-defined, non-event trait attributes on the current object, in an easily readable format. |
remove_trait(name) | Removes a trait attribute from this object. |
remove_trait_listener(object[, prefix]) | |
reset_traits([traits]) | Resets some or all of an object’s trait attributes to their default values. |
set([trait_change_notify]) | Shortcut for setting object trait attributes. |
set_trait_dispatch_handler(name, klass[, ...]) | Sets a trait notification dispatch handler. |
sync_trait(trait_name, object[, alias, ...]) | Synchronizes the value of a trait attribute on this object with a trait attribute on another object. |
trait(name[, force, copy]) | Returns the trait definition for the name trait attribute. |
trait_context() | Returns the default context to use for editing or configuring |
trait_get(*names, **metadata) | Shortcut for getting object trait attributes. |
trait_items_event(event_trait,name,items_event) | |
trait_monitor(handler[, remove]) | Adds or removes the specified handler from the list of active monitors. |
trait_names(**metadata) | Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified. |
trait_property_changed(...) | |
trait_set([trait_change_notify]) | Shortcut for setting object trait attributes. |
trait_setq(**traits) | Shortcut for setting object trait attributes. |
trait_subclasses([all]) | Returns a list of the immediate (or all) subclasses of this class. |
trait_view([name, view_element]) | Gets or sets a ViewElement associated with an object’s class. |
trait_view_elements() | Returns the ViewElements object associated with the object’s |
trait_views([klass]) | Returns a list of the names of all view elements associated with the current object’s class. |
traits(**metadata) | Returns a dictionary containing the definitions of all of the trait attributes of this object that match the set of metadata criteria. |
traits_init() | |
traits_inited([True]) | |
validate_trait(name, value) | Validates whether a value is legal for a trait. |
Initialize handlers and inputs
Adds a named trait attribute to this class.
Parameters: | name : string
trait : a trait or a value that can be converted to a trait using Trait()
|
---|
Adds a trait attribute to this object.
Parameters: | name : string
trait : trait or a value that can be converted to a trait by Trait()
|
---|
Adds a trait category to a class.
Returns the list of all trait names, including implicitly defined traits.
Returns the base trait definition for a trait attribute.
Parameters: | name : string
|
---|
Returns the name of the default traits view for the class.
Returns an alphabetically sorted list of the names of non-event trait attributes associated with the current class.
Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified.
Parameters: | metadata : dictionary
|
---|
Returns the ViewElements object associated with the class.
The returned object can be used to access all the view elements associated with the class.
Returns a dictionary containing the definitions of all of the trait attributes of the class that match the set of metadata criteria.
Parameters: | metadata : dictionary
|
---|
Clones a new object from this one, optionally copying only a specified set of traits.
Parameters: | traits : list of strings
memo : dictionary
copy : None | ‘deep’ | ‘shallow’
|
---|---|
Returns: | The newly cloned object. : |
Creates and displays a dialog box for editing values of trait attributes, as if it were a complete, self-contained GUI application.
Parameters: | filename : string
view : view or string
kind : string
edit : Boolean
context : object or dictionary
handler : Handler object
id : string
scrollable : Boolean
|
---|
Copies another object’s trait attributes into this one.
Parameters: | other : object
traits : list of strings
memo : dictionary
copy : None | ‘deep’ | ‘shallow’
|
---|---|
Returns: | A list of attributes that the method was unable to copy, : which is empty if all the attributes were successfully copied. : |
Returns the list of trait names to copy or clone by default.
Returns the name of the default traits view for the object’s class.
Displays a user interface window for editing trait attribute values.
Parameters: | view : view or string
parent : window handle
kind : string
context : object or dictionary
handler : Handler object
id : string
scrollable : Boolean
|
---|
Returns an alphabetically sorted list of the names of non-event trait attributes associated with the current object.
Returns traited class as a dict
Augments the trait get function to return a dictionary without notification handles
Return a dictionary of our items with hashes for each file.
Searches through dictionary items and if an item is a file, it calculates the md5 hash of the file contents and stores the file name and hash value as the new key value.
However, the overall bunch hash is calculated only on the hash value of a file. The path and name of the file are not used in the overall hash calculation.
Returns: | dict_withhash : dict
hashvalue : str
|
---|
Returns traited class as a dict
Augments the trait get function to return a dictionary without any traits. The dictionary does not contain any attributes that were Undefined
Returns whether the object implements a specified traits interface.
Parameters: | interfaces : one or more traits Interface (sub)classes. |
---|
Name, trait generator for user modifiable traits
Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association.
Parameters: | handler : function
name : string
remove : Boolean
dispatch : string
|
---|
Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association.
Parameters: | handler : function
name : string
remove : Boolean
dispatch : string
|
---|
Prints the values of all explicitly-defined, non-event trait attributes on the current object, in an easily readable format.
Parameters: | show_help : Boolean
|
---|
Removes a trait attribute from this object.
Parameters: | name : string
|
---|
Resets some or all of an object’s trait attributes to their default values.
Parameters: | traits : list of strings
|
---|---|
Returns: | A list of attributes that the method was unable to reset, which is empty : if all the attributes were successfully reset. : |
Shortcut for setting object trait attributes.
Parameters: | trait_change_notify : Boolean
traits : list of key/value pairs
|
---|---|
Returns: | self :
|
Sets a trait notification dispatch handler.
Synchronizes the value of a trait attribute on this object with a trait attribute on another object.
Parameters: | name : string
object : object
alias : string
mutual : Boolean or integer
remove : Boolean or integer
|
---|
Returns the trait definition for the name trait attribute.
Parameters: | name : string
force : Boolean
copy : Boolean
|
---|
Returns the default context to use for editing or configuring traits.
Shortcut for getting object trait attributes.
Parameters: | names : list of trait attribute names
|
---|---|
Returns: | A dictionary whose keys are the names passed as arguments and whose : values are the corresponding trait values : |
Adds or removes the specified handler from the list of active monitors.
Parameters: | handler : function
remove : boolean
|
---|
Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified.
Parameters: | metadata : dictionary
|
---|
Shortcut for setting object trait attributes.
Parameters: | trait_change_notify : Boolean
traits : list of key/value pairs
|
---|---|
Returns: | self :
|
Shortcut for setting object trait attributes.
Parameters: | traits : list of key/value pairs
|
---|---|
Returns: | self :
|
Returns a list of the immediate (or all) subclasses of this class.
Parameters: | all : Boolean
|
---|
Gets or sets a ViewElement associated with an object’s class.
Parameters: | name : string
view_element : a ViewElement object
|
---|---|
Returns: | A view element. : |
Returns the ViewElements object associated with the object’s class.
The returned object can be used to access all the view elements associated with the class.
Returns a list of the names of all view elements associated with the current object’s class.
Parameters: | klass : a class
|
---|
Returns a dictionary containing the definitions of all of the trait attributes of this object that match the set of metadata criteria.
Parameters: | metadata : dictionary
|
---|
Validates whether a value is legal for a trait.
Returns the validated value if it is valid.
Bases: traits.trait_types.List
Abstract class - shared functionality of input and output MultiPath
Attributes
editor | |
info_trait |
Methods
__call__(*args, **kw) | Allows a derivative trait to be defined from this one. |
arg_error(method, arg_num, object, name, value) | Raises a TraitError exception to notify the user that a method on |
as_ctrait() | Returns a CTrait corresponding to the trait defined by this class. |
clone([default_value]) | Clones the contents of this object into a new instance of the same class, and then modifies the cloned copy using the specified default_value and metadata. |
create_editor() | Returns the default UI editor for the trait. |
dup_arg_error(method, arg_num, object, name) | Raises a TraitError exception to notify the user that a method on |
error(object, name, value) | Raises a TraitError exception. |
full_info(object, name, value) | Returns a description of the trait. |
get_default_value() | Returns a tuple of the form: (default_value_type, default_value) which describes the default value for this trait. |
get_editor([trait]) | Returns a trait editor that allows the user to modify the trait trait. |
get_value(object, name[, trait]) | Returns the current value of a property-based trait. |
info() | Must return a string describing the type of value accepted by the trait handler. |
init() | Allows the trait to perform any additional initialization needed. |
inner_traits() | Returns the inner trait (or traits) for this trait. |
is_valid(object, name, value) | |
items_event() | |
keyword_error(method, object, name, value) | Raises a TraitError exception to notify the user that a method on |
missing_arg_error(method, arg_num, object, name) | Raises a TraitError exception to notify the user that a method on |
repr(value) | Returns a printable representation of a value along with its type. |
return_error(method, object, value) | Raises a TraitError exception to notify the user that a method on |
set_value(object, name, value) | Sets the cached value of a property-based trait and fires the |
validate(object, name, value) |
Returns a List trait.
Parameters: | trait : a trait or value that can be converted to a trait using Trait()
value : :
minlen : integer
maxlen : integer
The length of the list assigned to the trait must be such that:: :
|
---|
Raises a TraitError exception to notify the user that a method on an instance received a positional argument of an incorrect type.
Parameters: | method : function
arg_num : integer
object : object
name : string
value : object
|
---|
Returns a CTrait corresponding to the trait defined by this class.
Clones the contents of this object into a new instance of the same class, and then modifies the cloned copy using the specified default_value and metadata. Returns the cloned object as the result.
Note that subclasses can change the signature of this method if needed, but should always call the ‘super’ method if possible.
Returns the default UI editor for the trait.
Raises a TraitError exception to notify the user that a method on an instance received an argument as both a keyword argument and a positional argument.
Parameters: | method : function
arg_num : integer
object : object
name : string
|
---|
Raises a TraitError exception.
Parameters: | object : object
name : string
value : object
|
---|
Returns a description of the trait.
Returns a tuple of the form: (default_value_type, default_value) which describes the default value for this trait. The default implementation analyzes the value of the trait’s default_value attribute and determines an appropriate default_value_type for default_value. If you need to override this method to provide a different result tuple, the following values are valid values for default_value_type:
- 0, 1: The default_value item of the tuple is the default value.
- 2: The object containing the trait is the default value.
- 3: A new copy of the list specified by default_value is the default value.
- 4: A new copy of the dictionary specified by default_value is the default value.
- 5: A new instance of TraitListObject constructed using the default_value list is the default value.
- 6: A new instance of TraitDictObject constructed using the default_value dictionary is the default value.
- 7: default_value is a tuple of the form: (callable, args, kw), where callable is a callable, args is a tuple, and kw is either a dictionary or None. The default value is the result obtained by invoking callable(*args, **kw).
- 8: default_value is a callable. The default value is the result obtained by invoking default_value*(*object), where object is the object containing the trait. If the trait has a validate() method, the validate() method is also called to validate the result.
- 9: A new instance of TraitSetObject constructed using the default_value set is the default value.
Returns a trait editor that allows the user to modify the trait trait.
Parameters: | trait : trait
|
---|
Returns the current value of a property-based trait.
Must return a string describing the type of value accepted by the trait handler.
The string should be a phrase describing the type defined by the TraitHandler subclass, rather than a complete sentence. For example, use the phrase, “a square sprocket” instead of the sentence, “The value must be a square sprocket.” The value returned by info() is combined with other information whenever an error occurs and therefore makes more sense to the user if the result is a phrase. The info() method is similar in purpose and use to the info attribute of a validator function.
Note that the result can include information specific to the particular trait handler instance. For example, TraitRange instances return a string indicating the range of values acceptable to the handler (e.g., “an integer in the range from 1 to 9”). If the info() method is not overridden, the default method returns the value of the ‘info_text’ attribute.
Allows the trait to perform any additional initialization needed.
Returns the inner trait (or traits) for this trait.
Raises a TraitError exception to notify the user that a method on an instance received a keyword argument of an incorrect type.
Parameters: | method : function
object : object
name : string
value :
|
---|
Raises a TraitError exception to notify the user that a method on an instance failed to receive a required positional argument.
Parameters: | method : function
arg_num : integer
object : object
name : string
|
---|
Returns a printable representation of a value along with its type.
DEPRECATED: This functionality was only used to provide readable error messages. This functionality has been incorporated into TraitError itself.
Parameters: | value : object
|
---|
Raises a TraitError exception to notify the user that a method on an instance returned a value of incorrect type.
Parameters: | method : function
object : object
value :
|
---|
Sets the cached value of a property-based trait and fires the appropriate trait change event.
Bases: nipype.interfaces.base.MultiPath
Implements a user friendly traits that accepts one or more paths to files or directories. This is the output version which return a single string whenever possible (when it was set to a single value or a list of length 1). Default value of this trait is _Undefined. It does not accept empty lists.
XXX This should only be used as a final resort. We should stick to established Traits to the extent possible.
XXX This needs to be vetted by somebody who understands traits
>>> from nipype.interfaces.base import OutputMultiPath
>>> class A(TraitedSpec):
... foo = OutputMultiPath(File(exists=False))
>>> a = A()
>>> a.foo
<undefined>
>>> a.foo = '/software/temp/foo.txt'
>>> a.foo
'/software/temp/foo.txt'
>>> a.foo = ['/software/temp/foo.txt']
>>> a.foo
'/software/temp/foo.txt'
>>> a.foo = ['/software/temp/foo.txt', '/software/temp/goo.txt']
>>> a.foo
['/software/temp/foo.txt', '/software/temp/goo.txt']
Attributes
editor | |
info_trait |
Methods
__call__(*args, **kw) | Allows a derivative trait to be defined from this one. |
arg_error(method, arg_num, object, name, value) | Raises a TraitError exception to notify the user that a method on |
as_ctrait() | Returns a CTrait corresponding to the trait defined by this class. |
clone([default_value]) | Clones the contents of this object into a new instance of the same class, and then modifies the cloned copy using the specified default_value and metadata. |
create_editor() | Returns the default UI editor for the trait. |
dup_arg_error(method, arg_num, object, name) | Raises a TraitError exception to notify the user that a method on |
error(object, name, value) | Raises a TraitError exception. |
full_info(object, name, value) | Returns a description of the trait. |
get(object, name) | |
get_default_value() | Returns a tuple of the form: (default_value_type, default_value) which describes the default value for this trait. |
get_editor([trait]) | Returns a trait editor that allows the user to modify the trait trait. |
get_value(object, name[, trait]) | Returns the current value of a property-based trait. |
info() | Must return a string describing the type of value accepted by the trait handler. |
init() | Allows the trait to perform any additional initialization needed. |
inner_traits() | Returns the inner trait (or traits) for this trait. |
is_valid(object, name, value) | |
items_event() | |
keyword_error(method, object, name, value) | Raises a TraitError exception to notify the user that a method on |
missing_arg_error(method, arg_num, object, name) | Raises a TraitError exception to notify the user that a method on |
repr(value) | Returns a printable representation of a value along with its type. |
return_error(method, object, value) | Raises a TraitError exception to notify the user that a method on |
set(object, name, value) | |
set_value(object, name, value) | Sets the cached value of a property-based trait and fires the |
validate(object, name, value) |
Returns a List trait.
Parameters: | trait : a trait or value that can be converted to a trait using Trait()
value : :
minlen : integer
maxlen : integer
The length of the list assigned to the trait must be such that:: :
|
---|
Raises a TraitError exception to notify the user that a method on an instance received a positional argument of an incorrect type.
Parameters: | method : function
arg_num : integer
object : object
name : string
value : object
|
---|
Returns a CTrait corresponding to the trait defined by this class.
Clones the contents of this object into a new instance of the same class, and then modifies the cloned copy using the specified default_value and metadata. Returns the cloned object as the result.
Note that subclasses can change the signature of this method if needed, but should always call the ‘super’ method if possible.
Returns the default UI editor for the trait.
Raises a TraitError exception to notify the user that a method on an instance received an argument as both a keyword argument and a positional argument.
Parameters: | method : function
arg_num : integer
object : object
name : string
|
---|
Raises a TraitError exception.
Parameters: | object : object
name : string
value : object
|
---|
Returns a description of the trait.
Returns a tuple of the form: (default_value_type, default_value) which describes the default value for this trait. The default implementation analyzes the value of the trait’s default_value attribute and determines an appropriate default_value_type for default_value. If you need to override this method to provide a different result tuple, the following values are valid values for default_value_type:
- 0, 1: The default_value item of the tuple is the default value.
- 2: The object containing the trait is the default value.
- 3: A new copy of the list specified by default_value is the default value.
- 4: A new copy of the dictionary specified by default_value is the default value.
- 5: A new instance of TraitListObject constructed using the default_value list is the default value.
- 6: A new instance of TraitDictObject constructed using the default_value dictionary is the default value.
- 7: default_value is a tuple of the form: (callable, args, kw), where callable is a callable, args is a tuple, and kw is either a dictionary or None. The default value is the result obtained by invoking callable(*args, **kw).
- 8: default_value is a callable. The default value is the result obtained by invoking default_value*(*object), where object is the object containing the trait. If the trait has a validate() method, the validate() method is also called to validate the result.
- 9: A new instance of TraitSetObject constructed using the default_value set is the default value.
Returns a trait editor that allows the user to modify the trait trait.
Parameters: | trait : trait
|
---|
Returns the current value of a property-based trait.
Must return a string describing the type of value accepted by the trait handler.
The string should be a phrase describing the type defined by the TraitHandler subclass, rather than a complete sentence. For example, use the phrase, “a square sprocket” instead of the sentence, “The value must be a square sprocket.” The value returned by info() is combined with other information whenever an error occurs and therefore makes more sense to the user if the result is a phrase. The info() method is similar in purpose and use to the info attribute of a validator function.
Note that the result can include information specific to the particular trait handler instance. For example, TraitRange instances return a string indicating the range of values acceptable to the handler (e.g., “an integer in the range from 1 to 9”). If the info() method is not overridden, the default method returns the value of the ‘info_text’ attribute.
Allows the trait to perform any additional initialization needed.
Returns the inner trait (or traits) for this trait.
Raises a TraitError exception to notify the user that a method on an instance received a keyword argument of an incorrect type.
Parameters: | method : function
object : object
name : string
value :
|
---|
Raises a TraitError exception to notify the user that a method on an instance failed to receive a required positional argument.
Parameters: | method : function
arg_num : integer
object : object
name : string
|
---|
Returns a printable representation of a value along with its type.
DEPRECATED: This functionality was only used to provide readable error messages. This functionality has been incorporated into TraitError itself.
Parameters: | value : object
|
---|
Raises a TraitError exception to notify the user that a method on an instance returned a value of incorrect type.
Parameters: | method : function
object : object
value :
|
---|
Sets the cached value of a property-based trait and fires the appropriate trait change event.
Bases: nipype.interfaces.base.CommandLine
In SEM derived interface all outputs have corresponding inputs. However, some SEM commands create outputs that are not defined in the XML. In those cases one has to create a subclass of the autogenerated one and overload the _list_outputs method. _outputs_from_inputs should still be used but only for the reduced (by excluding those that do not have corresponding inputs list of outputs.
Attributes
output_spec |
Methods
aggregate_outputs([runtime, needed_outputs]) | Collate expected outputs and check for existence |
help([returnhelp]) | |
input_spec | |
raise_exception(runtime) | |
run(**inputs) | Execute this interface. |
set_default_terminal_output(output_type) | Set the default output type for FSL classes. |
version_from_command([flag]) |
Collate expected outputs and check for existence
sets base command, immutable
command plus any arguments (args) validates arguments and generates command line
alias of CommandLineInputSpec
Execute this interface.
This interface will not raise an exception if runtime.returncode is non-zero.
Parameters: | inputs : allows the interface settings to be updated |
---|---|
Returns: | results : an InterfaceResult object containing a copy of the instance that was executed, provenance information and, if successful, results : |
Set the default output type for FSL classes.
This method is used to set the default output type for all fSL subclasses. However, setting this will not update the output type for any existing instances. For these, assign the <instance>.inputs.output_type.
Bases: nipype.interfaces.base.CommandLine
Attributes
output_spec |
Methods
aggregate_outputs([runtime, needed_outputs]) | Collate expected outputs and check for existence |
help([returnhelp]) | |
input_spec | |
raise_exception(runtime) | |
run(**inputs) | Execute this interface. |
set_default_terminal_output(output_type) | Set the default output type for FSL classes. |
version_from_command([flag]) |
Collate expected outputs and check for existence
sets base command, immutable
command plus any arguments (args) validates arguments and generates command line
alias of StdOutCommandLineInputSpec
Execute this interface.
This interface will not raise an exception if runtime.returncode is non-zero.
Parameters: | inputs : allows the interface settings to be updated |
---|---|
Returns: | results : an InterfaceResult object containing a copy of the instance that was executed, provenance information and, if successful, results : |
Set the default output type for FSL classes.
This method is used to set the default output type for all fSL subclasses. However, setting this will not update the output type for any existing instances. For these, assign the <instance>.inputs.output_type.
Bases: nipype.interfaces.base.CommandLineInputSpec
Methods
add_class_trait(name, *trait) | Adds a named trait attribute to this class. |
add_trait(name, *trait) | Adds a trait attribute to this object. |
add_trait_category(category) | Adds a trait category to a class. |
add_trait_listener(object[, prefix]) | |
all_trait_names() | Returns the list of all trait names, including implicitly defined |
base_trait(name) | Returns the base trait definition for a trait attribute. |
class_default_traits_view() | Returns the name of the default traits view for the class. |
class_editable_traits() | Returns an alphabetically sorted list of the names of non-event |
class_trait_names(**metadata) | Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified. |
class_trait_view([name, view_element]) | |
class_trait_view_elements() | Returns the ViewElements object associated with the class. |
class_traits(**metadata) | Returns a dictionary containing the definitions of all of the trait attributes of the class that match the set of metadata criteria. |
clone_traits([traits, memo, copy]) | Clones a new object from this one, optionally copying only a specified set of traits. |
configure_traits([filename, view, kind, ...]) | Creates and displays a dialog box for editing values of trait |
copy_traits(other[, traits, memo, copy]) | Copies another object’s trait attributes into this one. |
copyable_trait_names(**metadata) | Returns the list of trait names to copy or clone by default. |
default_traits_view() | Returns the name of the default traits view for the object’s class. |
edit_traits([view, parent, kind, context, ...]) | Displays a user interface window for editing trait attribute values. |
editable_traits() | Returns an alphabetically sorted list of the names of non-event |
get(**kwargs) | Returns traited class as a dict |
get_hashval([hash_method]) | Return a dictionary of our items with hashes for each file. |
get_traitsfree(**kwargs) | Returns traited class as a dict |
has_traits_interface(*interfaces) | Returns whether the object implements a specified traits interface. |
items() | Name, trait generator for user modifiable traits |
on_trait_change(handler[, name, remove, ...]) | Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association. |
on_trait_event(handler[, name, remove, ...]) | Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association. |
print_traits([show_help]) | Prints the values of all explicitly-defined, non-event trait attributes on the current object, in an easily readable format. |
remove_trait(name) | Removes a trait attribute from this object. |
remove_trait_listener(object[, prefix]) | |
reset_traits([traits]) | Resets some or all of an object’s trait attributes to their default values. |
set([trait_change_notify]) | Shortcut for setting object trait attributes. |
set_trait_dispatch_handler(name, klass[, ...]) | Sets a trait notification dispatch handler. |
sync_trait(trait_name, object[, alias, ...]) | Synchronizes the value of a trait attribute on this object with a trait attribute on another object. |
trait(name[, force, copy]) | Returns the trait definition for the name trait attribute. |
trait_context() | Returns the default context to use for editing or configuring |
trait_get(*names, **metadata) | Shortcut for getting object trait attributes. |
trait_items_event(event_trait,name,items_event) | |
trait_monitor(handler[, remove]) | Adds or removes the specified handler from the list of active monitors. |
trait_names(**metadata) | Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified. |
trait_property_changed(...) | |
trait_set([trait_change_notify]) | Shortcut for setting object trait attributes. |
trait_setq(**traits) | Shortcut for setting object trait attributes. |
trait_subclasses([all]) | Returns a list of the immediate (or all) subclasses of this class. |
trait_view([name, view_element]) | Gets or sets a ViewElement associated with an object’s class. |
trait_view_elements() | Returns the ViewElements object associated with the object’s |
trait_views([klass]) | Returns a list of the names of all view elements associated with the current object’s class. |
traits(**metadata) | Returns a dictionary containing the definitions of all of the trait attributes of this object that match the set of metadata criteria. |
traits_init() | |
traits_inited([True]) | |
validate_trait(name, value) | Validates whether a value is legal for a trait. |
Initialize handlers and inputs
Adds a named trait attribute to this class.
Parameters: | name : string
trait : a trait or a value that can be converted to a trait using Trait()
|
---|
Adds a trait attribute to this object.
Parameters: | name : string
trait : trait or a value that can be converted to a trait by Trait()
|
---|
Adds a trait category to a class.
Returns the list of all trait names, including implicitly defined traits.
Returns the base trait definition for a trait attribute.
Parameters: | name : string
|
---|
Returns the name of the default traits view for the class.
Returns an alphabetically sorted list of the names of non-event trait attributes associated with the current class.
Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified.
Parameters: | metadata : dictionary
|
---|
Returns the ViewElements object associated with the class.
The returned object can be used to access all the view elements associated with the class.
Returns a dictionary containing the definitions of all of the trait attributes of the class that match the set of metadata criteria.
Parameters: | metadata : dictionary
|
---|
Clones a new object from this one, optionally copying only a specified set of traits.
Parameters: | traits : list of strings
memo : dictionary
copy : None | ‘deep’ | ‘shallow’
|
---|---|
Returns: | The newly cloned object. : |
Creates and displays a dialog box for editing values of trait attributes, as if it were a complete, self-contained GUI application.
Parameters: | filename : string
view : view or string
kind : string
edit : Boolean
context : object or dictionary
handler : Handler object
id : string
scrollable : Boolean
|
---|
Copies another object’s trait attributes into this one.
Parameters: | other : object
traits : list of strings
memo : dictionary
copy : None | ‘deep’ | ‘shallow’
|
---|---|
Returns: | A list of attributes that the method was unable to copy, : which is empty if all the attributes were successfully copied. : |
Returns the list of trait names to copy or clone by default.
Returns the name of the default traits view for the object’s class.
Displays a user interface window for editing trait attribute values.
Parameters: | view : view or string
parent : window handle
kind : string
context : object or dictionary
handler : Handler object
id : string
scrollable : Boolean
|
---|
Returns an alphabetically sorted list of the names of non-event trait attributes associated with the current object.
Returns traited class as a dict
Augments the trait get function to return a dictionary without notification handles
Return a dictionary of our items with hashes for each file.
Searches through dictionary items and if an item is a file, it calculates the md5 hash of the file contents and stores the file name and hash value as the new key value.
However, the overall bunch hash is calculated only on the hash value of a file. The path and name of the file are not used in the overall hash calculation.
Returns: | dict_withhash : dict
hashvalue : str
|
---|
Returns traited class as a dict
Augments the trait get function to return a dictionary without any traits. The dictionary does not contain any attributes that were Undefined
Returns whether the object implements a specified traits interface.
Parameters: | interfaces : one or more traits Interface (sub)classes. |
---|
Name, trait generator for user modifiable traits
Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association.
Parameters: | handler : function
name : string
remove : Boolean
dispatch : string
|
---|
Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association.
Parameters: | handler : function
name : string
remove : Boolean
dispatch : string
|
---|
Prints the values of all explicitly-defined, non-event trait attributes on the current object, in an easily readable format.
Parameters: | show_help : Boolean
|
---|
Removes a trait attribute from this object.
Parameters: | name : string
|
---|
Resets some or all of an object’s trait attributes to their default values.
Parameters: | traits : list of strings
|
---|---|
Returns: | A list of attributes that the method was unable to reset, which is empty : if all the attributes were successfully reset. : |
Shortcut for setting object trait attributes.
Parameters: | trait_change_notify : Boolean
traits : list of key/value pairs
|
---|---|
Returns: | self :
|
Sets a trait notification dispatch handler.
Synchronizes the value of a trait attribute on this object with a trait attribute on another object.
Parameters: | name : string
object : object
alias : string
mutual : Boolean or integer
remove : Boolean or integer
|
---|
Returns the trait definition for the name trait attribute.
Parameters: | name : string
force : Boolean
copy : Boolean
|
---|
Returns the default context to use for editing or configuring traits.
Shortcut for getting object trait attributes.
Parameters: | names : list of trait attribute names
|
---|---|
Returns: | A dictionary whose keys are the names passed as arguments and whose : values are the corresponding trait values : |
Adds or removes the specified handler from the list of active monitors.
Parameters: | handler : function
remove : boolean
|
---|
Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified.
Parameters: | metadata : dictionary
|
---|
Shortcut for setting object trait attributes.
Parameters: | trait_change_notify : Boolean
traits : list of key/value pairs
|
---|---|
Returns: | self :
|
Shortcut for setting object trait attributes.
Parameters: | traits : list of key/value pairs
|
---|---|
Returns: | self :
|
Returns a list of the immediate (or all) subclasses of this class.
Parameters: | all : Boolean
|
---|
Gets or sets a ViewElement associated with an object’s class.
Parameters: | name : string
view_element : a ViewElement object
|
---|---|
Returns: | A view element. : |
Returns the ViewElements object associated with the object’s class.
The returned object can be used to access all the view elements associated with the class.
Returns a list of the names of all view elements associated with the current object’s class.
Parameters: | klass : a class
|
---|
Returns a dictionary containing the definitions of all of the trait attributes of this object that match the set of metadata criteria.
Parameters: | metadata : dictionary
|
---|
Validates whether a value is legal for a trait.
Returns the validated value if it is valid.
Bases: object
Function to capture stdout and stderr streams with timestamps
stackoverflow.com/questions/4984549/merge-and-sync-stdout-and-stderr/5188359
Methods
fileno() | Pass-through for file descriptor. |
read([drain]) | Read from the file descriptor. |
Pass-through for file descriptor.
Read from the file descriptor. If ‘drain’ set, read until EOF.
Bases: nipype.interfaces.base.BaseTraitedSpec
Create a subclass with strict traits.
This is used in 90% of the cases.
Methods
add_class_trait(name, *trait) | Adds a named trait attribute to this class. |
add_trait(name, *trait) | Adds a trait attribute to this object. |
add_trait_category(category) | Adds a trait category to a class. |
add_trait_listener(object[, prefix]) | |
all_trait_names() | Returns the list of all trait names, including implicitly defined |
base_trait(name) | Returns the base trait definition for a trait attribute. |
class_default_traits_view() | Returns the name of the default traits view for the class. |
class_editable_traits() | Returns an alphabetically sorted list of the names of non-event |
class_trait_names(**metadata) | Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified. |
class_trait_view([name, view_element]) | |
class_trait_view_elements() | Returns the ViewElements object associated with the class. |
class_traits(**metadata) | Returns a dictionary containing the definitions of all of the trait attributes of the class that match the set of metadata criteria. |
clone_traits([traits, memo, copy]) | Clones a new object from this one, optionally copying only a specified set of traits. |
configure_traits([filename, view, kind, ...]) | Creates and displays a dialog box for editing values of trait |
copy_traits(other[, traits, memo, copy]) | Copies another object’s trait attributes into this one. |
copyable_trait_names(**metadata) | Returns the list of trait names to copy or clone by default. |
default_traits_view() | Returns the name of the default traits view for the object’s class. |
edit_traits([view, parent, kind, context, ...]) | Displays a user interface window for editing trait attribute values. |
editable_traits() | Returns an alphabetically sorted list of the names of non-event |
get(**kwargs) | Returns traited class as a dict |
get_hashval([hash_method]) | Return a dictionary of our items with hashes for each file. |
get_traitsfree(**kwargs) | Returns traited class as a dict |
has_traits_interface(*interfaces) | Returns whether the object implements a specified traits interface. |
items() | Name, trait generator for user modifiable traits |
on_trait_change(handler[, name, remove, ...]) | Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association. |
on_trait_event(handler[, name, remove, ...]) | Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association. |
print_traits([show_help]) | Prints the values of all explicitly-defined, non-event trait attributes on the current object, in an easily readable format. |
remove_trait(name) | Removes a trait attribute from this object. |
remove_trait_listener(object[, prefix]) | |
reset_traits([traits]) | Resets some or all of an object’s trait attributes to their default values. |
set([trait_change_notify]) | Shortcut for setting object trait attributes. |
set_trait_dispatch_handler(name, klass[, ...]) | Sets a trait notification dispatch handler. |
sync_trait(trait_name, object[, alias, ...]) | Synchronizes the value of a trait attribute on this object with a trait attribute on another object. |
trait(name[, force, copy]) | Returns the trait definition for the name trait attribute. |
trait_context() | Returns the default context to use for editing or configuring |
trait_get(*names, **metadata) | Shortcut for getting object trait attributes. |
trait_items_event(event_trait,name,items_event) | |
trait_monitor(handler[, remove]) | Adds or removes the specified handler from the list of active monitors. |
trait_names(**metadata) | Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified. |
trait_property_changed(...) | |
trait_set([trait_change_notify]) | Shortcut for setting object trait attributes. |
trait_setq(**traits) | Shortcut for setting object trait attributes. |
trait_subclasses([all]) | Returns a list of the immediate (or all) subclasses of this class. |
trait_view([name, view_element]) | Gets or sets a ViewElement associated with an object’s class. |
trait_view_elements() | Returns the ViewElements object associated with the object’s |
trait_views([klass]) | Returns a list of the names of all view elements associated with the current object’s class. |
traits(**metadata) | Returns a dictionary containing the definitions of all of the trait attributes of this object that match the set of metadata criteria. |
traits_init() | |
traits_inited([True]) | |
validate_trait(name, value) | Validates whether a value is legal for a trait. |
Initialize handlers and inputs
Adds a named trait attribute to this class.
Parameters: | name : string
trait : a trait or a value that can be converted to a trait using Trait()
|
---|
Adds a trait attribute to this object.
Parameters: | name : string
trait : trait or a value that can be converted to a trait by Trait()
|
---|
Adds a trait category to a class.
Returns the list of all trait names, including implicitly defined traits.
Returns the base trait definition for a trait attribute.
Parameters: | name : string
|
---|
Returns the name of the default traits view for the class.
Returns an alphabetically sorted list of the names of non-event trait attributes associated with the current class.
Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified.
Parameters: | metadata : dictionary
|
---|
Returns the ViewElements object associated with the class.
The returned object can be used to access all the view elements associated with the class.
Returns a dictionary containing the definitions of all of the trait attributes of the class that match the set of metadata criteria.
Parameters: | metadata : dictionary
|
---|
Clones a new object from this one, optionally copying only a specified set of traits.
Parameters: | traits : list of strings
memo : dictionary
copy : None | ‘deep’ | ‘shallow’
|
---|---|
Returns: | The newly cloned object. : |
Creates and displays a dialog box for editing values of trait attributes, as if it were a complete, self-contained GUI application.
Parameters: | filename : string
view : view or string
kind : string
edit : Boolean
context : object or dictionary
handler : Handler object
id : string
scrollable : Boolean
|
---|
Copies another object’s trait attributes into this one.
Parameters: | other : object
traits : list of strings
memo : dictionary
copy : None | ‘deep’ | ‘shallow’
|
---|---|
Returns: | A list of attributes that the method was unable to copy, : which is empty if all the attributes were successfully copied. : |
Returns the list of trait names to copy or clone by default.
Returns the name of the default traits view for the object’s class.
Displays a user interface window for editing trait attribute values.
Parameters: | view : view or string
parent : window handle
kind : string
context : object or dictionary
handler : Handler object
id : string
scrollable : Boolean
|
---|
Returns an alphabetically sorted list of the names of non-event trait attributes associated with the current object.
Returns traited class as a dict
Augments the trait get function to return a dictionary without notification handles
Return a dictionary of our items with hashes for each file.
Searches through dictionary items and if an item is a file, it calculates the md5 hash of the file contents and stores the file name and hash value as the new key value.
However, the overall bunch hash is calculated only on the hash value of a file. The path and name of the file are not used in the overall hash calculation.
Returns: | dict_withhash : dict
hashvalue : str
|
---|
Returns traited class as a dict
Augments the trait get function to return a dictionary without any traits. The dictionary does not contain any attributes that were Undefined
Returns whether the object implements a specified traits interface.
Parameters: | interfaces : one or more traits Interface (sub)classes. |
---|
Name, trait generator for user modifiable traits
Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association.
Parameters: | handler : function
name : string
remove : Boolean
dispatch : string
|
---|
Causes the object to invoke a handler whenever a trait attribute matching a specified pattern is modified, or removes the association.
Parameters: | handler : function
name : string
remove : Boolean
dispatch : string
|
---|
Prints the values of all explicitly-defined, non-event trait attributes on the current object, in an easily readable format.
Parameters: | show_help : Boolean
|
---|
Removes a trait attribute from this object.
Parameters: | name : string
|
---|
Resets some or all of an object’s trait attributes to their default values.
Parameters: | traits : list of strings
|
---|---|
Returns: | A list of attributes that the method was unable to reset, which is empty : if all the attributes were successfully reset. : |
Shortcut for setting object trait attributes.
Parameters: | trait_change_notify : Boolean
traits : list of key/value pairs
|
---|---|
Returns: | self :
|
Sets a trait notification dispatch handler.
Synchronizes the value of a trait attribute on this object with a trait attribute on another object.
Parameters: | name : string
object : object
alias : string
mutual : Boolean or integer
remove : Boolean or integer
|
---|
Returns the trait definition for the name trait attribute.
Parameters: | name : string
force : Boolean
copy : Boolean
|
---|
Returns the default context to use for editing or configuring traits.
Shortcut for getting object trait attributes.
Parameters: | names : list of trait attribute names
|
---|---|
Returns: | A dictionary whose keys are the names passed as arguments and whose : values are the corresponding trait values : |
Adds or removes the specified handler from the list of active monitors.
Parameters: | handler : function
remove : boolean
|
---|
Returns a list of the names of all trait attributes whose definitions match the set of metadata criteria specified.
Parameters: | metadata : dictionary
|
---|
Shortcut for setting object trait attributes.
Parameters: | trait_change_notify : Boolean
traits : list of key/value pairs
|
---|---|
Returns: | self :
|
Shortcut for setting object trait attributes.
Parameters: | traits : list of key/value pairs
|
---|---|
Returns: | self :
|
Returns a list of the immediate (or all) subclasses of this class.
Parameters: | all : Boolean
|
---|
Gets or sets a ViewElement associated with an object’s class.
Parameters: | name : string
view_element : a ViewElement object
|
---|---|
Returns: | A view element. : |
Returns the ViewElements object associated with the object’s class.
The returned object can be used to access all the view elements associated with the class.
Returns a list of the names of all view elements associated with the current object’s class.
Parameters: | klass : a class
|
---|
Returns a dictionary containing the definitions of all of the trait attributes of this object that match the set of metadata criteria.
Parameters: | metadata : dictionary
|
---|
Validates whether a value is legal for a trait.
Returns the validated value if it is valid.
Return library dependencies of a dynamically linked executable
Uses otool on darwin, ldd on linux. Currently doesn’t support windows.
Load a template from the script_templates directory
Parameters: | name : str
|
---|---|
Returns: | template : string.Template |
Run a command, read stdout and stderr, prefix with timestamp.
The returned runtime contains a merged stdout+stderr log with timestamps