nipype.interfaces.minc.minc module

The minc module provides classes for interfacing with the MINC command line tools. This module was written to work with MINC version 2.2.00.

Author: Carlo Hamalainen

Average

Link to code

Bases: CommandLine

Wrapped executable: mincaverage.

Average a number of MINC files.

Examples

>>> from nipype.interfaces.minc import Average
>>> from nipype.interfaces.minc.testdata import nonempty_minc_data
>>> files = [nonempty_minc_data(i) for i in range(3)]
>>> average = Average(input_files=files, output_file='/tmp/tmp.mnc')
>>> average.run() 
Mandatory Inputs:
  • filelist (a pathlike object or string representing an existing file) – Specify the name of a file containing input file names. Maps to a command-line argument: -filelist %s. Mutually exclusive with inputs: input_files, filelist.

  • input_files (a list of items which are a pathlike object or string representing an existing file) – Input file(s). Maps to a command-line argument: %s (position: -2). Mutually exclusive with inputs: input_files, filelist.

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • avgdim (a string) – Specify a dimension along which we wish to average. Maps to a command-line argument: -avgdim %s.

  • binarize (a boolean) – Binarize the volume by looking for values in a given range. Maps to a command-line argument: -binarize.

  • binrange (a tuple of the form: (a float, a float)) – Specify a range for binarization. Default value: 1.79769e+308 -1.79769e+308. Maps to a command-line argument: -binrange %s %s.

  • binvalue (a float) – Specify a target value (+/- 0.5) forbinarization. Default value: -1.79769e+308. Maps to a command-line argument: -binvalue %s.

  • check_dimensions (a boolean) – Check that dimension info matches across files (default). Maps to a command-line argument: -check_dimensions. Mutually exclusive with inputs: check_dimensions, no_check_dimensions.

  • clobber (a boolean) – Overwrite existing file. Maps to a command-line argument: -clobber. (Nipype default value: True)

  • copy_header (a boolean) – Copy all of the header from the first file (default for one file). Maps to a command-line argument: -copy_header. Mutually exclusive with inputs: copy_header, no_copy_header.

  • debug (a boolean) – Print out debugging messages. Maps to a command-line argument: -debug.

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • format_byte (a boolean) – Write out byte data. Maps to a command-line argument: -byte. Mutually exclusive with inputs: format_filetype, format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_double (a boolean) – Write out double-precision floating-point data. Maps to a command-line argument: -double. Mutually exclusive with inputs: format_filetype, format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_filetype (a boolean) – Use data type of first file (default). Maps to a command-line argument: -filetype. Mutually exclusive with inputs: format_filetype, format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_float (a boolean) – Write out single-precision floating-point data. Maps to a command-line argument: -float. Mutually exclusive with inputs: format_filetype, format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_int (a boolean) – Write out 32-bit integer data. Maps to a command-line argument: -int. Mutually exclusive with inputs: format_filetype, format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_long (a boolean) – Superseded by -int. Maps to a command-line argument: -long. Mutually exclusive with inputs: format_filetype, format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_short (a boolean) – Write out short integer data. Maps to a command-line argument: -short. Mutually exclusive with inputs: format_filetype, format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_signed (a boolean) – Write signed integer data. Maps to a command-line argument: -signed. Mutually exclusive with inputs: format_filetype, format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_unsigned (a boolean) – Write unsigned integer data (default). Maps to a command-line argument: -unsigned. Mutually exclusive with inputs: format_filetype, format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • max_buffer_size_in_kb (an integer >= 0) – Specify the maximum size of the internal buffers (in kbytes). Maps to a command-line argument: -max_buffer_size_in_kb %d. (Nipype default value: 4096)

  • no_check_dimensions (a boolean) – Do not check dimension info. Maps to a command-line argument: -nocheck_dimensions. Mutually exclusive with inputs: check_dimensions, no_check_dimensions.

  • no_copy_header (a boolean) – Do not copy all of the header from the first file (default for many files)). Maps to a command-line argument: -nocopy_header. Mutually exclusive with inputs: copy_header, no_copy_header.

  • nonormalize (a boolean) – Do not normalize data sets (default). Maps to a command-line argument: -nonormalize. Mutually exclusive with inputs: normalize, nonormalize.

  • normalize (a boolean) – Normalize data sets for mean intensity. Maps to a command-line argument: -normalize. Mutually exclusive with inputs: normalize, nonormalize.

  • output_file (a pathlike object or string representing a file) – Output file. Maps to a command-line argument: %s (position: -1).

  • quiet (a boolean) – Do not print out log messages. Maps to a command-line argument: -quiet. Mutually exclusive with inputs: verbose, quiet.

  • sdfile (a pathlike object or string representing a file) – Specify an output sd file (default=none). Maps to a command-line argument: -sdfile %s.

  • two (a boolean) – Create a MINC 2 output file. Maps to a command-line argument: -2.

  • verbose (a boolean) – Print out log messages (default). Maps to a command-line argument: -verbose. Mutually exclusive with inputs: verbose, quiet.

  • voxel_range (a tuple of the form: (an integer, an integer)) – Valid range for output data. Maps to a command-line argument: -range %d %d.

  • weights (a list of items which are a string) – Specify weights for averaging (“<w1>,<w2>,…”). Maps to a command-line argument: -weights %s.

  • width_weighted (a boolean) – Weight by dimension widths when -avgdim is used. Maps to a command-line argument: -width_weighted. Requires inputs: avgdim.

Outputs:

output_file (a pathlike object or string representing an existing file) – Output file.

BBox

Link to code

Bases: StdOutCommandLine

Wrapped executable: mincbbox.

Determine a bounding box of image.

Examples

>>> from nipype.interfaces.minc import BBox
>>> from nipype.interfaces.minc.testdata import nonempty_minc_data
>>> file0 = nonempty_minc_data(0)
>>> bbox = BBox(input_file=file0)
>>> bbox.run() 
Mandatory Inputs:

