def METHOD_NAME(
    self,
    nwbfile: NWBFile,
    metadata: Optional[dict] = None,
    photon_series_type: Literal["TwoPhotonSeries", "OnePhotonSeries"] = "OnePhotonSeries",
    stub_test: bool = False,
    stub_frames: int = 100,
):
    from ndx_miniscope.utils import add_miniscope_device
    from ....tools.roiextractors import add_photon_series
    miniscope_timestamps = self.get_original_timestamps()
    imaging_extractor = self.imaging_extractor
    if stub_test:
        stub_frames = min([stub_frames, self.imaging_extractor.get_num_frames()])
        imaging_extractor = self.imaging_extractor.frame_slice(start_frame=0, end_frame=stub_frames)
        miniscope_timestamps = miniscope_timestamps[:stub_frames]
    imaging_extractor.set_times(times=miniscope_timestamps)
    device_metadata = metadata["Ophys"]["Device"][0]
    add_miniscope_device(nwbfile=nwbfile, device_metadata=device_metadata)
    add_photon_series(
        imaging=imaging_extractor,
        nwbfile=nwbfile,
        metadata=metadata,
        photon_series_type=photon_series_type,
    )