nipype.utils.nipype2boutiques module

nipype.utils.nipype2boutiques.fill_in_missing_output_path(output, output_name, tool_inputs)

Creates a path template for outputs that are missing one This is needed for the descriptor to be valid (path template is required)

nipype.utils.nipype2boutiques.generate_boutiques_descriptor(module, interface_name, container_image, container_type, container_index=None, verbose=False, save=False, save_path=None, author=None, ignore_inputs=None, tags=None)

Generate a JSON Boutiques description of a Nipype interface.

Parameters:
  • module – module where the Nipype interface is declared.

  • interface_name – name of Nipype interface.

  • container_image – name of the container image where the tool is installed

  • container_type – type of container image (Docker or Singularity)

  • container_index – optional index where the image is available

  • verbose – print information messages

  • save – True if you want to save descriptor to a file

  • save_path – file path for the saved descriptor (defaults to name of the interface in current directory)

  • author – author of the tool (required for publishing)

  • ignore_inputs – list of interface inputs to not include in the descriptor

  • tags – JSON object containing tags to include in the descriptor, e.g. {"key1": "value1"} (note: the tags ‘domain:neuroinformatics’ and ‘interface-type:nipype’ are included by default)

Returns:

boutiques – string containing a Boutiques’ JSON object

Return type:

str

nipype.utils.nipype2boutiques.generate_custom_inputs(desc_inputs)

Generates a bunch of custom input dictionaries in order to generate as many outputs as possible (to get their path templates). Currently only works with flag inputs and inputs with defined value choices.

nipype.utils.nipype2boutiques.generate_tool_outputs(outputs, interface, tool_desc, verbose, first_run)
nipype.utils.nipype2boutiques.get_boutiques_groups(input_traits)

Returns a list of dictionaries containing Boutiques groups for the mutually exclusive Nipype inputs.

nipype.utils.nipype2boutiques.get_boutiques_input(inputs, interface, input_name, spec, verbose, handler=None, input_number=None)

Returns a dictionary containing the Boutiques input corresponding to a Nipype input.

Args:
  • inputs: inputs of the Nipype interface.

  • interface: Nipype interface.

  • input_name: name of the Nipype input.

  • spec: Nipype input spec.

  • verbose: print information messages.

  • handler: used when handling compound inputs, which don’t have their own input spec

  • input_number: used when handling compound inputs to assign each a unique ID

Assumes that:
  • Input names are unique.

nipype.utils.nipype2boutiques.get_boutiques_output(outputs, name, spec, interface, tool_inputs)

Returns a dictionary containing the Boutiques output corresponding to a Nipype output.

Args:
  • outputs: outputs of the Nipype interface.

  • name: name of the Nipype output.

  • spec: Nipype output spec.

  • interface: Nipype interface.

  • tool_inputs: list of tool inputs (as produced by method get_boutiques_input).

Assumes that:
  • Output names are unique.

  • Input values involved in the path template are defined.

  • Output files are written in the current directory.

  • There is a single output value (output lists are not supported).

nipype.utils.nipype2boutiques.get_boutiques_output_from_inp(inputs, inp_spec, inp_name)

Takes a Nipype input representing an output file and generates a Boutiques output for it

nipype.utils.nipype2boutiques.get_command_line_flag(input_spec, is_flag_type=False, input_name=None)

Generates the command line flag for a given input

nipype.utils.nipype2boutiques.get_description_from_spec(obj, name, spec)

Generates a description based on the input or output spec.

nipype.utils.nipype2boutiques.reorder_cmd_line_args(cmd_line, interface, ignore_inputs=None)

Generates a new command line with the positional arguments in the correct order