neuralib.imglib.io
- neuralib.imglib.io.read_sequences(avi_file, grey_scale=True)[source]
Read an sequences file (i.e., AVI/MP4) into an array, converting to grayscale if specified.
- Parameters:
avi_file (str | Path | bytes | BinaryIO | BufferedIOBase | BufferedReader) – Path to the AVI file.
grey_scale (bool) – Whether to convert frames to grayscale.
- Returns:
Sequences array. Array[uint8, [F, W, H]|[F, W, H, 3]]
- Return type:
ndarray
- neuralib.imglib.io.read_pdf(file, single_image=True, poppler_path=None, **kwargs)[source]
Read pdf as an image array
- Parameters:
file (PathLike)
single_image (bool)
poppler_path (str | None) –
if poppler not installed in a system level. Specify the path. for example:
Release-23.08.0-0\poppler-23.08.0\Libraryinkwargs – pass through convert_from_path
- Returns:
Image array
- Return type:
np.ndarray
- neuralib.imglib.io.write_avi(file_path, frames, fps=30.0)[source]
Write a sequence of frames to an AVI file.
- Parameters:
file_path (str) – The path where the AVI file will be saved.
frames (ndarray) – Array[uint, [F, W, H]|[F, W, H, 3]] containing the frames.
fps (int) – The frames per second (frame rate) of the output video.
- Return type:
None
- neuralib.imglib.io.tif_to_gif(image_file, output_path, fps=30, **kwargs)[source]
Convert tif sequences to GIF
- Parameters:
image_file (str | Path | bytes | BinaryIO | BufferedIOBase | BufferedReader)
output_path (str | Path | bytes | BinaryIO | BufferedIOBase | BufferedReader)
fps (int)
- Return type:
None