io

BMPReader

alias of vtkmodules.vtkIOImage.vtkBMPReader

BMPWriter

alias of vtkmodules.vtkIOImage.vtkBMPWriter

ImageData

alias of vtkmodules.vtkCommonDataModel.vtkImageData

ImageFlip

alias of vtkmodules.vtkImagingCore.vtkImageFlip

InTemporaryDirectory

alias of tempfile.TemporaryDirectory

JPEGReader

alias of vtkmodules.vtkIOImage.vtkJPEGReader

JPEGWriter

alias of vtkmodules.vtkIOImage.vtkJPEGWriter

MNIObjectReader

alias of vtkmodules.vtkIOMINC.vtkMNIObjectReader

MNIObjectWriter

alias of vtkmodules.vtkIOMINC.vtkMNIObjectWriter

OBJReader

alias of vtkmodules.vtkIOGeometry.vtkOBJReader

PLYReader

alias of vtkmodules.vtkIOPLY.vtkPLYReader

PLYWriter

alias of vtkmodules.vtkIOPLY.vtkPLYWriter

PNGReader

alias of vtkmodules.vtkIOImage.vtkPNGReader

PNGWriter

alias of vtkmodules.vtkIOImage.vtkPNGWriter

PolyDataReader

alias of vtkmodules.vtkIOLegacy.vtkPolyDataReader

PolyDataWriter

alias of vtkmodules.vtkIOLegacy.vtkPolyDataWriter

STLReader

alias of vtkmodules.vtkIOGeometry.vtkSTLReader

STLWriter

alias of vtkmodules.vtkIOGeometry.vtkSTLWriter

TIFFReader

alias of vtkmodules.vtkIOImage.vtkTIFFReader

TIFFWriter

alias of vtkmodules.vtkIOImage.vtkTIFFWriter

Texture

alias of vtkmodules.vtkRenderingCore.vtkTexture

XMLPolyDataReader

alias of vtkmodules.vtkIOXML.vtkXMLPolyDataReader

XMLPolyDataWriter

alias of vtkmodules.vtkIOXML.vtkXMLPolyDataWriter

load_cubemap_texture(fnames[, ...])

Load a cube map texture from a list of 6 images.

load_image(filename[, as_vtktype, use_pillow])

Load an image.

load_polydata(file_name)

Load a vtk polydata to a supported format file.

load_sprite_sheet(sheet_path, nb_rows, nb_cols)

Process and load sprites from a sprite sheet.

save_image(arr, filename[, ...])

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.

urlretrieve(url[, filename, reporthook, data])

Retrieve a URL into a temporary location on disk.

BMPReader

fury.io.BMPReader

alias of vtkmodules.vtkIOImage.vtkBMPReader

BMPWriter

fury.io.BMPWriter

alias of vtkmodules.vtkIOImage.vtkBMPWriter

ImageData

fury.io.ImageData

alias of vtkmodules.vtkCommonDataModel.vtkImageData

ImageFlip

fury.io.ImageFlip

alias of vtkmodules.vtkImagingCore.vtkImageFlip

InTemporaryDirectory

fury.io.InTemporaryDirectory

alias of tempfile.TemporaryDirectory

JPEGReader

fury.io.JPEGReader

alias of vtkmodules.vtkIOImage.vtkJPEGReader

JPEGWriter

fury.io.JPEGWriter

alias of vtkmodules.vtkIOImage.vtkJPEGWriter

MNIObjectReader

fury.io.MNIObjectReader

alias of vtkmodules.vtkIOMINC.vtkMNIObjectReader

MNIObjectWriter

fury.io.MNIObjectWriter

alias of vtkmodules.vtkIOMINC.vtkMNIObjectWriter

OBJReader

fury.io.OBJReader

alias of vtkmodules.vtkIOGeometry.vtkOBJReader

PLYReader

fury.io.PLYReader

alias of vtkmodules.vtkIOPLY.vtkPLYReader

PLYWriter

fury.io.PLYWriter

alias of vtkmodules.vtkIOPLY.vtkPLYWriter

PNGReader

fury.io.PNGReader

alias of vtkmodules.vtkIOImage.vtkPNGReader

PNGWriter

fury.io.PNGWriter

