interfaces.ants.visualization¶
ConvertScalarImageToRGB¶
Wraps the executable command ConvertScalarImageToRGB
.
Examples¶
>>> from nipype.interfaces.ants.visualization import ConvertScalarImageToRGB
>>> converter = ConvertScalarImageToRGB()
>>> converter.inputs.dimension = 3
>>> converter.inputs.input_image = 'T1.nii.gz'
>>> converter.inputs.colormap = 'jet'
>>> converter.inputs.minimum_input = 0
>>> converter.inputs.maximum_input = 6
>>> converter.cmdline
'ConvertScalarImageToRGB 3 T1.nii.gz rgb.nii.gz none jet none 0 6 0 255'
Inputs:
[Mandatory]
dimension: (3 or 2, nipype default value: 3)
image dimension (2 or 3)
argument: ``%d``, position: 0
input_image: (an existing file name)
Main input is a 3-D grayscale image.
argument: ``%s``, position: 1
colormap: (a unicode string, nipype default value: )
Possible colormaps: grey, red, green, blue, copper, jet, hsv,
spring, summer, autumn, winter, hot, cool, overunder, custom
argument: ``%s``, position: 4
minimum_input: (an integer (int or long))
minimum input
argument: ``%d``, position: 6
maximum_input: (an integer (int or long))
maximum input
argument: ``%d``, position: 7
[Optional]
output_image: (a unicode string, nipype default value: rgb.nii.gz)
rgb output image
argument: ``%s``, position: 2
mask_image: (an existing file name, nipype default value: none)
mask image
argument: ``%s``, position: 3
custom_color_map_file: (a unicode string, nipype default value: none)
custom color map file
argument: ``%s``, position: 5
minimum_RGB_output: (an integer (int or long), nipype default value:
0)
argument: ``%d``, position: 8
maximum_RGB_output: (an integer (int or long), nipype default value:
255)
argument: ``%d``, position: 9
num_threads: (an integer (int or long), nipype default value: 1)
Number of ITK threads to use
args: (a unicode string)
Additional parameters to the command
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', nipype default value: {})
Environment variables
Outputs:
output_image: (an existing file name)
converted RGB image
CreateTiledMosaic¶
Wraps the executable command CreateTiledMosaic
.
The program CreateTiledMosaic in conjunction with ConvertScalarImageToRGB provides useful functionality for common image analysis tasks. The basic usage of CreateTiledMosaic is to tile a 3-D image volume slice-wise into a 2-D image.
Examples¶
>>> from nipype.interfaces.ants.visualization import CreateTiledMosaic
>>> mosaic_slicer = CreateTiledMosaic()
>>> mosaic_slicer.inputs.input_image = 'T1.nii.gz'
>>> mosaic_slicer.inputs.rgb_image = 'rgb.nii.gz'
>>> mosaic_slicer.inputs.mask_image = 'mask.nii.gz'
>>> mosaic_slicer.inputs.output_image = 'output.png'
>>> mosaic_slicer.inputs.alpha_value = 0.5
>>> mosaic_slicer.inputs.direction = 2
>>> mosaic_slicer.inputs.pad_or_crop = '[ -15x -50 , -15x -30 ,0]'
>>> mosaic_slicer.inputs.slices = '[2 ,100 ,160]'
>>> mosaic_slicer.cmdline
'CreateTiledMosaic -a 0.50 -d 2 -i T1.nii.gz -x mask.nii.gz -o output.png -p [ -15x -50 , -15x -30 ,0] -r rgb.nii.gz -s [2 ,100 ,160]'
Inputs:
[Mandatory]
input_image: (an existing file name)
Main input is a 3-D grayscale image.
argument: ``-i %s``
rgb_image: (an existing file name)
An optional Rgb image can be added as an overlay.It must have the
same imagegeometry as the input grayscale image.
argument: ``-r %s``
[Optional]
mask_image: (an existing file name)
Specifies the ROI of the RGB voxels used.
argument: ``-x %s``
alpha_value: (a float)
If an Rgb image is provided, render the overlay using the specified
alpha parameter.
argument: ``-a %.2f``
output_image: (a unicode string, nipype default value: output.png)
The output consists of the tiled mosaic image.
argument: ``-o %s``
tile_geometry: (a unicode string)
The tile geometry specifies the number of rows and columnsin the
output image. For example, if the user specifies "5x10", then 5 rows
by 10 columns of slices are rendered. If R < 0 and C > 0 (or vice
versa), the negative value is selectedbased on direction.
argument: ``-t %s``
direction: (an integer (int or long))
Specifies the direction of the slices. If no direction is specified,
the direction with the coarsest spacing is chosen.
argument: ``-d %d``
pad_or_crop: (a unicode string)
argument passed to -p flag:[padVoxelWidth,<constantValue=0>][lowerPa
dding[0]xlowerPadding[1],upperPadding[0]xupperPadding[1],constantVal
ue]The user can specify whether to pad or crop a specified voxel-
width boundary of each individual slice. For this program, cropping
is simply padding with negative voxel-widths.If one pads (+), the
user can also specify a constant pad value (default = 0). If a mask
is specified, the user can use the mask to define the region, by
using the keyword "mask" plus an offset, e.g. "-p mask+3".
argument: ``-p %s``
slices: (a unicode string)
Number of slices to increment Slice1xSlice2xSlice3[numberOfSlicesToI
ncrement,<minSlice=0>,<maxSlice=lastSlice>]
argument: ``-s %s``
flip_slice: (a unicode string)
flipXxflipY
argument: ``-f %s``
permute_axes: (a boolean)
doPermute
argument: ``-g``
num_threads: (an integer (int or long), nipype default value: 1)
Number of ITK threads to use
args: (a unicode string)
Additional parameters to the command
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', nipype default value: {})
Environment variables
Outputs:
output_image: (an existing file name)
image file