io#
I/O functions for loading and saving images, textures.
|
Load a cube map texture from a list of images. |
|
Load an image texture from a file or URL. |
|
Load an image from a file or URL. |
|
Load an image from a file or URL as a wgpu Texture view. |
|
Save a 2D or 3D image to a file. |
|
Get the file extension. |
|
Load a network from a file. |
|
Save a network to a file. |
load_cube_map_texture#
load_image_texture#
load_image#
load_image_as_wgpu_texture_view#
- fury.io.load_image_as_wgpu_texture_view(filename, device)[source]#
Load an image from a file or URL as a wgpu Texture view.
- Parameters:
filename (str) – Path to image file or URL. Should be png, bmp, jpeg or jpg files.
device (wgpu.GPUDevice) – The wgpu device to create the texture on.
- Returns:
Loaded image as wgpu Texture view.
- Return type:
wgpu.GPUTextureView
save_image#
- fury.io.save_image(arr, filename, *, compression_quality=75, compression_type='deflation', dpi=(72, 72))[source]#
Save a 2D or 3D image to a file.
- Parameters:
arr (ndarray) – Array to save with shape (H, W) or (H, W, 1) or (H, W, 3) or (H, W, 4).
filename (str) – Output filename. Should be png, bmp, jpeg, jpg, tiff, or tif file.
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).
dpi (float or tuple of float, optional) – Dots per inch (dpi) for saved image. Single values are applied as dpi for both dimensions.
get_extension#
load_network#
- fury.io.load_network(file_path, format=None)[source]#
Load a network from a file.
- Parameters:
- Returns:
A tuple containing: - nodes_xyz (np.ndarray): Shape (N, 3) float32 array of node positions. - edges_indices (np.ndarray): Shape (E, 2) int32 array of edge connections. - colors (np.ndarray): Shape (N, 4) float32 array of node colors (RGBA).
- Return type:
save_network#
- fury.io.save_network(network_data, file_path, format=None)[source]#
Save a network to a file.
- Parameters:
network_data (tuple) – A tuple containing: - nodes_xyz (np.ndarray): Shape (N, 3) float32 array of node positions. - edges_indices (np.ndarray): Shape (E, 2) int32 array of edge connections. - colors (np.ndarray): Shape (N, 4) float32 array of node colors (RGBA).
file_path (str) – The destination path where the network file will be written.
format (str, optional) – The specific export format of the network file.