alias of vtkmodules.vtkIOImage.vtkPNGWriter

PolyDataReader

fury.io.PolyDataReader

alias of vtkmodules.vtkIOLegacy.vtkPolyDataReader

PolyDataWriter

fury.io.PolyDataWriter

alias of vtkmodules.vtkIOLegacy.vtkPolyDataWriter

STLReader

fury.io.STLReader

alias of vtkmodules.vtkIOGeometry.vtkSTLReader

STLWriter

fury.io.STLWriter

alias of vtkmodules.vtkIOGeometry.vtkSTLWriter

TIFFReader

fury.io.TIFFReader

alias of vtkmodules.vtkIOImage.vtkTIFFReader

TIFFWriter

fury.io.TIFFWriter

alias of vtkmodules.vtkIOImage.vtkTIFFWriter

Texture

fury.io.Texture

alias of vtkmodules.vtkRenderingCore.vtkTexture

XMLPolyDataReader

fury.io.XMLPolyDataReader

alias of vtkmodules.vtkIOXML.vtkXMLPolyDataReader

XMLPolyDataWriter

fury.io.XMLPolyDataWriter

alias of vtkmodules.vtkIOXML.vtkXMLPolyDataWriter

load_cubemap_texture

fury.io.load_cubemap_texture(fnames, interpolate_on=True, mipmap_on=True)[source]

Load a cube map texture from a list of 6 images.

Parameters
  • fnames (list of strings) – List of 6 filenames with bmp, jpg, jpeg, png, tif or tiff extensions.

  • interpolate_on (bool, optional) –

  • mipmap_on (bool, optional) –

Returns

output – Cube map texture.

Return type

vtkTexture

load_image

fury.io.load_image(filename, as_vtktype=False, use_pillow=True)[source]

Load an image.

Parameters
  • filename (str) – should be png, bmp, jpeg or jpg files

  • as_vtktype (bool, optional) – if True, return vtk output otherwise an ndarray. Default False.

  • use_pillow (bool, optional) – Use pillow python library to load the files. Default True

Returns

image – desired image array

Return type

ndarray or vtk output

load_polydata

fury.io.load_polydata(file_name)[source]

Load a vtk polydata to a supported format file.

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

Parameters

file_name (string) –

Returns

output

Return type

vtkPolyData

load_sprite_sheet

fury.io.load_sprite_sheet(sheet_path, nb_rows, nb_cols, as_vtktype=False)[source]

Process and load sprites from a sprite sheet.

Parameters
  • sheet_path (str) – Path to the sprite sheet

  • nb_rows (int) – Number of rows in the sprite sheet

  • nb_cols (int) – Number of columns in the sprite sheet

  • as_vtktype (bool, optional) – If True, the output is a vtkImageData

Returns

Return type

Dict containing the processed sprites.

save_image

fury.io.save_image(arr, filename, compression_quality=75, compression_type='deflation', use_pillow=True)[source]

Save a 2d or 3d image.

Expect an image with the following shape: (H, W) or (H, W, 1) or (H, W, 3) or (H, W, 4).

Parameters
  • arr (ndarray) – array to save

  • filename (string) – should be png, bmp, jpeg or jpg files

  • compression_quality (int, optional) – compression_quality for jpeg data. 0 = Low quality, 100 = High quality

  • compression_type (str, optional) – compression type for tiff file select between: None, lzw, deflation (default)

  • use_pillow (bool, optional) – Use imageio python library to save the files.

save_polydata

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

Save a vtk polydata to a supported format file.

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

Parameters
  • polydata (vtkPolyData) –

  • file_name (string) –

  • binary (bool) –

  • color_array_name (ndarray) –

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

Return type

vtk_object

Notes

This can be used in the following way::

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

urlretrieve

fury.io.urlretrieve(url, filename=None, reporthook=None, data=None)[source]

Retrieve a URL into a temporary location on disk.

Requires a URL argument. If a filename is passed, it is used as the temporary file location. The reporthook argument should be a callable that accepts a block number, a read size, and the total file size of the URL target. The data argument should be valid URL encoded data.

If a filename is passed and the URL points to a local resource, the result is a copy from local file to new file.

Returns a tuple containing the path to the newly created data file as well as the resulting HTTPMessage object.