Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions openhcs/core/viewer_streaming_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,8 @@ def source_workspace_projection(self) -> VirtualWorkspaceSourceProjection:
filemanager=self.filemanager,
).projection_or_empty()

def roi_image_metadata(self) -> ImagePayloadMetadata:
"""Return plate-owned physical calibration for ROI pixel coordinates."""
def plate_image_metadata(self) -> ImagePayloadMetadata:
"""Return acquisition-owned calibration for source-pixel coordinates."""
pixel_size = float(
self.microscope_handler.metadata_handler.get_pixel_size(self.plate_path)
)
Expand Down Expand Up @@ -358,6 +358,10 @@ def load_image(
filemanager=self.filemanager,
source_address=source_path,
).metadata(image)
if not metadata.source_voxel_spacing.has_values:
metadata = metadata.with_source_spatial_context_from(
self.plate_image_metadata()
)
return metadata.payload_with(
image_payload_data(image), image_payload_mask(image)
)
Expand Down Expand Up @@ -844,7 +848,7 @@ def stream_rois(
),
).with_item_fields(
StreamImagePayloadMetadataProjector.item_fields(
self.source.roi_image_metadata(),
self.source.plate_image_metadata(),
message_authority.layout.component_order,
)
)
Expand Down
Loading
Loading