Skip to content

Commit c4ac3fe

Browse files
committed
Use each ROI's limits in its dedicated plane
1 parent d749e2f commit c4ac3fe

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/silverlabnwb/rois.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,12 @@ def get_roi_imaging_plane(self, roi_number, plane_name, nwb_file):
197197
z_plane = nwb_file.nwb_file.processing['Acquired_ROIs'].get("ImageSegmentation")[plane_name].imaging_plane
198198
new_plane_name = z_plane.name + '_ROI_' + str(roi_number)
199199
if new_plane_name not in nwb_file.nwb_file.imaging_planes.keys():
200+
# Use the start coordinates as recorded in the ROI table
201+
origin = [self.roi_data[f'{dim}_start'][roi_num] for dim in ['x', 'y', 'z']]
200202
nwb_file.add_imaging_plane(
201203
name=new_plane_name,
202204
description='Imaging plane for variable size ROI nr. ' + str(roi_number),
203-
origin_coords=z_plane.origin_coords,
205+
origin_coords=origin,
204206
grid_spacing=z_plane.grid_spacing*resolution
205207
)
206208
return nwb_file.nwb_file.imaging_planes[new_plane_name]

0 commit comments

Comments
 (0)