input_file (a pathlike object or string representing an existing file) – Input file. Maps to a command-line argument: %s (position: -2).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • format_minccrop (a boolean) – Output format for minccrop: (-xlim x1 x2 -ylim y1 y2 -zlim z1 z2. Maps to a command-line argument: -minccrop.

  • format_mincresample (a boolean) – Output format for mincresample: (-step x y z -start x y z -nelements x y z. Maps to a command-line argument: -mincresample.

  • format_mincreshape (a boolean) – Output format for mincreshape: (-start x,y,z -count dx,dy,dz. Maps to a command-line argument: -mincreshape.

  • one_line (a boolean) – Output on one line (default): start_x y z width_x y z. Maps to a command-line argument: -one_line. Mutually exclusive with inputs: one_line, two_lines.

  • out_file (a pathlike object or string representing a file) – Maps to a command-line argument: > %s (position: -1).

  • output_file (a pathlike object or string representing a file) – Output file containing bounding box corners.

  • threshold (an integer) – VIO_Real value threshold for bounding box. Default value: 0. Maps to a command-line argument: -threshold.

  • two_lines (a boolean) – Write output with two rows (start and width). Maps to a command-line argument: -two_lines. Mutually exclusive with inputs: one_line, two_lines.

Outputs:

output_file (a pathlike object or string representing an existing file) – Output file containing bounding box corners.

Beast

Link to code

Bases: CommandLine

Wrapped executable: mincbeast.

Extract brain image using BEaST (Brain Extraction using non-local Segmentation Technique).

Examples

>>> from nipype.interfaces.minc import Beast
>>> from nipype.interfaces.minc.testdata import nonempty_minc_data
>>> file0 = nonempty_minc_data(0)
>>> beast = Beast(input_file=file0)
>>> beast .run() 
Mandatory Inputs:
  • input_file (a pathlike object or string representing a file) – Input file. Maps to a command-line argument: %s (position: -2).

  • library_dir (a pathlike object or string representing a directory) – Library directory. Maps to a command-line argument: %s (position: -3).

Optional Inputs:
  • abspath (a boolean) – File paths in the library are absolute (default is relative to library root). Maps to a command-line argument: -abspath. (Nipype default value: True)

  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • clobber (a boolean) – Overwrite existing file. Maps to a command-line argument: -clobber. (Nipype default value: True)

  • confidence_level_alpha (a float) – Specify confidence level Alpha. Default value: 0.5. Maps to a command-line argument: -alpha %s. (Nipype default value: 0.5)

  • configuration_file (a pathlike object or string representing a file) – Specify configuration file. Maps to a command-line argument: -configuration %s.

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • fill_holes (a boolean) – Fill holes in the binary output. Maps to a command-line argument: -fill.

  • flip_images (a boolean) – Flip images around the mid-sagittal plane to increase patch count. Maps to a command-line argument: -flip.

  • load_moments (a boolean) – Do not calculate moments instead use precalculatedlibrary moments. (for optimization purposes). Maps to a command-line argument: -load_moments.

  • median_filter (a boolean) – Apply a median filter on the probability map. Maps to a command-line argument: -median.

  • nlm_filter (a boolean) – Apply an NLM filter on the probability map (experimental). Maps to a command-line argument: -nlm_filter.

  • number_selected_images (an integer) – Specify number of selected images. Default value: 20. Maps to a command-line argument: -selection_num %s. (Nipype default value: 20)

  • output_file (a pathlike object or string representing a file) – Output file. Maps to a command-line argument: %s (position: -1).

  • patch_size (an integer) – Specify patch size for single scale approach. Default value: 1. Maps to a command-line argument: -patch_size %s. (Nipype default value: 1)

  • probability_map (a boolean) – Output the probability map instead of crisp mask. Maps to a command-line argument: -probability.

  • same_resolution (a boolean) – Output final mask with the same resolution as input file. Maps to a command-line argument: -same_resolution.

  • search_area (an integer) – Specify size of search area for single scale approach. Default value: 2. Maps to a command-line argument: -search_area %s. (Nipype default value: 2)

  • smoothness_factor_beta (a float) – Specify smoothness factor Beta. Default value: 0.25. Maps to a command-line argument: -beta %s. (Nipype default value: 0.5)

  • threshold_patch_selection (a float) – Specify threshold for patch selection. Default value: 0.95. Maps to a command-line argument: -threshold %s. (Nipype default value: 0.95)

  • voxel_size (an integer) – Specify voxel size for calculations (4, 2, or 1).Default value: 4. Assumes no multiscale. Use configurationfile for multiscale. Maps to a command-line argument: -voxel_size %s. (Nipype default value: 4)

Outputs:

output_file (a pathlike object or string representing an existing file) – Output mask file.

BestLinReg

Link to code

Bases: CommandLine

Wrapped executable: bestlinreg.

Hierachial linear fitting between two files.

The bestlinreg script is part of the EZminc package:

https://github.com/BIC-MNI/EZminc/blob/master/scripts/bestlinreg.pl

Examples

>>> from nipype.interfaces.minc import BestLinReg
>>> from nipype.interfaces.minc.testdata import nonempty_minc_data
>>> input_file = nonempty_minc_data(0)
>>> target_file = nonempty_minc_data(1)
>>> linreg = BestLinReg(source=input_file, target=target_file)
>>> linreg.run() 
Mandatory Inputs:
  • source (a pathlike object or string representing an existing file) – Source Minc file. Maps to a command-line argument: %s (position: -4).

  • target (a pathlike object or string representing an existing file) – Target Minc file. Maps to a command-line argument: %s (position: -3).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • clobber (a boolean) – Overwrite existing file. Maps to a command-line argument: -clobber. (Nipype default value: True)

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • output_mnc (a pathlike object or string representing a file) – Output mnc file. Maps to a command-line argument: %s (position: -1).

  • output_xfm (a pathlike object or string representing a file) – Output xfm file. Maps to a command-line argument: %s (position: -2).

  • verbose (a boolean) – Print out log messages. Default: False. Maps to a command-line argument: -verbose.

Outputs:
  • output_mnc (a pathlike object or string representing an existing file) – Output mnc file.

  • output_xfm (a pathlike object or string representing an existing file) – Output xfm file.

BigAverage

Link to code

Bases: CommandLine

Wrapped executable: mincbigaverage.

Average 1000’s of MINC files in linear time.

mincbigaverage is designed to discretise the problem of averaging either a large number of input files or averaging a smaller number of large files. (>1GB each). There is also some code included to perform “robust” averaging in which only the most common features are kept via down-weighting outliers beyond a standard deviation.

One advantage of mincbigaverage is that it avoids issues around the number of possible open files in HDF/netCDF. In short if you have more than 100 files open at once while averaging things will slow down significantly.

mincbigaverage does this via a iterative approach to averaging files and is a direct drop in replacement for mincaverage. That said not all the arguments of mincaverage are supported in mincbigaverage but they should be.

This tool is part of the minc-widgets package:

https://github.com/BIC-MNI/minc-widgets/blob/master/mincbigaverage/mincbigaverage

Examples

>>> from nipype.interfaces.minc import BigAverage
>>> from nipype.interfaces.minc.testdata import nonempty_minc_data
>>> files = [nonempty_minc_data(i) for i in range(3)]
>>> average = BigAverage(input_files=files, output_float=True, robust=True)
>>> average.run() 
Mandatory Inputs:

input_files (a list of items which are a pathlike object or string representing an existing file) – Input file(s). Maps to a command-line argument: %s (position: -2).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • clobber (a boolean) – Overwrite existing file. Maps to a command-line argument: --clobber. (Nipype default value: True)

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • output_file (a pathlike object or string representing a file) – Output file. Maps to a command-line argument: %s (position: -1).

  • output_float (a boolean) – Output files with float precision. Maps to a command-line argument: --float.

  • robust (a boolean) – Perform robust averaging, features that are outside 1 standarddeviation from the mean are downweighted. Works well for noisydata with artifacts. see the –tmpdir option if you have alarge number of input files. Maps to a command-line argument: -robust.

  • sd_file (a pathlike object or string representing a file) – Place standard deviation image in specified file. Maps to a command-line argument: --sdfile %s.

  • tmpdir (a pathlike object or string representing a directory) – Temporary files directory. Maps to a command-line argument: -tmpdir %s.

  • verbose (a boolean) – Print out log messages. Default: False. Maps to a command-line argument: --verbose.

Outputs:
  • output_file (a pathlike object or string representing an existing file) – Output file.

  • sd_file (a pathlike object or string representing an existing file) – Standard deviation image.

Blob

Link to code

Bases: CommandLine

Wrapped executable: mincblob.

Calculate blobs from minc deformation grids.

Examples

>>> from nipype.interfaces.minc import Blob
>>> from nipype.interfaces.minc.testdata import minc2Dfile
>>> blob = Blob(input_file=minc2Dfile, output_file='/tmp/tmp.mnc', trace=True)
>>> blob.run() 
Mandatory Inputs:

input_file (a pathlike object or string representing an existing file) – Input file to blob. Maps to a command-line argument: %s (position: -2).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • determinant (a boolean) – Compute the determinant (exact growth and shrinkage) – SLOW. Maps to a command-line argument: -determinant.

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • magnitude (a boolean) – Compute the magnitude of the displacement vector. Maps to a command-line argument: -magnitude.

  • output_file (a pathlike object or string representing a file) – Output file. Maps to a command-line argument: %s (position: -1).

  • trace (a boolean) – Compute the trace (approximate growth and shrinkage) – FAST. Maps to a command-line argument: -trace.

  • translation (a boolean) – Compute translation (structure displacement). Maps to a command-line argument: -translation.

Outputs:

output_file (a pathlike object or string representing an existing file) – Output file.

Blur

Link to code

Bases: StdOutCommandLine

Wrapped executable: mincblur.

Convolve an input volume with a Gaussian blurring kernel of user-defined width. Optionally, the first partial derivatives and the gradient magnitude volume can be calculated.

Examples

>>> from nipype.interfaces.minc import Blur
>>> from nipype.interfaces.minc.testdata import minc3Dfile

(1) Blur an input volume with a 6mm fwhm isotropic Gaussian blurring kernel:

>>> blur = Blur(input_file=minc3Dfile, fwhm=6, output_file_base='/tmp/out_6')
>>> blur.run() 

mincblur will create /tmp/out_6_blur.mnc.

  1. Calculate the blurred and gradient magnitude data:

>>> blur = Blur(input_file=minc3Dfile, fwhm=6, gradient=True, output_file_base='/tmp/out_6')
>>> blur.run() 

will create /tmp/out_6_blur.mnc and /tmp/out_6_dxyz.mnc.

(3) Calculate the blurred data, the partial derivative volumes and the gradient magnitude for the same data:

>>> blur = Blur(input_file=minc3Dfile, fwhm=6, partial=True, output_file_base='/tmp/out_6')
>>> blur.run() 

will create /tmp/out_6_blur.mnc, /tmp/out_6_dx.mnc, /tmp/out_6_dy.mnc, /tmp/out_6_dz.mnc and /tmp/out_6_dxyz.mnc.

Mandatory Inputs:
  • fwhm (a float) – Full-width-half-maximum of gaussian kernel. Default value: 0. Maps to a command-line argument: -fwhm %s. Mutually exclusive with inputs: fwhm, fwhm3d, standard_dev.

  • fwhm3d (a tuple of the form: (a float, a float, a float)) – Full-width-half-maximum of gaussian kernel.Default value: -1.79769e+308 -1.79769e+308 -1.79769e+308. Maps to a command-line argument: -3dfwhm %s %s %s. Mutually exclusive with inputs: fwhm, fwhm3d, standard_dev.

  • input_file (a pathlike object or string representing an existing file) – Input file. Maps to a command-line argument: %s (position: -2).

  • standard_dev (a float) – Standard deviation of gaussian kernel. Default value: 0. Maps to a command-line argument: -standarddev %s. Mutually exclusive with inputs: fwhm, fwhm3d, standard_dev.

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • clobber (a boolean) – Overwrite existing file. Maps to a command-line argument: -clobber. (Nipype default value: True)

  • dimensions (3 or 1 or 2) – Number of dimensions to blur (either 1,2 or 3). Default value: 3. Maps to a command-line argument: -dimensions %s.

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • gaussian (a boolean) – Use a gaussian smoothing kernel (default). Maps to a command-line argument: -gaussian. Mutually exclusive with inputs: gaussian, rect.

  • gradient (a boolean) – Create the gradient magnitude volume as well. Maps to a command-line argument: -gradient.

  • no_apodize (a boolean) – Do not apodize the data before blurring. Maps to a command-line argument: -no_apodize.

  • output_file_base (a pathlike object or string representing a file) – Output file base. Maps to a command-line argument: %s (position: -1).

  • partial (a boolean) – Create the partial derivative and gradient magnitude volumes as well. Maps to a command-line argument: -partial.

  • rect (a boolean) – Use a rect (box) smoothing kernel. Maps to a command-line argument: -rect. Mutually exclusive with inputs: gaussian, rect.

Outputs:
  • gradient_dxyz (a pathlike object or string representing a file) – Gradient dxyz.

  • output_file (a pathlike object or string representing an existing file) – Blurred output file.

  • partial_dx (a pathlike object or string representing a file) – Partial gradient dx.

  • partial_dxyz (a pathlike object or string representing a file) – Partial gradient dxyz.

  • partial_dy (a pathlike object or string representing a file) – Partial gradient dy.

  • partial_dz (a pathlike object or string representing a file) – Partial gradient dz.

property Blur.cmdline

command plus any arguments (args) validates arguments and generates command line

Calc

Link to code

Bases: CommandLine

Wrapped executable: minccalc.

Compute an expression using MINC files as input.

Examples

>>> from nipype.interfaces.minc import Calc
>>> from nipype.interfaces.minc.testdata import nonempty_minc_data
>>> file0 = nonempty_minc_data(0)
>>> file1 = nonempty_minc_data(1)
>>> calc = Calc(input_files=[file0, file1], output_file='/tmp/calc.mnc', expression='A[0] + A[1]') # add files together
>>> calc.run() 
Mandatory Inputs:
  • expfile (a pathlike object or string representing a file) – Name of file containing expression. Maps to a command-line argument: -expfile %s. Mutually exclusive with inputs: expression, expfile.

  • expression (a string) – Expression to use in calculations. Maps to a command-line argument: -expression '%s'. Mutually exclusive with inputs: expression, expfile.

  • filelist (a pathlike object or string representing a file) – Specify the name of a file containing input file names. Maps to a command-line argument: -filelist %s. Mutually exclusive with inputs: input_files, filelist.

  • input_files (a list of items which are a pathlike object or string representing an existing file) – Input file(s) for calculation. Maps to a command-line argument: %s (position: -2).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • check_dimensions (a boolean) – Check that files have matching dimensions (default). Maps to a command-line argument: -check_dimensions. Mutually exclusive with inputs: check_dimensions, no_check_dimensions.

  • clobber (a boolean) – Overwrite existing file. Maps to a command-line argument: -clobber. (Nipype default value: True)

  • copy_header (a boolean) – Copy all of the header from the first file. Maps to a command-line argument: -copy_header. Mutually exclusive with inputs: copy_header, no_copy_header.

  • debug (a boolean) – Print out debugging messages. Maps to a command-line argument: -debug.

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • eval_width (an integer) – Number of voxels to evaluate simultaneously. Maps to a command-line argument: -eval_width %s.

  • format_byte (a boolean) – Write out byte data. Maps to a command-line argument: -byte. Mutually exclusive with inputs: format_filetype, format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_double (a boolean) – Write out double-precision floating-point data. Maps to a command-line argument: -double. Mutually exclusive with inputs: format_filetype, format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_filetype (a boolean) – Use data type of first file (default). Maps to a command-line argument: -filetype. Mutually exclusive with inputs: format_filetype, format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_float (a boolean) – Write out single-precision floating-point data. Maps to a command-line argument: -float. Mutually exclusive with inputs: format_filetype, format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_int (a boolean) – Write out 32-bit integer data. Maps to a command-line argument: -int. Mutually exclusive with inputs: format_filetype, format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_long (a boolean) – Superseded by -int. Maps to a command-line argument: -long. Mutually exclusive with inputs: format_filetype, format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_short (a boolean) – Write out short integer data. Maps to a command-line argument: -short. Mutually exclusive with inputs: format_filetype, format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_signed (a boolean) – Write signed integer data. Maps to a command-line argument: -signed. Mutually exclusive with inputs: format_filetype, format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_unsigned (a boolean) – Write unsigned integer data (default). Maps to a command-line argument: -unsigned. Mutually exclusive with inputs: format_filetype, format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • ignore_nan (a boolean) – Ignore invalid data (NaN) for accumulations. Maps to a command-line argument: -ignore_nan.

  • max_buffer_size_in_kb (an integer >= 0) – Specify the maximum size of the internal buffers (in kbytes). Maps to a command-line argument: -max_buffer_size_in_kb %d.

  • no_check_dimensions (a boolean) – Do not check that files have matching dimensions. Maps to a command-line argument: -nocheck_dimensions. Mutually exclusive with inputs: check_dimensions, no_check_dimensions.

  • no_copy_header (a boolean) – Do not copy all of the header from the first file. Maps to a command-line argument: -nocopy_header. Mutually exclusive with inputs: copy_header, no_copy_header.

  • outfiles (a list of items which are a tuple of the form: (a string, a pathlike object or string representing a file))

  • output_file (a pathlike object or string representing a file) – Output file. Maps to a command-line argument: %s (position: -1).

  • output_illegal (a boolean) – Value to write out when an illegal operation is done. Default value: 1.79769e+308. Maps to a command-line argument: -illegal_value. Mutually exclusive with inputs: output_nan, output_zero, output_illegal_value.

  • output_nan (a boolean) – Output NaN when an illegal operation is done (default). Maps to a command-line argument: -nan. Mutually exclusive with inputs: output_nan, output_zero, output_illegal_value.

  • output_zero (a boolean) – Output zero when an illegal operation is done. Maps to a command-line argument: -zero. Mutually exclusive with inputs: output_nan, output_zero, output_illegal_value.

  • propagate_nan (a boolean) – Invalid data in any file at a voxel produces a NaN (default). Maps to a command-line argument: -propagate_nan.

  • quiet (a boolean) – Do not print out log messages. Maps to a command-line argument: -quiet. Mutually exclusive with inputs: verbose, quiet.

  • two (a boolean) – Create a MINC 2 output file. Maps to a command-line argument: -2.

  • verbose (a boolean) – Print out log messages (default). Maps to a command-line argument: -verbose. Mutually exclusive with inputs: verbose, quiet.

  • voxel_range (a tuple of the form: (an integer, an integer)) – Valid range for output data. Maps to a command-line argument: -range %d %d.

Outputs:

output_file (a pathlike object or string representing an existing file) – Output file.

Convert

Link to code

Bases: CommandLine

Wrapped executable: mincconvert.

convert between MINC 1 to MINC 2 format.

Examples

>>> from nipype.interfaces.minc import Convert
>>> from nipype.interfaces.minc.testdata import minc2Dfile
>>> c = Convert(input_file=minc2Dfile, output_file='/tmp/out.mnc', two=True) # Convert to MINC2 format.
>>> c.run() 
Mandatory Inputs:

input_file (a pathlike object or string representing an existing file) – Input file for converting. Maps to a command-line argument: %s (position: -2).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • chunk (an integer >= 0) – Set the target block size for chunking (0 default, >1 block size). Maps to a command-line argument: -chunk %d.

  • clobber (a boolean) – Overwrite existing file. Maps to a command-line argument: -clobber. (Nipype default value: True)

  • compression (0 or 1 or 2 or 3 or 4 or 5 or 6 or 7 or 8 or 9) – Set the compression level, from 0 (disabled) to 9 (maximum). Maps to a command-line argument: -compress %s.

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • output_file (a pathlike object or string representing a file) – Output file. Maps to a command-line argument: %s (position: -1).

  • template (a boolean) – Create a template file. The dimensions, variables, andattributes of the input file are preserved but all data it set to zero. Maps to a command-line argument: -template.

  • two (a boolean) – Create a MINC 2 output file. Maps to a command-line argument: -2.

Outputs:

output_file (a pathlike object or string representing an existing file) – Output file.

Copy

Link to code

Bases: CommandLine

Wrapped executable: minccopy.

Copy image values from one MINC file to another. Both the input and output files must exist, and the images in both files must have an equal number dimensions and equal dimension lengths.

NOTE: This program is intended primarily for use with scripts such as mincedit. It does not follow the typical design rules of most MINC command-line tools and therefore should be used only with caution.

Mandatory Inputs:

input_file (a pathlike object or string representing an existing file) – Input file to copy. Maps to a command-line argument: %s (position: -2).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • output_file (a pathlike object or string representing a file) – Output file. Maps to a command-line argument: %s (position: -1).

  • pixel_values (a boolean) – Copy pixel values as is. Maps to a command-line argument: -pixel_values. Mutually exclusive with inputs: pixel_values, real_values.

  • real_values (a boolean) – Copy real pixel intensities (default). Maps to a command-line argument: -real_values. Mutually exclusive with inputs: pixel_values, real_values.

Outputs:

output_file (a pathlike object or string representing an existing file) – Output file.

Dump

Link to code

Bases: StdOutCommandLine

Wrapped executable: mincdump.

Dump a MINC file. Typically used in conjunction with mincgen (see Gen).

Examples

>>> from nipype.interfaces.minc import Dump
>>> from nipype.interfaces.minc.testdata import minc2Dfile
>>> dump = Dump(input_file=minc2Dfile)
>>> dump.run() 
>>> dump = Dump(input_file=minc2Dfile, output_file='/tmp/out.txt', precision=(3, 4))
>>> dump.run() 
Mandatory Inputs:

input_file (a pathlike object or string representing an existing file) – Input file. Maps to a command-line argument: %s (position: -2).

Optional Inputs:
  • annotations_brief (‘c’ or ‘f’) – Brief annotations for C or Fortran indices in data. Maps to a command-line argument: -b %s. Mutually exclusive with inputs: annotations_brief, annotations_full.

  • annotations_full (‘c’ or ‘f’) – Full annotations for C or Fortran indices in data. Maps to a command-line argument: -f %s. Mutually exclusive with inputs: annotations_brief, annotations_full.

  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • coordinate_data (a boolean) – Coordinate variable data and header information. Maps to a command-line argument: -c. Mutually exclusive with inputs: coordinate_data, header_data.

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • header_data (a boolean) – Header information only, no data. Maps to a command-line argument: -h. Mutually exclusive with inputs: coordinate_data, header_data.

  • line_length (an integer >= 0) – Line length maximum in data section (default 80). Maps to a command-line argument: -l %d.

  • netcdf_name (a string) – Name for netCDF (default derived from file name). Maps to a command-line argument: -n %s.

  • out_file (a pathlike object or string representing a file) – Maps to a command-line argument: > %s (position: -1).

  • output_file (a pathlike object or string representing a file) – Output file.

  • precision (an integer or a tuple of the form: (an integer, an integer)) – Display floating-point values with less precision. Maps to a command-line argument: %s.

  • variables (a list of items which are a string) – Output data for specified variables only. Maps to a command-line argument: -v %s.

Outputs:

output_file (a pathlike object or string representing an existing file) – Output file.

Extract

Link to code

Bases: StdOutCommandLine

Wrapped executable: mincextract.

Dump a hyperslab of MINC file data.

Examples

>>> from nipype.interfaces.minc import Extract
>>> from nipype.interfaces.minc.testdata import minc2Dfile
>>> extract = Extract(input_file=minc2Dfile)
>>> extract.run() 
>>> extract = Extract(input_file=minc2Dfile, start=[3, 10, 5], count=[4, 4, 4]) # extract a 4x4x4 slab at offset [3, 10, 5]
>>> extract.run() 
Mandatory Inputs:

input_file (a pathlike object or string representing an existing file) – Input file. Maps to a command-line argument: %s (position: -2).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • count (a list of items which are an integer) – Specifies edge lengths of hyperslab to read. Maps to a command-line argument: -count %s.

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • flip_any_direction (a boolean) – Do not flip images (Default). Maps to a command-line argument: -any_direction. Mutually exclusive with inputs: flip_positive_direction, flip_negative_direction, flip_any_direction.

  • flip_negative_direction (a boolean) – Flip images to always have negative direction. Maps to a command-line argument: -negative_direction. Mutually exclusive with inputs: flip_positive_direction, flip_negative_direction, flip_any_direction.

  • flip_positive_direction (a boolean) – Flip images to always have positive direction. Maps to a command-line argument: -positive_direction. Mutually exclusive with inputs: flip_positive_direction, flip_negative_direction, flip_any_direction.

  • flip_x_any (a boolean) – Don’t flip images along x-axis (default). Maps to a command-line argument: -xanydirection. Mutually exclusive with inputs: flip_x_positive, flip_x_negative, flip_x_any.

  • flip_x_negative (a boolean) – Flip images to give negative xspace:step value (right-to-left). Maps to a command-line argument: -xdirection. Mutually exclusive with inputs: flip_x_positive, flip_x_negative, flip_x_any.

  • flip_x_positive (a boolean) – Flip images to give positive xspace:step value (left-to-right). Maps to a command-line argument: +xdirection. Mutually exclusive with inputs: flip_x_positive, flip_x_negative, flip_x_any.

  • flip_y_any (a boolean) – Don’t flip images along y-axis (default). Maps to a command-line argument: -yanydirection. Mutually exclusive with inputs: flip_y_positive, flip_y_negative, flip_y_any.

  • flip_y_negative (a boolean) – Flip images to give negative yspace:step value (ant-to-post). Maps to a command-line argument: -ydirection. Mutually exclusive with inputs: flip_y_positive, flip_y_negative, flip_y_any.

  • flip_y_positive (a boolean) – Flip images to give positive yspace:step value (post-to-ant). Maps to a command-line argument: +ydirection. Mutually exclusive with inputs: flip_y_positive, flip_y_negative, flip_y_any.

  • flip_z_any (a boolean) – Don’t flip images along z-axis (default). Maps to a command-line argument: -zanydirection. Mutually exclusive with inputs: flip_z_positive, flip_z_negative, flip_z_any.

  • flip_z_negative (a boolean) – Flip images to give negative zspace:step value (sup-to-inf). Maps to a command-line argument: -zdirection. Mutually exclusive with inputs: flip_z_positive, flip_z_negative, flip_z_any.

  • flip_z_positive (a boolean) – Flip images to give positive zspace:step value (inf-to-sup). Maps to a command-line argument: +zdirection. Mutually exclusive with inputs: flip_z_positive, flip_z_negative, flip_z_any.

  • image_maximum (a float) – Specify the maximum real image value for normalization.Default value: 1.79769e+308. Maps to a command-line argument: -image_maximum %s.

  • image_minimum (a float) – Specify the minimum real image value for normalization.Default value: 1.79769e+308. Maps to a command-line argument: -image_minimum %s.

  • image_range (a tuple of the form: (a float, a float)) – Specify the range of real image values for normalization. Maps to a command-line argument: -image_range %s %s.

  • nonormalize (a boolean) – Turn off pixel normalization. Maps to a command-line argument: -nonormalize. Mutually exclusive with inputs: normalize, nonormalize.

  • normalize (a boolean) – Normalize integer pixel values to file max and min. Maps to a command-line argument: -normalize. Mutually exclusive with inputs: normalize, nonormalize.

  • out_file (a pathlike object or string representing a file) – Maps to a command-line argument: > %s (position: -1).

  • output_file (a pathlike object or string representing a file) – Output file.

  • start (a list of items which are an integer) – Specifies corner of hyperslab (C conventions for indices). Maps to a command-line argument: -start %s.

  • write_ascii (a boolean) – Write out data as ascii strings (default). Maps to a command-line argument: -ascii. Mutually exclusive with inputs: write_ascii, write_ascii, write_byte, write_short, write_int, write_long, write_float, write_double, write_signed, write_unsigned.

  • write_byte (a boolean) – Write out data as bytes. Maps to a command-line argument: -byte. Mutually exclusive with inputs: write_ascii, write_ascii, write_byte, write_short, write_int, write_long, write_float, write_double, write_signed, write_unsigned.

  • write_double (a boolean) – Write out data as double precision floating-point values. Maps to a command-line argument: -double. Mutually exclusive with inputs: write_ascii, write_ascii, write_byte, write_short, write_int, write_long, write_float, write_double, write_signed, write_unsigned.

  • write_float (a boolean) – Write out data as single precision floating-point values. Maps to a command-line argument: -float. Mutually exclusive with inputs: write_ascii, write_ascii, write_byte, write_short, write_int, write_long, write_float, write_double, write_signed, write_unsigned.

  • write_int (a boolean) – Write out data as 32-bit integers. Maps to a command-line argument: -int. Mutually exclusive with inputs: write_ascii, write_ascii, write_byte, write_short, write_int, write_long, write_float, write_double, write_signed, write_unsigned.

  • write_long (a boolean) – Superseded by write_int. Maps to a command-line argument: -long. Mutually exclusive with inputs: write_ascii, write_ascii, write_byte, write_short, write_int, write_long, write_float, write_double, write_signed, write_unsigned.

  • write_range (a tuple of the form: (a float, a float)) – Specify the range of output values Default value: 1.79769e+308 1.79769e+308. Maps to a command-line argument: -range %s %s.

  • write_short (a boolean) – Write out data as short integers. Maps to a command-line argument: -short. Mutually exclusive with inputs: write_ascii, write_ascii, write_byte, write_short, write_int, write_long, write_float, write_double, write_signed, write_unsigned.

  • write_signed (a boolean) – Write out signed data. Maps to a command-line argument: -signed. Mutually exclusive with inputs: write_signed, write_unsigned.

  • write_unsigned (a boolean) – Write out unsigned data. Maps to a command-line argument: -unsigned. Mutually exclusive with inputs: write_signed, write_unsigned.

Outputs:

output_file (a pathlike object or string representing an existing file) – Output file in raw/text format.

Gennlxfm

Link to code

Bases: CommandLine

Wrapped executable: gennlxfm.

Generate nonlinear xfms. Currently only identity xfms are supported!

This tool is part of minc-widgets:

https://github.com/BIC-MNI/minc-widgets/blob/master/gennlxfm/gennlxfm

Examples

>>> from nipype.interfaces.minc import Gennlxfm
>>> from nipype.interfaces.minc.testdata import minc2Dfile
>>> gennlxfm = Gennlxfm(step=1, like=minc2Dfile)
>>> gennlxfm.run() 
Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • clobber (a boolean) – Overwrite existing file. Maps to a command-line argument: -clobber. (Nipype default value: True)

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • ident (a boolean) – Generate an identity xfm. Default: False. Maps to a command-line argument: -ident.

  • like (a pathlike object or string representing an existing file) – Generate a nlxfm like this file. Maps to a command-line argument: -like %s.

  • output_file (a pathlike object or string representing a file) – Output file. Maps to a command-line argument: %s (position: -1).

  • step (an integer) – Output ident xfm step [default: 1]. Maps to a command-line argument: -step %s.

  • verbose (a boolean) – Print out log messages. Default: False. Maps to a command-line argument: -verbose.

Outputs:
  • output_file (a pathlike object or string representing an existing file) – Output file.

  • output_grid (a pathlike object or string representing an existing file) – Output grid.

Math

Link to code

Bases: StdOutCommandLine

Wrapped executable: mincmath.

Various mathematical operations supplied by mincmath.

Examples

>>> from nipype.interfaces.minc import Math
>>> from nipype.interfaces.minc.testdata import minc2Dfile

Scale: volume*3.0 + 2:

>>> scale = Math(input_files=[minc2Dfile], scale=(3.0, 2))
>>> scale.run() 

Test if >= 1.5:

>>> gt = Math(input_files=[minc2Dfile], test_gt=1.5)
>>> gt.run() 
Mandatory Inputs:
  • filelist (a pathlike object or string representing an existing file) – Specify the name of a file containing input file names. Maps to a command-line argument: -filelist %s. Mutually exclusive with inputs: input_files, filelist.

  • input_files (a list of items which are a pathlike object or string representing an existing file) – Input file(s) for calculation. Maps to a command-line argument: %s (position: -2). Mutually exclusive with inputs: input_files, filelist.

Optional Inputs:
  • abs (a boolean) – Take absolute value of a volume. Maps to a command-line argument: -abs.

  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • calc_add (a boolean or a float) – Add N volumes or volume + constant. Maps to a command-line argument: -add.

  • calc_and (a boolean) – Calculate vol1 && vol2 (&& …). Maps to a command-line argument: -and.

  • calc_div (a boolean or a float) – Divide 2 volumes or volume / constant. Maps to a command-line argument: -div.

  • calc_mul (a boolean or a float) – Multiply N volumes or volume * constant. Maps to a command-line argument: -mult.

  • calc_not (a boolean) – Calculate !vol1. Maps to a command-line argument: -not.

  • calc_or (a boolean) – Calculate vol1 || vol2 (|| …). Maps to a command-line argument: -or.

  • calc_sub (a boolean or a float) – Subtract 2 volumes or volume - constant. Maps to a command-line argument: -sub.

  • check_dimensions (a boolean) – Check that dimension info matches across files (default). Maps to a command-line argument: -check_dimensions. Mutually exclusive with inputs: check_dimensions, no_check_dimensions.

  • clamp (a tuple of the form: (a float, a float)) – Clamp a volume to lie between two values. Maps to a command-line argument: -clamp -const2 %s %s.

  • clobber (a boolean) – Overwrite existing file. Maps to a command-line argument: -clobber. (Nipype default value: True)

  • copy_header (a boolean) – Copy all of the header from the first file (default for one file). Maps to a command-line argument: -copy_header. Mutually exclusive with inputs: copy_header, no_copy_header.

  • count_valid (a boolean) – Count the number of valid values in N volumes. Maps to a command-line argument: -count_valid.

  • dimension (a string) – Specify a dimension along which we wish to perform a calculation. Maps to a command-line argument: -dimension %s.

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • exp (a tuple of the form: (a float, a float)) – Calculate c2*exp(c1*x). Both constants must be specified. Maps to a command-line argument: -exp -const2 %s %s.

  • format_byte (a boolean) – Write out byte data. Maps to a command-line argument: -byte. Mutually exclusive with inputs: format_filetype, format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_double (a boolean) – Write out double-precision floating-point data. Maps to a command-line argument: -double. Mutually exclusive with inputs: format_filetype, format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_filetype (a boolean) – Use data type of first file (default). Maps to a command-line argument: -filetype. Mutually exclusive with inputs: format_filetype, format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_float (a boolean) – Write out single-precision floating-point data. Maps to a command-line argument: -float. Mutually exclusive with inputs: format_filetype, format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_int (a boolean) – Write out 32-bit integer data. Maps to a command-line argument: -int. Mutually exclusive with inputs: format_filetype, format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_long (a boolean) – Superseded by -int. Maps to a command-line argument: -long. Mutually exclusive with inputs: format_filetype, format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_short (a boolean) – Write out short integer data. Maps to a command-line argument: -short. Mutually exclusive with inputs: format_filetype, format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_signed (a boolean) – Write signed integer data. Maps to a command-line argument: -signed. Mutually exclusive with inputs: format_filetype, format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_unsigned (a boolean) – Write unsigned integer data (default). Maps to a command-line argument: -unsigned. Mutually exclusive with inputs: format_filetype, format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • ignore_nan (a boolean) – Ignore invalid data (NaN) for accumulations. Maps to a command-line argument: -ignore_nan.

  • invert (a float) – Calculate 1/c. Maps to a command-line argument: -invert -const %s.

  • isnan (a boolean) – Test for NaN values in vol1. Maps to a command-line argument: -isnan.

  • log (a tuple of the form: (a float, a float)) – Calculate log(x/c2)/c1. The constants c1 and c2 default to 1. Maps to a command-line argument: -log -const2 %s %s.

  • max_buffer_size_in_kb (an integer >= 0) – Specify the maximum size of the internal buffers (in kbytes). Maps to a command-line argument: -max_buffer_size_in_kb %d. (Nipype default value: 4096)

  • maximum (a boolean) – Find maximum of N volumes. Maps to a command-line argument: -maximum.

  • minimum (a boolean) – Find minimum of N volumes. Maps to a command-line argument: -minimum.

  • nisnan (a boolean) – Negation of -isnan. Maps to a command-line argument: -nisnan.

  • no_check_dimensions (a boolean) – Do not check dimension info. Maps to a command-line argument: -nocheck_dimensions. Mutually exclusive with inputs: check_dimensions, no_check_dimensions.

  • no_copy_header (a boolean) – Do not copy all of the header from the first file (default for many files)). Maps to a command-line argument: -nocopy_header. Mutually exclusive with inputs: copy_header, no_copy_header.

  • nsegment (a tuple of the form: (a float, a float)) – Opposite of -segment: within range = 0, outside range = 1. Maps to a command-line argument: -nsegment -const2 %s %s.

  • output_file (a pathlike object or string representing a file) – Output file. Maps to a command-line argument: %s (position: -1).

  • output_illegal (a boolean) – Value to write out when an illegal operationis done. Default value: 1.79769e+308. Maps to a command-line argument: -illegal_value. Mutually exclusive with inputs: output_nan, output_zero, output_illegal_value.

  • output_nan (a boolean) – Output NaN when an illegal operation is done (default). Maps to a command-line argument: -nan. Mutually exclusive with inputs: output_nan, output_zero, output_illegal_value.

  • output_zero (a boolean) – Output zero when an illegal operation is done. Maps to a command-line argument: -zero. Mutually exclusive with inputs: output_nan, output_zero, output_illegal_value.

  • percentdiff (a float) – Percent difference between 2 volumes, thresholded (const def=0.0). Maps to a command-line argument: -percentdiff.

  • propagate_nan (a boolean) – Invalid data in any file at a voxel produces a NaN (default). Maps to a command-line argument: -propagate_nan.

  • scale (a tuple of the form: (a float, a float)) – Scale a volume: volume * c1 + c2. Maps to a command-line argument: -scale -const2 %s %s.

  • segment (a tuple of the form: (a float, a float)) – Segment a volume using range of -const2: within range = 1, outside range = 0. Maps to a command-line argument: -segment -const2 %s %s.

  • sqrt (a boolean) – Take square root of a volume. Maps to a command-line argument: -sqrt.

  • square (a boolean) – Take square of a volume. Maps to a command-line argument: -square.

  • test_eq (a boolean or a float) – Test for integer vol1 == vol2 or vol1 == constant. Maps to a command-line argument: -eq.

  • test_ge (a boolean or a float) – Test for vol1 >= vol2 or vol1 >= const. Maps to a command-line argument: -ge.

  • test_gt (a boolean or a float) – Test for vol1 > vol2 or vol1 > constant. Maps to a command-line argument: -gt.

  • test_le (a boolean or a float) – Test for vol1 <= vol2 or vol1 <= const. Maps to a command-line argument: -le.

  • test_lt (a boolean or a float) – Test for vol1 < vol2 or vol1 < constant. Maps to a command-line argument: -lt.

  • test_ne (a boolean or a float) – Test for integer vol1 != vol2 or vol1 != const. Maps to a command-line argument: -ne.

  • two (a boolean) – Create a MINC 2 output file. Maps to a command-line argument: -2.

  • voxel_range (a tuple of the form: (an integer, an integer)) – Valid range for output data. Maps to a command-line argument: -range %d %d.

Outputs:

output_file (a pathlike object or string representing an existing file) – Output file.

NlpFit

Link to code

Bases: CommandLine

Wrapped executable: nlpfit.

Hierarchial non-linear fitting with bluring.

This tool is part of the minc-widgets package:

https://github.com/BIC-MNI/minc-widgets/blob/master/nlpfit/nlpfit

Examples

>>> from nipype.interfaces.minc import NlpFit
>>> from nipype.interfaces.minc.testdata import nonempty_minc_data, nlp_config
>>> from nipype.testing import example_data
>>> source = nonempty_minc_data(0)
>>> target = nonempty_minc_data(1)
>>> source_mask = nonempty_minc_data(2)
>>> config = nlp_config
>>> initial = example_data('minc_initial.xfm')
>>> nlpfit = NlpFit(config_file=config, init_xfm=initial, source_mask=source_mask, source=source, target=target)
>>> nlpfit.run() 
Mandatory Inputs:
  • config_file (a pathlike object or string representing an existing file) – File containing the fitting configuration use. Maps to a command-line argument: -config_file %s.

  • init_xfm (a pathlike object or string representing an existing file) – Initial transformation (default identity). Maps to a command-line argument: -init_xfm %s.

  • source (a pathlike object or string representing an existing file) – Source Minc file. Maps to a command-line argument: %s (position: -3).

  • source_mask (a pathlike object or string representing an existing file) – Source mask to use during fitting. Maps to a command-line argument: -source_mask %s.

  • target (a pathlike object or string representing an existing file) – Target Minc file. Maps to a command-line argument: %s (position: -2).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • clobber (a boolean) – Overwrite existing file. Maps to a command-line argument: -clobber. (Nipype default value: True)

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • input_grid_files (a list of items which are a pathlike object or string representing a file) – Input grid file(s).

  • output_xfm (a pathlike object or string representing a file) – Output xfm file. Maps to a command-line argument: %s (position: -1).

  • verbose (a boolean) – Print out log messages. Default: False. Maps to a command-line argument: -verbose.

Outputs:
  • output_grid (a pathlike object or string representing an existing file) – Output grid file.

  • output_xfm (a pathlike object or string representing an existing file) – Output xfm file.

Norm

Link to code

Bases: CommandLine

Wrapped executable: mincnorm.

Normalise a file between a max and minimum (possibly)

using two histogram pct’s.

Examples

>>> from nipype.interfaces.minc import Norm
>>> from nipype.interfaces.minc.testdata import minc2Dfile
>>> n = Norm(input_file=minc2Dfile, output_file='/tmp/out.mnc') # Normalise the file.
>>> n.run() 
Mandatory Inputs:

input_file (a pathlike object or string representing an existing file) – Input file to normalise. Maps to a command-line argument: %s (position: -2).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • clamp (a boolean) – Force the output range between limits [default]. Maps to a command-line argument: -clamp. (Nipype default value: True)

  • clobber (a boolean) – Overwrite existing file. Maps to a command-line argument: -clobber. (Nipype default value: True)

  • cutoff (0.0 <= a floating point number <= 100.0) – Cutoff value to use to calculate thresholds by a histogram PcT in %. [default: 0.01]. Maps to a command-line argument: -cutoff %s.

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • lower (a float) – Lower real value to use. Maps to a command-line argument: -lower %s.

  • mask (a pathlike object or string representing an existing file) – Calculate the image normalisation within a mask. Maps to a command-line argument: -mask %s.

  • out_ceil (a float) – Output files minimum [default: 100]. Maps to a command-line argument: -out_ceil %s.

  • out_floor (a float) – Output files maximum [default: 0]. Maps to a command-line argument: -out_floor %s.

  • output_file (a pathlike object or string representing a file) – Output file. Maps to a command-line argument: %s (position: -1).

  • output_threshold_mask (a pathlike object or string representing a file) – File in which to store the threshold mask. Maps to a command-line argument: -threshold_mask %s.

  • threshold (a boolean) – Threshold the image (set values below threshold_perc to -out_floor). Maps to a command-line argument: -threshold.

  • threshold_blur (a float) – Blur FWHM for intensity edges then thresholding [default: 2]. Maps to a command-line argument: -threshold_blur %s.

  • threshold_bmt (a boolean) – Use the resulting image BiModalT as the threshold. Maps to a command-line argument: -threshold_bmt.

  • threshold_perc (0.0 <= a floating point number <= 100.0) – Threshold percentage (0.1 == lower 10% of intensity range) [default: 0.1]. Maps to a command-line argument: -threshold_perc %s.

  • upper (a float) – Upper real value to use. Maps to a command-line argument: -upper %s.

Outputs:
  • output_file (a pathlike object or string representing an existing file) – Output file.

  • output_threshold_mask (a pathlike object or string representing a file) – Threshold mask file.

Pik

Link to code

Bases: CommandLine

Wrapped executable: mincpik.

Generate images from minc files.

Mincpik uses Imagemagick to generate images from Minc files.

Examples

>>> from nipype.interfaces.minc import Pik
>>> from nipype.interfaces.minc.testdata import nonempty_minc_data
>>> file0 = nonempty_minc_data(0)
>>> pik = Pik(input_file=file0, title='foo')
>>> pik .run() 
Mandatory Inputs:

input_file (a pathlike object or string representing an existing file) – Input file. Maps to a command-line argument: %s (position: -2).

Optional Inputs:
  • annotated_bar (a boolean) – Create an annotated bar to match the image (use height of the output image). Maps to a command-line argument: --anot_bar.

  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • auto_range (a boolean) – Automatically determine image range using a 5 and 95% PcT. (histogram). Maps to a command-line argument: --auto_range. Mutually exclusive with inputs: image_range, auto_range.

  • clobber (a boolean) – Overwrite existing file. Maps to a command-line argument: -clobber. (Nipype default value: True)

  • depth (8 or 16) – Bitdepth for resulting image 8 or 16 (MSB machines only!). Maps to a command-line argument: --depth %s.

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • horizontal_triplanar_view (a boolean) – Create a horizontal triplanar view. Maps to a command-line argument: --horizontal. Mutually exclusive with inputs: vertical_triplanar_view, horizontal_triplanar_view.

  • image_range (a tuple of the form: (a float, a float)) – Range of image values to use for pixel intensity. Maps to a command-line argument: --image_range %s %s. Mutually exclusive with inputs: image_range, auto_range.

  • jpg (a boolean) – Output a jpg file. Mutually exclusive with inputs: jpg, png.

  • lookup (a string) – Arguments to pass to minclookup. Maps to a command-line argument: --lookup %s.

  • minc_range (a tuple of the form: (a float, a float)) – Valid range of values for MINC file. Maps to a command-line argument: --range %s %s.

  • output_file (a pathlike object or string representing a file) – Output file. Maps to a command-line argument: %s (position: -1).

  • png (a boolean) – Output a png file (default). Mutually exclusive with inputs: jpg, png.

  • sagittal_offset (an integer) – Offset the sagittal slice from the centre. Maps to a command-line argument: --sagittal_offset %s.

  • sagittal_offset_perc (0 <= an integer <= 100) – Offset the sagittal slice by a percentage from the centre. Maps to a command-line argument: --sagittal_offset_perc %d.

  • scale (an integer) – Scaling factor for resulting image. By default images areoutput at twice their original resolution. Maps to a command-line argument: --scale %s. (Nipype default value: 2)

  • slice_x (a boolean) – Get a sagittal (x) slice. Maps to a command-line argument: -x. Mutually exclusive with inputs: slice_z, slice_y, slice_x.

  • slice_y (a boolean) – Get a coronal (y) slice. Maps to a command-line argument: -y. Mutually exclusive with inputs: slice_z, slice_y, slice_x.

  • slice_z (a boolean) – Get an axial/transverse (z) slice. Maps to a command-line argument: -z. Mutually exclusive with inputs: slice_z, slice_y, slice_x.

  • start (an integer) – Slice number to get. (note this is in voxel coordinates). Maps to a command-line argument: --slice %s.

  • tile_size (an integer) – Pixel size for each image in a triplanar. Maps to a command-line argument: --tilesize %s.

  • title (a boolean or a string) – Maps to a command-line argument: %s.

  • title_size (an integer) – Font point size for the title. Maps to a command-line argument: --title_size %s. Requires inputs: title.

  • triplanar (a boolean) – Create a triplanar view of the input file. Maps to a command-line argument: --triplanar.

  • vertical_triplanar_view (a boolean) – Create a vertical triplanar view (Default). Maps to a command-line argument: --vertical. Mutually exclusive with inputs: vertical_triplanar_view, horizontal_triplanar_view.

  • width (an integer) – Autoscale the resulting image to have a fixed image width (in pixels). Maps to a command-line argument: --width %s.

Outputs:

output_file (a pathlike object or string representing an existing file) – Output image.

Resample

Link to code

Bases: StdOutCommandLine

Wrapped executable: mincresample.

Resample a minc file.’

Examples

>>> from nipype.interfaces.minc import Resample
>>> from nipype.interfaces.minc.testdata import minc2Dfile
>>> r = Resample(input_file=minc2Dfile, output_file='/tmp/out.mnc') # Resample the file.
>>> r.run() 
Mandatory Inputs:

input_file (a pathlike object or string representing an existing file) – Input file for resampling. Maps to a command-line argument: %s (position: -2).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • clobber (a boolean) – Overwrite existing file. Maps to a command-line argument: -clobber. (Nipype default value: True)

  • coronal_slices (a boolean) – Write out coronal slices. Maps to a command-line argument: -coronal. Mutually exclusive with inputs: transverse, sagittal, coronal.

  • dircos (a tuple of the form: (a float, a float, a float)) – Direction cosines along each dimension (X, Y, Z). Default value:1.79769e+308 1.79769e+308 1.79769e+308 1.79769e+308 … 1.79769e+308 1.79769e+308 1.79769e+308 1.79769e+308 1.79769e+308. Maps to a command-line argument: -dircos %s %s %s. Mutually exclusive with inputs: nelements, nelements_x_y_or_z.

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • fill (a boolean) – Use a fill value for points outside of input volume. Maps to a command-line argument: -fill. Mutually exclusive with inputs: nofill, fill.

  • fill_value (a float) – Specify a fill value for points outside of input volume.Default value: 1.79769e+308. Maps to a command-line argument: -fillvalue %s. Requires inputs: fill.

  • format_byte (a boolean) – Write out byte data. Maps to a command-line argument: -byte. Mutually exclusive with inputs: format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_double (a boolean) – Write out double-precision floating-point data. Maps to a command-line argument: -double. Mutually exclusive with inputs: format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_float (a boolean) – Write out single-precision floating-point data. Maps to a command-line argument: -float. Mutually exclusive with inputs: format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_int (a boolean) – Write out 32-bit integer data. Maps to a command-line argument: -int. Mutually exclusive with inputs: format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_long (a boolean) – Superseded by -int. Maps to a command-line argument: -long. Mutually exclusive with inputs: format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_short (a boolean) – Write out short integer data. Maps to a command-line argument: -short. Mutually exclusive with inputs: format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_signed (a boolean) – Write signed integer data. Maps to a command-line argument: -signed. Mutually exclusive with inputs: format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • format_unsigned (a boolean) – Write unsigned integer data (default). Maps to a command-line argument: -unsigned. Mutually exclusive with inputs: format_byte, format_short, format_int, format_long, format_float, format_double, format_signed, format_unsigned.

  • half_width_sinc_window (5 or 1 or 2 or 3 or 4 or 6 or 7 or 8 or 9 or 10) – Set half-width of sinc window (1-10). Default value: 5. Maps to a command-line argument: -width %s. Requires inputs: sinc_interpolation.

  • input_grid_files (a list of items which are a pathlike object or string representing a file) – Input grid file(s).

  • invert_transformation (a boolean) – Invert the transformation before using it. Maps to a command-line argument: -invert_transformation.

  • keep_real_range (a boolean) – Keep the real scale of the input volume. Maps to a command-line argument: -keep_real_range. Mutually exclusive with inputs: keep_real_range, nokeep_real_range.

  • like (a pathlike object or string representing an existing file) – Specifies a model file for the resampling. Maps to a command-line argument: -like %s.

  • nearest_neighbour_interpolation (a boolean) – Do nearest neighbour interpolation. Maps to a command-line argument: -nearest_neighbour. Mutually exclusive with inputs: trilinear_interpolation, tricubic_interpolation, nearest_neighbour_interpolation, sinc_interpolation.

  • nelements (a tuple of the form: (an integer, an integer, an integer)) – Number of elements along each dimension (X, Y, Z). Maps to a command-line argument: -nelements %s %s %s. Mutually exclusive with inputs: nelements, nelements_x_y_or_z.

  • no_fill (a boolean) – Use value zero for points outside of input volume. Maps to a command-line argument: -nofill. Mutually exclusive with inputs: nofill, fill.

  • no_input_sampling (a boolean) – Use the input sampling without transforming (old behaviour). Maps to a command-line argument: -use_input_sampling. Mutually exclusive with inputs: vio_transform, no_input_sampling.

  • nokeep_real_range (a boolean) – Do not keep the real scale of the data (default). Maps to a command-line argument: -nokeep_real_range. Mutually exclusive with inputs: keep_real_range, nokeep_real_range.

  • origin (a tuple of the form: (a float, a float, a float)) – Origin of first pixel in 3D space.Default value: 1.79769e+308 1.79769e+308 1.79769e+308. Maps to a command-line argument: -origin %s %s %s.

  • output_file (a pathlike object or string representing a file) – Output file. Maps to a command-line argument: %s (position: -1).

  • output_range (a tuple of the form: (a float, a float)) – Valid range for output data. Default value: -1.79769e+308 -1.79769e+308. Maps to a command-line argument: -range %s %s.

  • sagittal_slices (a boolean) – Write out sagittal slices. Maps to a command-line argument: -sagittal. Mutually exclusive with inputs: transverse, sagittal, coronal.

  • sinc_interpolation (a boolean) – Do windowed sinc interpolation. Maps to a command-line argument: -sinc. Mutually exclusive with inputs: trilinear_interpolation, tricubic_interpolation, nearest_neighbour_interpolation, sinc_interpolation.

  • sinc_window_hamming (a boolean) – Set sinc window type to Hamming. Maps to a command-line argument: -hamming. Mutually exclusive with inputs: sinc_window_hanning, sinc_window_hamming. Requires inputs: sinc_interpolation.

  • sinc_window_hanning (a boolean) – Set sinc window type to Hanning. Maps to a command-line argument: -hanning. Mutually exclusive with inputs: sinc_window_hanning, sinc_window_hamming. Requires inputs: sinc_interpolation.

  • spacetype (a string) – Set the spacetype attribute to a specified string. Maps to a command-line argument: -spacetype %s.

  • standard_sampling (a boolean) – Set the sampling to standard values (step, start and dircos). Maps to a command-line argument: -standard_sampling.

  • start (a tuple of the form: (a float, a float, a float)) – Start point along each dimension (X, Y, Z).Default value: 1.79769e+308 1.79769e+308 1.79769e+308. Maps to a command-line argument: -start %s %s %s. Mutually exclusive with inputs: nelements, nelements_x_y_or_z.

  • step (a tuple of the form: (an integer, an integer, an integer)) – Step size along each dimension (X, Y, Z). Default value: (0, 0, 0). Maps to a command-line argument: -step %s %s %s. Mutually exclusive with inputs: nelements, nelements_x_y_or_z.

  • talairach (a boolean) – Output is in Talairach space. Maps to a command-line argument: -talairach.

  • transformation (a pathlike object or string representing an existing file) – File giving world transformation. (Default = identity). Maps to a command-line argument: -transformation %s.

  • transverse_slices (a boolean) – Write out transverse slices. Maps to a command-line argument: -transverse. Mutually exclusive with inputs: transverse, sagittal, coronal.

  • tricubic_interpolation (a boolean) – Do tricubic interpolation. Maps to a command-line argument: -tricubic. Mutually exclusive with inputs: trilinear_interpolation, tricubic_interpolation, nearest_neighbour_interpolation, sinc_interpolation.

  • trilinear_interpolation (a boolean) – Do trilinear interpolation. Maps to a command-line argument: -trilinear. Mutually exclusive with inputs: trilinear_interpolation, tricubic_interpolation, nearest_neighbour_interpolation, sinc_interpolation.

  • two (a boolean) – Create a MINC 2 output file. Maps to a command-line argument: -2.

  • units (a string) – Specify the units of the output sampling. Maps to a command-line argument: -units %s.

  • vio_transform (a boolean) – VIO_Transform the input sampling with the transform (default). Maps to a command-line argument: -tfm_input_sampling. Mutually exclusive with inputs: vio_transform, no_input_sampling.

  • xdircos (a float) – Direction cosines along the X dimension.Default value: 1.79769e+308 1.79769e+308 1.79769e+308. Maps to a command-line argument: -xdircos %s. Mutually exclusive with inputs: dircos, dircos_x_y_or_z. Requires inputs: ydircos, zdircos.

  • xnelements (an integer) – Number of elements along the X dimension. Maps to a command-line argument: -xnelements %s. Mutually exclusive with inputs: nelements, nelements_x_y_or_z. Requires inputs: ynelements, znelements.

  • xstart (a float) – Start point along the X dimension. Default value: 1.79769e+308. Maps to a command-line argument: -xstart %s. Mutually exclusive with inputs: start, start_x_y_or_z. Requires inputs: ystart, zstart.

  • xstep (an integer) – Step size along the X dimension. Default value: 0. Maps to a command-line argument: -xstep %s. Mutually exclusive with inputs: step, step_x_y_or_z. Requires inputs: ystep, zstep.

  • ydircos (a float) – Direction cosines along the Y dimension.Default value: 1.79769e+308 1.79769e+308 1.79769e+308. Maps to a command-line argument: -ydircos %s. Mutually exclusive with inputs: dircos, dircos_x_y_or_z. Requires inputs: xdircos, zdircos.

  • ynelements (an integer) – Number of elements along the Y dimension. Maps to a command-line argument: -ynelements %s. Mutually exclusive with inputs: nelements, nelements_x_y_or_z. Requires inputs: xnelements, znelements.

  • ystart (a float) – Start point along the Y dimension. Default value: 1.79769e+308. Maps to a command-line argument: -ystart %s. Mutually exclusive with inputs: start, start_x_y_or_z. Requires inputs: xstart, zstart.

  • ystep (an integer) – Step size along the Y dimension. Default value: 0. Maps to a command-line argument: -ystep %s. Mutually exclusive with inputs: step, step_x_y_or_z. Requires inputs: xstep, zstep.

  • zdircos (a float) – Direction cosines along the Z dimension.Default value: 1.79769e+308 1.79769e+308 1.79769e+308. Maps to a command-line argument: -zdircos %s. Mutually exclusive with inputs: dircos, dircos_x_y_or_z. Requires inputs: xdircos, ydircos.

  • znelements (an integer) – Number of elements along the Z dimension. Maps to a command-line argument: -znelements %s. Mutually exclusive with inputs: nelements, nelements_x_y_or_z. Requires inputs: xnelements, ynelements.

  • zstart (a float) – Start point along the Z dimension. Default value: 1.79769e+308. Maps to a command-line argument: -zstart %s. Mutually exclusive with inputs: start, start_x_y_or_z. Requires inputs: xstart, ystart.

  • zstep (an integer) – Step size along the Z dimension. Default value: 0. Maps to a command-line argument: -zstep %s. Mutually exclusive with inputs: step, step_x_y_or_z. Requires inputs: xstep, ystep.

Outputs:

output_file (a pathlike object or string representing an existing file) – Output file.

Reshape

Link to code

Bases: CommandLine

Wrapped executable: mincreshape.

Cut a hyperslab out of a minc file, with dimension reordering.

This is also useful for rewriting with a different format, for example converting to short (see example below).

Examples

>>> from nipype.interfaces.minc import Reshape
>>> from nipype.interfaces.minc.testdata import nonempty_minc_data
>>> input_file = nonempty_minc_data(0)
>>> reshape_to_short = Reshape(input_file=input_file, write_short=True)
>>> reshape_to_short.run() 
Mandatory Inputs:

input_file (a pathlike object or string representing an existing file) – Input file. Maps to a command-line argument: %s (position: -2).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • clobber (a boolean) – Overwrite existing file. Maps to a command-line argument: -clobber. (Nipype default value: True)

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • output_file (a pathlike object or string representing a file) – Output file. Maps to a command-line argument: %s (position: -1).

  • verbose (a boolean) – Print out log messages. Default: False. Maps to a command-line argument: -verbose.

  • write_short (a boolean) – Convert to short integer data. Maps to a command-line argument: -short.

Outputs:

output_file (a pathlike object or string representing an existing file) – Output file.

ToEcat

Link to code

Bases: CommandLine

Wrapped executable: minctoecat.

Convert a 2D image, a 3D volumes or a 4D dynamic volumes written in MINC file format to a 2D, 3D or 4D Ecat7 file.

Examples

>>> from nipype.interfaces.minc import ToEcat
>>> from nipype.interfaces.minc.testdata import minc2Dfile
>>> c = ToEcat(input_file=minc2Dfile)
>>> c.run() 
>>> c = ToEcat(input_file=minc2Dfile, voxels_as_integers=True)
>>> c.run() 
Mandatory Inputs:

input_file (a pathlike object or string representing an existing file) – Input file to convert. Maps to a command-line argument: %s (position: -2).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • ignore_acquisition_variable (a boolean) – Ignore information from the minc acquisition variable. Maps to a command-line argument: -ignore_acquisition_variable.

  • ignore_ecat_acquisition_variable (a boolean) – Ignore information from the minc ecat_acquisition variable. Maps to a command-line argument: -ignore_ecat_acquisition_variable.

  • ignore_ecat_main (a boolean) – Ignore information from the minc ecat-main variable. Maps to a command-line argument: -ignore_ecat_main.

  • ignore_ecat_subheader_variable (a boolean) – Ignore information from the minc ecat-subhdr variable. Maps to a command-line argument: -ignore_ecat_subheader_variable.

  • ignore_patient_variable (a boolean) – Ignore information from the minc patient variable. Maps to a command-line argument: -ignore_patient_variable.

  • ignore_study_variable (a boolean) – Ignore information from the minc study variable. Maps to a command-line argument: -ignore_study_variable.

  • no_decay_corr_fctr (a boolean) – Do not compute the decay correction factors. Maps to a command-line argument: -no_decay_corr_fctr.

  • output_file (a pathlike object or string representing a file) – Output file. Maps to a command-line argument: %s (position: -1).

  • voxels_as_integers (a boolean) – Voxel values are treated as integers, scale andcalibration factors are set to unity. Maps to a command-line argument: -label.

Outputs:

output_file (a pathlike object or string representing an existing file) – Output file.

ToRaw

Link to code

Bases: StdOutCommandLine

Wrapped executable: minctoraw.

Dump a chunk of MINC file data. This program is largely superseded by mincextract (see Extract).

Examples

>>> from nipype.interfaces.minc import ToRaw
>>> from nipype.interfaces.minc.testdata import minc2Dfile
>>> toraw = ToRaw(input_file=minc2Dfile)
>>> toraw.run() 
>>> toraw = ToRaw(input_file=minc2Dfile, write_range=(0, 100))
>>> toraw.run() 
Mandatory Inputs:

input_file (a pathlike object or string representing an existing file) – Input file. Maps to a command-line argument: %s (position: -2).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • nonormalize (a boolean) – Turn off pixel normalization. Maps to a command-line argument: -nonormalize. Mutually exclusive with inputs: normalize, nonormalize.

  • normalize (a boolean) – Normalize integer pixel values to file max and min. Maps to a command-line argument: -normalize. Mutually exclusive with inputs: normalize, nonormalize.

  • out_file (a pathlike object or string representing a file) – Maps to a command-line argument: > %s (position: -1).

  • output_file (a pathlike object or string representing a file) – Output file.

  • write_byte (a boolean) – Write out data as bytes. Maps to a command-line argument: -byte. Mutually exclusive with inputs: write_byte, write_short, write_int, write_long, write_float, write_double.

  • write_double (a boolean) – Write out data as double precision floating-point values. Maps to a command-line argument: -double. Mutually exclusive with inputs: write_byte, write_short, write_int, write_long, write_float, write_double.

  • write_float (a boolean) – Write out data as single precision floating-point values. Maps to a command-line argument: -float. Mutually exclusive with inputs: write_byte, write_short, write_int, write_long, write_float, write_double.

  • write_int (a boolean) – Write out data as 32-bit integers. Maps to a command-line argument: -int. Mutually exclusive with inputs: write_byte, write_short, write_int, write_long, write_float, write_double.

  • write_long (a boolean) – Superseded by write_int. Maps to a command-line argument: -long. Mutually exclusive with inputs: write_byte, write_short, write_int, write_long, write_float, write_double.

  • write_range (a tuple of the form: (a float, a float)) – Specify the range of output values.Default value: 1.79769e+308 1.79769e+308. Maps to a command-line argument: -range %s %s.

  • write_short (a boolean) – Write out data as short integers. Maps to a command-line argument: -short. Mutually exclusive with inputs: write_byte, write_short, write_int, write_long, write_float, write_double.

  • write_signed (a boolean) – Write out signed data. Maps to a command-line argument: -signed. Mutually exclusive with inputs: write_signed, write_unsigned.

  • write_unsigned (a boolean) – Write out unsigned data. Maps to a command-line argument: -unsigned. Mutually exclusive with inputs: write_signed, write_unsigned.

Outputs:

output_file (a pathlike object or string representing an existing file) – Output file in raw format.

VolSymm

Link to code

Bases: CommandLine

Wrapped executable: volsymm.

Make a volume symmetric about an axis either linearly and/or nonlinearly. This is done by registering a volume to a flipped image of itself.

This tool is part of the minc-widgets package:

https://github.com/BIC-MNI/minc-widgets/blob/master/volsymm/volsymm

Examples

>>> from nipype.interfaces.minc import VolSymm
>>> from nipype.interfaces.minc.testdata import nonempty_minc_data
>>> input_file = nonempty_minc_data(0)
>>> volsymm = VolSymm(input_file=input_file)
>>> volsymm.run() 
Mandatory Inputs:

input_file (a pathlike object or string representing an existing file) – Input file. Maps to a command-line argument: %s (position: -3).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • clobber (a boolean) – Overwrite existing file. Maps to a command-line argument: -clobber. (Nipype default value: True)

  • config_file (a pathlike object or string representing an existing file) – File containing the fitting configuration (nlpfit -help for info). Maps to a command-line argument: -config_file %s.

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • fit_linear (a boolean) – Fit using a linear xfm. Maps to a command-line argument: -linear.

  • fit_nonlinear (a boolean) – Fit using a non-linear xfm. Maps to a command-line argument: -nonlinear.

  • input_grid_files (a list of items which are a pathlike object or string representing a file) – Input grid file(s).

  • nofit (a boolean) – Use the input transformation instead of generating one. Maps to a command-line argument: -nofit.

  • output_file (a pathlike object or string representing a file) – Output file. Maps to a command-line argument: %s (position: -1).

  • trans_file (a pathlike object or string representing a file) – Output xfm trans file. Maps to a command-line argument: %s (position: -2).

  • verbose (a boolean) – Print out log messages. Default: False. Maps to a command-line argument: -verbose.

  • x (a boolean) – Flip volume in x-plane (default). Maps to a command-line argument: -x.

  • y (a boolean) – Flip volume in y-plane. Maps to a command-line argument: -y.

  • z (a boolean) – Flip volume in z-plane. Maps to a command-line argument: -z.

Outputs:
  • output_file (a pathlike object or string representing an existing file) – Output file.

  • output_grid (a pathlike object or string representing an existing file) – Output grid file.

  • trans_file (a pathlike object or string representing an existing file) – Xfm trans file.

Volcentre

Link to code

Bases: CommandLine

Wrapped executable: volcentre.

Centre a MINC image’s sampling about a point, typically (0,0,0).

Example

>>> from nipype.interfaces.minc import Volcentre
>>> from nipype.interfaces.minc.testdata import minc2Dfile
>>> vc = Volcentre(input_file=minc2Dfile)
>>> vc.run() 
Mandatory Inputs:

input_file (a pathlike object or string representing an existing file) – Input file to centre. Maps to a command-line argument: %s (position: -2).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • centre (a tuple of the form: (a float, a float, a float)) – Centre to use (x,y,z) [default: 0 0 0]. Maps to a command-line argument: -centre %s %s %s.

  • clobber (a boolean) – Overwrite existing file. Maps to a command-line argument: -clobber. (Nipype default value: True)

  • com (a boolean) – Use the CoM of the volume for the new centre (via mincstats). Default: False. Maps to a command-line argument: -com.

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • output_file (a pathlike object or string representing a file) – Output file. Maps to a command-line argument: %s (position: -1).

  • verbose (a boolean) – Print out log messages. Default: False. Maps to a command-line argument: -verbose.

  • zero_dircos (a boolean) – Set the direction cosines to identity [default]. Maps to a command-line argument: -zero_dircos.

Outputs:

output_file (a pathlike object or string representing an existing file) – Output file.

Voliso

Link to code

Bases: CommandLine

Wrapped executable: voliso.

Changes the steps and starts in order that the output volume has isotropic sampling.

Examples

>>> from nipype.interfaces.minc import Voliso
>>> from nipype.interfaces.minc.testdata import minc2Dfile
>>> viso = Voliso(input_file=minc2Dfile, minstep=0.1, avgstep=True)
>>> viso.run() 
Mandatory Inputs:

input_file (a pathlike object or string representing an existing file) – Input file to convert to isotropic sampling. Maps to a command-line argument: %s (position: -2).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • avgstep (a boolean) – Calculate the maximum step from the average steps of the input volume. Maps to a command-line argument: --avgstep.

  • clobber (a boolean) – Overwrite existing file. Maps to a command-line argument: --clobber. (Nipype default value: True)

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • maxstep (a float) – The target maximum step desired in the output volume. Maps to a command-line argument: --maxstep %s.

  • minstep (a float) – The target minimum step desired in the output volume. Maps to a command-line argument: --minstep %s.

  • output_file (a pathlike object or string representing a file) – Output file. Maps to a command-line argument: %s (position: -1).

  • verbose (a boolean) – Print out log messages. Default: False. Maps to a command-line argument: --verbose.

Outputs:

output_file (a pathlike object or string representing an existing file) – Output file.

Volpad

Link to code

Bases: CommandLine

Wrapped executable: volpad.

Centre a MINC image’s sampling about a point, typically (0,0,0).

Examples

>>> from nipype.interfaces.minc import Volpad
>>> from nipype.interfaces.minc.testdata import minc2Dfile
>>> vp = Volpad(input_file=minc2Dfile, smooth=True, smooth_distance=4)
>>> vp.run() 
Mandatory Inputs:

input_file (a pathlike object or string representing an existing file) – Input file to centre. Maps to a command-line argument: %s (position: -2).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • auto (a boolean) – Automatically determine padding distances (uses -distance as max). Default: False. Maps to a command-line argument: -auto.

  • auto_freq (a float) – Frequency of voxels over bimodalt threshold to stop at [default: 500]. Maps to a command-line argument: -auto_freq %s.

  • clobber (a boolean) – Overwrite existing file. Maps to a command-line argument: -clobber. (Nipype default value: True)

  • distance (an integer) – Padding distance (in voxels) [default: 4]. Maps to a command-line argument: -distance %s.

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • output_file (a pathlike object or string representing a file) – Output file. Maps to a command-line argument: %s (position: -1).

  • smooth (a boolean) – Smooth (blur) edges before padding. Default: False. Maps to a command-line argument: -smooth.

  • smooth_distance (an integer) – Smoothing distance (in voxels) [default: 4]. Maps to a command-line argument: -smooth_distance %s.

  • verbose (a boolean) – Print out log messages. Default: False. Maps to a command-line argument: -verbose.

Outputs:

output_file (a pathlike object or string representing an existing file) – Output file.

XfmAvg

Link to code

Bases: CommandLine

Wrapped executable: xfmavg.

Average a number of xfm transforms using matrix logs and exponents. The program xfmavg calls Octave for numerical work.

This tool is part of the minc-widgets package:

https://github.com/BIC-MNI/minc-widgets/tree/master/xfmavg

Examples

>>> from nipype.interfaces.minc import XfmAvg
>>> from nipype.interfaces.minc.testdata import nonempty_minc_data, nlp_config
>>> from nipype.testing import example_data
>>> xfm1 = example_data('minc_initial.xfm')
>>> xfm2 = example_data('minc_initial.xfm')  # cheating for doctest
>>> xfmavg = XfmAvg(input_files=[xfm1, xfm2])
>>> xfmavg.run() 
Mandatory Inputs:

input_files (a list of items which are a pathlike object or string representing an existing file) – Input file(s). Maps to a command-line argument: %s (position: -2).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • avg_linear (a boolean) – Average the linear part [default]. Maps to a command-line argument: -avg_linear.

  • avg_nonlinear (a boolean) – Average the non-linear part [default]. Maps to a command-line argument: -avg_nonlinear.

  • clobber (a boolean) – Overwrite existing file. Maps to a command-line argument: -clobber. (Nipype default value: True)

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • ignore_linear (a boolean) – Opposite of -avg_linear. Maps to a command-line argument: -ignore_linear.

  • ignore_nonlinear (a boolean) – Opposite of -avg_nonlinear. Maps to a command-line argument: -ignore_nonline.

  • input_grid_files (a list of items which are a pathlike object or string representing a file) – Input grid file(s).

  • output_file (a pathlike object or string representing a file) – Output file. Maps to a command-line argument: %s (position: -1).

  • verbose (a boolean) – Print out log messages. Default: False. Maps to a command-line argument: -verbose.

Outputs:
  • output_file (a pathlike object or string representing an existing file) – Output file.

  • output_grid (a pathlike object or string representing an existing file) – Output grid file.

XfmConcat

Link to code

Bases: CommandLine

Wrapped executable: xfmconcat.

Concatenate transforms together. The output transformation is equivalent to applying input1.xfm, then input2.xfm, …, in that order.

Examples

>>> from nipype.interfaces.minc import XfmConcat
>>> from nipype.interfaces.minc.testdata import minc2Dfile
>>> conc = XfmConcat(input_files=['input1.xfm', 'input1.xfm'])
>>> conc.run() 
Mandatory Inputs:

input_files (a list of items which are a pathlike object or string representing an existing file) – Input file(s). Maps to a command-line argument: %s (position: -2).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • clobber (a boolean) – Overwrite existing file. Maps to a command-line argument: -clobber. (Nipype default value: True)

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • input_grid_files (a list of items which are a pathlike object or string representing a file) – Input grid file(s).

  • output_file (a pathlike object or string representing a file) – Output file. Maps to a command-line argument: %s (position: -1).

  • verbose (a boolean) – Print out log messages. Default: False. Maps to a command-line argument: -verbose.

Outputs:
  • output_file (a pathlike object or string representing an existing file) – Output file.

  • output_grids (a list of items which are a pathlike object or string representing an existing file) – Output grids.

XfmInvert

Link to code

Bases: CommandLine

Wrapped executable: xfminvert.

Invert an xfm transform file.

Examples

>>> from nipype.interfaces.minc import XfmAvg
>>> from nipype.testing import example_data
>>> xfm = example_data('minc_initial.xfm')
>>> invert = XfmInvert(input_file=xfm)
>>> invert.run() 
Mandatory Inputs:

input_file (a pathlike object or string representing an existing file) – Input file. Maps to a command-line argument: %s (position: -2).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • clobber (a boolean) – Overwrite existing file. Maps to a command-line argument: -clobber. (Nipype default value: True)

  • environ (a dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’) – Environment variables. (Nipype default value: {})

  • output_file (a pathlike object or string representing a file) – Output file. Maps to a command-line argument: %s (position: -1).

  • verbose (a boolean) – Print out log messages. Default: False. Maps to a command-line argument: -verbose.

Outputs:
  • output_file (a pathlike object or string representing an existing file) – Output file.

  • output_grid (a pathlike object or string representing an existing file) – Output grid file.