.. AUTO-GENERATED FILE -- DO NOT EDIT!

interfaces.dcm2nii
==================


.. _nipype.interfaces.dcm2nii.Dcm2nii:


.. index:: Dcm2nii

Dcm2nii
-------

`Link to code <file:///build/nipype-1.1.8/nipype/interfaces/dcm2nii.py#L103>`__

Wraps the executable command ``dcm2nii``.

Uses MRIcron's dcm2nii to convert dicom files

Examples
~~~~~~~~

>>> from nipype.interfaces.dcm2nii import Dcm2nii
>>> converter = Dcm2nii()
>>> converter.inputs.source_names = ['functional_1.dcm', 'functional_2.dcm']
>>> converter.inputs.gzip_output = True
>>> converter.inputs.output_dir = '.'
>>> converter.cmdline  # doctest: +ELLIPSIS
'dcm2nii -a y -c y -b config.ini -v y -d y -e y -g y -i n -n y -o . -p y -x n -f n functional_1.dcm'

Inputs::

        [Mandatory]
        source_names: (a list of items which are an existing file name)
                argument: ``%s``, position: -1
                mutually_exclusive: source_dir
        source_dir: (an existing directory name)
                argument: ``%s``, position: -1
                mutually_exclusive: source_names

        [Optional]
        spm_analyze: (a boolean)
                SPM2/Analyze not SPM5/NIfTI
                argument: ``-s``
                mutually_exclusive: nii_output
        gzip_output: (a boolean, nipype default value: False)
                Gzip output (.gz)
                argument: ``-g``
        config_file: (an existing file name)
                Load settings from specified inifile
                argument: ``-b %s``
        date_in_filename: (a boolean, nipype default value: True)
                Date in filename
                argument: ``-d``
        events_in_filename: (a boolean, nipype default value: True)
                Events (series/acq) in filename
                argument: ``-e``
        args: (a unicode string)
                Additional parameters to the command
                argument: ``%s``
        convert_all_pars: (a boolean, nipype default value: True)
                Convert every image in directory
                argument: ``-v``
        protocol_in_filename: (a boolean, nipype default value: True)
                Protocol in filename
                argument: ``-p``
        collapse_folders: (a boolean, nipype default value: True)
                Collapse input folders
                argument: ``-c``
        reorient: (a boolean)
                Reorient image to nearest orthogonal
                argument: ``-r``
        environ: (a dictionary with keys which are a newbytes or None or a
                  newstr or None and with values which are a newbytes or None or a
                  newstr or None, nipype default value: {})
                Environment variables
        output_dir: (an existing directory name)
                Output dir - if unspecified, source directory is used
                argument: ``-o %s``
        reorient_and_crop: (a boolean, nipype default value: False)
                Reorient and crop 3D images
                argument: ``-x``
        anonymize: (a boolean, nipype default value: True)
                Remove identifying information
                argument: ``-a``
        id_in_filename: (a boolean, nipype default value: False)
                ID in filename
                argument: ``-i``
        nii_output: (a boolean, nipype default value: True)
                Save as .nii - if no, create .hdr/.img pair
                argument: ``-n``
        source_in_filename: (a boolean, nipype default value: False)
                Source filename
                argument: ``-f``

Outputs::

        reoriented_and_cropped_files: (a list of items which are an existing
                  file name)
        converted_files: (a list of items which are an existing file name)
        bvecs: (a list of items which are an existing file name)
        bvals: (a list of items which are an existing file name)
        reoriented_files: (a list of items which are an existing file name)

.. _nipype.interfaces.dcm2nii.Dcm2niix:


.. index:: Dcm2niix

Dcm2niix
--------

`Link to code <file:///build/nipype-1.1.8/nipype/interfaces/dcm2nii.py#L358>`__

Wraps the executable command ``dcm2niix``.

Uses Chris Rorden's dcm2niix to convert dicom files

Examples
~~~~~~~~

