def get_mask(self, idx: int) -> np.ndarray | None:
        """Retrieve the masks from the file system.

        Args:
            idx (int): Index of the clip.

        Returns:
            np.ndarray | None: Stack of mask frames if available, None otherwise.
        """
        video_idx, frames_idx = self.get_clip_location(idx)
        mask_folder = self.mask_paths[video_idx]
        if mask_folder == "":  # no gt masks available for this clip
            return None
        frames = self.clips[video_idx][frames_idx]

        mask_frames = sorted(Path(mask_folder).glob("*.bmp"))
        mask_paths = [mask_frames[idx] for idx in frames.int()]

        return torch.stack([read_mask(mask_path, as_tensor=True) for mask_path in mask_paths])
Retrieve the masks from the file system.

        Args:
            idx (int): Index of the clip.

        Returns:
            np.ndarray | None: Stack of mask frames if available, None otherwise.
        
src/anomalib/data/datasets/video/ucsd_ped.py