openlifu.nav.photoscan

Functions

apply_exif_orientation_numpy(image, orientation)

Transforms an image array to undo or redo EXIF orientation.

convert_between_ras_and_lps(mesh)

Converts a mesh (polydata, unstructured grid or even just a point cloud) between the LPS (left-posterior-superior) coordinate system and RAS (right-anterior-superior) coordinate system.

convert_numpy_to_vtkimage(image_numpy)

Converts a numpy array with dimensions [HxWx3] representing an RGB image into vtkImageData

get_meshroom_pipeline_names()

Get a list of names of valid meshroom pipelines that can be used in run_reconstruction

get_modnet_path()

Get the MODNet checkpoint path.

load_data_from_filepaths(model_abspath, ...)

This function returns the data directly from the model and texture filepaths without requiring a photoscan object. param model_abspath: absolute filepath to model data texture abspath: absolute filepath to texture data Returns: Photoscan data as (model_vtkpolydata, texture_vtkimagedata).

load_data_from_photoscan(photoscan, parent_dir)

param parent_dir: parent directory containing model and texture data filepaths Returns: Photoscan data as (model_vtkpolydata, texture_vtkimagedata)

load_model(file_name)

This function assumes that the model is saved to file in LPS coordinates.

load_texture(file_name)

make_masks(image_paths, output_dir[, threshold])

Runs MODNet on a list of image paths and saves the output masks.

merge_textures(input_obj_path, output_path)

Merge the UDIM textures output by meshroom into a single large texture

preprocess_image_modnet(image[, ref_size])

Preprocess an input image for MODNet inference.

read_as_vtkimagedata(file_name)

read_as_vtkpolydata(file_name)

run_reconstruction(images[, pipeline_name, ...])

Run Meshroom with the given images and pipeline. :param images: List of image file paths. :type images: list[Path] :param pipeline_name: Name of the Meshroom pipeline in meshroom_pipelines folder. See also get_meshroom_pipeline_names. :type pipeline_name: str :param input_resize_width: Width to which input images will be resized, in pixels. :type input_resize_width: int :param use_masks: Whether to include a background removal step to filter the dense reconstruction. :type use_masks: bool.

subprocess_stream_output(args, ...[, check, ...])

Run a subprocess and stream its stdout and stderr output to separate handlers/loggers.

udim_to_tile(udim_str)

Convert UDIM string to tile coordinates

Classes

Photoscan([id, name, model_filename, ...])