>>> from nipype.interfaces.dcm2nii import Dcm2niix
>>> converter = Dcm2niix()
>>> converter.inputs.source_dir = 'dicomdir'
>>> converter.inputs.compression = 5
>>> converter.inputs.output_dir = 'ds005'
>>> converter.cmdline
'dcm2niix -b y -z y -5 -x n -t n -m n -o ds005 -s n -v n dicomdir'
>>> converter.run() # doctest: +SKIP

In the example below, we note that the current version of dcm2niix
converts any files in the directory containing the files in the list. We
also do not support nested filenames with this option. **Thus all files
must have a common root directory.**

>>> converter = Dcm2niix()
>>> converter.inputs.source_names = ['functional_1.dcm', 'functional_2.dcm']
>>> converter.inputs.compression = 5
>>> converter.inputs.output_dir = 'ds005'
>>> converter.cmdline
'dcm2niix -b y -z y -5 -x n -t n -m n -o ds005 -s n -v n .'
>>> converter.run() # doctest: +SKIP

Inputs::

        [Mandatory]
        source_names: (a list of items which are an existing file name)
                A set of filenames to be converted. Note that the current version
                (1.0.20180328) of dcm2niix converts any files in the directory. To
                only convert specific files they should be in an isolated directory
                argument: ``%s``, position: -1
                mutually_exclusive: source_dir
        source_dir: (an existing directory name)
                A directory containing dicom files to be converted
                argument: ``%s``, position: -1
                mutually_exclusive: source_names

        [Optional]
        out_filename: (a unicode string)
                Output filename template (%a=antenna (coil) number, %c=comments,
                %d=description, %e=echo number, %f=folder name, %i=ID of patient,
                %j=seriesInstanceUID, %k=studyInstanceUID, %m=manufacturer, %n=name
                of patient, %p=protocol, %s=series number, %t=time, %u=acquisition
                number, %v=vendor, %x=study ID; %z=sequence name)
                argument: ``-f %s``
        comment: (a unicode string)
                Comment stored as NIfTI aux_file
                argument: ``-c %s``
        ignore_deriv: (a boolean)
                Ignore derived, localizer and 2D images
                argument: ``-i``
        verbose: (a boolean, nipype default value: False)
                Verbose output
                argument: ``-v``
        philips_float: (a boolean)
                Philips precise float (not display) scaling
                argument: ``-p``
        anon_bids: (a boolean)
                Anonymize BIDS
                argument: ``-ba``
                requires: bids_format
        output_dir: (an existing directory name, nipype default value: .)
                Output directory
                argument: ``-o %s``
        bids_format: (a boolean, nipype default value: True)
                Create a BIDS sidecar file
                argument: ``-b``
        args: (a unicode string)
                Additional parameters to the command
                argument: ``%s``
        compress: (u'y' or u'i' or u'n' or u'3', nipype default value: y)
                Gzip compress images - [y=pigz, i=internal, n=no, 3=no,3D]
                argument: ``-z %s``
        crop: (a boolean, nipype default value: False)
                Crop 3D T1 acquisitions
                argument: ``-x``
        has_private: (a boolean, nipype default value: False)
                Flag if text notes include private patient details
                argument: ``-t``
        series_numbers: (a list of items which are a unicode string)
                Selectively convert by series number - can be used up to 16 times
                argument: ``-n %s...``
        environ: (a dictionary with keys which are a newbytes or None or a
                  newstr or None and with values which are a newbytes or None or a
                  newstr or None, nipype default value: {})
                Environment variables
        single_file: (a boolean, nipype default value: False)
                Single file mode
                argument: ``-s``
        merge_imgs: (a boolean, nipype default value: False)
                merge 2D slices from same series
                argument: ``-m``
        compression: (1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9)
                Gz compression level (1=fastest, 9=smallest)
                argument: ``-%d``

Outputs::

        converted_files: (a list of items which are an existing file name)
        bvecs: (a list of items which are an existing file name)
        bvals: (a list of items which are an existing file name)
        bids: (a list of items which are an existing file name)
