Skip to content

Commit

Permalink
fix{prairie_view_loader): bugfix framerate
Browse files Browse the repository at this point in the history
  • Loading branch information
ttngu207 committed Apr 18, 2024
1 parent 1c9b392 commit deff0fa
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions element_interface/prairie_view_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ def meta(self):
# adjust for the different definition of "frames"
# from the ome meta - "frame" refers to an image at a given scanning depth, time step combination
# in the imaging pipeline - "frame" refers to video frames - i.e. time steps
num_frames = self._meta.pop("num_frames") / self._meta["num_planes"]

self._meta["num_frames"] = int(num_frames)
num_frames = int(self._meta.pop("num_frames") / self._meta["num_planes"])
self._meta["num_frames"] = num_frames
self._meta["frame_rate"] = num_frames / self._meta["scan_duration"]

return self._meta

Expand Down Expand Up @@ -177,9 +177,9 @@ def _extract_prairieview_metadata(xml_filepath: str):
channels = set(channel_list)
n_channels = len(channels)
n_frames = len(xml_root.findall(".//Sequence/Frame"))
framerate = 1 / float(
frame_period = float(
xml_root.findall('.//PVStateValue/[@key="framePeriod"]')[0].attrib.get("value")
) # rate = 1/framePeriod
)

usec_per_line = (
float(
Expand Down Expand Up @@ -307,7 +307,7 @@ def _extract_prairieview_metadata(xml_filepath: str):
x_pos=None,
y_pos=None,
z_pos=None,
frame_rate=framerate,
frame_period=frame_period,
bidirectional=bidirectional_scan,
bidirectional_z=bidirection_z,
scan_datetime=scan_datetime,
Expand Down

0 comments on commit deff0fa

Please sign in to comment.