Video preprocessor¶
This module contains functions for pre-processing video data.
- class mio.process.video.BaseVideoProcessor(name: str, output_dir: Path)¶
Base class for defining an abstract video processor.
Attributes: name (str): The name of the video processor. output_frames (list): A list of output frames. named_frame (NamedFrame): A NamedFrame object.
- append_output_frame(input_frame: ndarray) None¶
Append a frame to the output_frames list.
Parameters: frame (np.ndarray): The frame to append.
- batch_export_videos() None¶
Batch export the videos to a file. This method should be overridden in the subclass.
- property output_named_video: NamedVideo¶
Get the output NamedFrame object.
Returns: NamedVideo: The output NamedVideo object.
- class mio.process.video.ButterworthProcessor(name: str, butter_config: ButterworthFilterConfig, output_dir: Path)¶
Processor for applying a Butterworth filter to video frames.
This class applies a Butterworth filter to each frame in the video, using the specified Butterworth filter configuration.
- apply_filter_to_frames(filtered_data: ndarray) list[ndarray]¶
Apply the filtered intensity values to scale the frames.
- class mio.process.video.FreqencyMaskProcessor(name: str, freq_mask_config: FreqencyMaskingConfig, width: int, height: int, output_dir: Path)¶
A class to apply frequency masking to a video.
- batch_export_videos() None¶
Batch export the videos to a file. Whether to export or not is controlled in each method.
- property freq_domain_named_video: NamedVideo¶
Get the NamedFrame object for the frequency domain.
- property freq_mask_named_frame: NamedFrame¶
Get the NamedFrame object for the frequency mask.
- class mio.process.video.MinProjSubtractProcessor(name: str, minimum_projection_config: MinimumProjectionConfig, output_dir: Path, video_frames: list[ndarray])¶
A class to apply minimum projection to a video.
- batch_export_videos() None¶
Batch export the videos to a file. Whether to export or not is controlled in each method.
- property min_proj_named_frame: NamedFrame¶
Get the NamedFrame object for the minimum projection.
- class mio.process.video.NoisePatchProcessor(name: str, noise_patch_config: NoisePatchConfig, output_dir: Path)¶
A class to apply noise patching to a video.
- batch_export_videos() None¶
Batch export the videos to a file. Whether to export or not is controlled in each method.
- property diff_frames_named_video: NamedVideo¶
Get the NamedFrame object for the difference frames.
- property noise_patch_named_video: NamedVideo¶
Get the NamedFrame object for the noise patch.
- property noisy_frames_named_video: NamedVideo¶
Get the NamedFrame object for the noisy frames.
- class mio.process.video.PassThroughProcessor(name: str, output_dir: Path)¶
A class to pass through a video.
- batch_export_videos() None¶
Batch export the videos to a file. Whether to export or not is controlled in each method.
- property pass_through_named_video: NamedVideo¶
Get the NamedFrame object for the pass through.