interfaces.dcmstack

CopyMeta

Link to code

Copy meta data from one Nifti file to another. Useful for preserving meta data after some processing steps.

Inputs:

[Mandatory]
src_file: (an existing file name)
dest_file: (an existing file name)

[Optional]
include_classes: (a list of items which are any value)
        List of specific meta data classifications to include. If not
        specified include everything.
exclude_classes: (a list of items which are any value)
        List of meta data classifications to exclude

Outputs:

dest_file: (an existing file name)

DcmStack

Link to code

Create one Nifti file from a set of DICOM files. Can optionally embed meta data.

Example

>>> from nipype.interfaces.dcmstack import DcmStack
>>> stacker = DcmStack()
>>> stacker.inputs.dicom_files = 'path/to/series/'
>>> stacker.run() 
>>> result.outputs.out_file 
'/path/to/cwd/sequence.nii.gz'

Inputs:

[Mandatory]
dicom_files: (a list of items which are an existing file name or an
          existing directory name or a unicode string)

[Optional]
embed_meta: (a boolean)
        Embed DICOM meta data into result
exclude_regexes: (a list of items which are any value)
        Meta data to exclude, suplementing any default exclude filters
include_regexes: (a list of items which are any value)
        Meta data to include, overriding any exclude filters
force_read: (a boolean, nipype default value: True)
        Force reading files without DICM marker
out_format: (a unicode string)
        String which can be formatted with meta data to create the output
        filename(s)
out_ext: (a unicode string, nipype default value: .nii.gz)
        Determines output file type
out_path: (a directory name)
        output path, current working directory if not set

Outputs:

out_file: (an existing file name)

GroupAndStack

Link to code

Create (potentially) multiple Nifti files for a set of DICOM files.

Inputs:

[Mandatory]
dicom_files: (a list of items which are an existing file name or an
          existing directory name or a unicode string)

[Optional]
embed_meta: (a boolean)
        Embed DICOM meta data into result
exclude_regexes: (a list of items which are any value)
        Meta data to exclude, suplementing any default exclude filters
include_regexes: (a list of items which are any value)
        Meta data to include, overriding any exclude filters
force_read: (a boolean, nipype default value: True)
        Force reading files without DICM marker
out_format: (a unicode string)
        String which can be formatted with meta data to create the output
        filename(s)
out_ext: (a unicode string, nipype default value: .nii.gz)
        Determines output file type
out_path: (a directory name)
        output path, current working directory if not set

Outputs:

out_list: (a list of items which are any value)
        List of output nifti files

LookupMeta

Link to code

Lookup meta data values from a Nifti with embedded meta data.

Example

>>> from nipype.interfaces import dcmstack
>>> lookup = dcmstack.LookupMeta()
>>> lookup.inputs.in_file = 'functional.nii'
>>> lookup.inputs.meta_keys = {'RepetitionTime' : 'TR',                                    'EchoTime' : 'TE'}
>>> result = lookup.run() 
>>> result.outputs.TR 
9500.0
>>> result.outputs.TE 
95.0

Inputs:

[Mandatory]
in_file: (an existing file name)
        The input Nifti file
meta_keys: (a list of items which are any value or a dictionary with
          keys which are any value and with values which are any value)
        List of meta data keys to lookup, or a dict where keys specify the
        meta data keys to lookup and the values specify the output names

Outputs:

None

MergeNifti

Link to code

Merge multiple Nifti files into one. Merges together meta data extensions as well.

Inputs:

[Mandatory]
in_files: (a list of items which are any value)
        List of Nifti files to merge

[Optional]
sort_order: (a unicode string or a list of items which are any value)
        One or more meta data keys to sort files by.
merge_dim: (an integer (int or long))
        Dimension to merge along. If not specified, the last singular or
        non-existant dimension is used.
out_format: (a unicode string)
        String which can be formatted with meta data to create the output
        filename(s)
out_ext: (a unicode string, nipype default value: .nii.gz)
        Determines output file type
out_path: (a directory name)
        output path, current working directory if not set

Outputs:

out_file: (an existing file name)
        Merged Nifti file

NiftiGeneratorBase

Link to code

Base class for interfaces that produce Nifti files, potentially with embedded meta data.

Inputs:

None

Outputs:

None

SplitNifti

Link to code

Split one Nifti file into many along the specified dimension. Each result has an updated meta data extension as well.

Inputs:

[Mandatory]
in_file: (an existing file name)
        Nifti file to split

[Optional]
split_dim: (an integer (int or long))
        Dimension to split along. If not specified, the last dimension is
        used.
out_format: (a unicode string)
        String which can be formatted with meta data to create the output
        filename(s)
out_ext: (a unicode string, nipype default value: .nii.gz)
        Determines output file type
out_path: (a directory name)
        output path, current working directory if not set

Outputs:

out_list: (a list of items which are an existing file name)
        Split Nifti files

make_key_func()

Link to code

sanitize_path_comp()

Link to code