Skip to content

Commit

Permalink
Merge pull request #306 from imagej/point-permutations-gui
Browse files Browse the repository at this point in the history
Attach Points as ROI in Data Translation
  • Loading branch information
gselzer authored Dec 19, 2024
2 parents 5bb3441 + 1f2d8cb commit 814479c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/napari_imagej/java.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
# Versions above are easier for inclusion of scifio-labeling
# https://github.com/imagej/pyimagej/issues/280
"net.imagej:imagej": "2.10.0",
# Enable visualizing Datasets with DefaultROITrees
# https://github.com/imagej/imagej-legacy/pull/300
"net.imagej:imagej-legacy": "1.2.1",
# Removes ClassCastExceptions in Point layer translation
# https://github.com/imagej/imagej-legacy/pull/310
"net.imagej:imagej-legacy": "2.0.0",
# Enables threshold Ops to return Images of BooleanTypes
# https://github.com/imagej/imagej-ops/pull/651
"net.imagej:imagej-ops": "2.0.1",
Expand Down
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 @@ -299,7 +299,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 814479c

Please sign in to comment.