Skip to content

Commit

Permalink
Advanced image transfer: wrap Points in ROITrees
Browse files Browse the repository at this point in the history
  • Loading branch information
gselzer committed Nov 5, 2024
1 parent e2a9325 commit d3b0787
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/napari_imagej/widgets/widget_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,13 @@ def pass_to_ij():
img, dim_order=self.dims_container.provided_labels()
)
if roi:
j_img.getProperties().put("rois", nij.ij.py.to_java(roi))
if isinstance(roi, Points):
j_point = nij.ij.py.to_java(roi)
j_roi = jc.DefaultROITree()
j_roi.addROIs(jc.ArrayList([j_point]))
else:
j_roi = nij.ij.py.to_java(roi)
j_img.getProperties().put("rois", j_roi)
# Show the resulting image
nij.ij.ui().show(j_img)

Expand Down

0 comments on commit d3b0787

Please sign in to comment.