io

load_image(file_name[, as_vtktype])

Load an image.

load_polydata(file_name[, is_mni_obj])

Load a vtk polydata to a supported format file.

save_image(arr, file_name[, …])

Save a 2d or 3d image.

save_polydata(polydata, file_name[, binary, …])

Save a vtk polydata to a supported format file.

set_input(vtk_object, inp)

Set Generic input function which takes into account VTK 5 or 6.

load_image

fury.io.load_image(file_name, as_vtktype=False)[source]

Load an image.

Parameters
file_name: string

should be png, bmp, jpeg or jpg files

as_vtktype: bool, optional

if True, return vtk output otherwise a ndarray. Default False.

Returns
image: ndarray or vtk output

desired image array

load_polydata

fury.io.load_polydata(file_name, is_mni_obj=False)[source]

Load a vtk polydata to a supported format file.

Supported file formats are OBJ, VTK, FIB, PLY, STL and XML

Parameters
file_namestring
is_mni_objbool
Returns
outputvtkPolyData

save_image

fury.io.save_image(arr, file_name, compression_quality=100, compression_type='deflation')[source]

Save a 2d or 3d image.

Parameters
arr: ndarray

array to save

file_name: string

should be png, bmp, jpeg or jpg files

compression_quality: int

compression_quality for jpeg data. 0 = Low quality, 100 = High quality

compression_type: str

compression type for tiff file select between: None, lzw, deflation (default)

save_polydata

fury.io.save_polydata(polydata, file_name, binary=False, color_array_name=None, is_mni_obj=False)[source]

Save a vtk polydata to a supported format file.

Save formats can be VTK, FIB, PLY, STL and XML.

Parameters
polydatavtkPolyData
file_namestring
binarybool
color_array_name: ndarray
is_mni_objbool

set_input

fury.io.set_input(vtk_object, inp)[source]

Set Generic input function which takes into account VTK 5 or 6.

Parameters
vtk_object: vtk object
inp: vtkPolyData or vtkImageData or vtkAlgorithmOutput
Returns
vtk_object

Notes

This can be used in the following way::

from fury.utils import set_input poly_mapper = set_input(vtk.vtkPolyDataMapper(), poly_data)