Skip to content

Commit

Permalink
Use JPype's @ operator to create Java arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
elevans authored and gselzer committed Jan 7, 2025
1 parent 266a61f commit 1b192f6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/test_image_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pytest
import scyjava as sj
import xarray as xr
from jpype import JArray, JLong
from jpype import JLong

import imagej.convert as convert
import imagej.dims as dims
Expand Down Expand Up @@ -379,8 +379,7 @@ def test_dataset_converts_to_xarray(ij):

def test_bittype_img_to_ndarray(ij):
ArrayImgs = sj.jimport("net.imglib2.img.array.ArrayImgs")
dims = JArray(JLong)(3)
dims[:] = [10, 10, 10]
dims = JLong[:] @ [10, 10, 10]
j_img = ArrayImgs.bits(dims)
p_img = ij.py.from_java(j_img)
assert p_img.dtype == np.bool_
Expand Down

0 comments on commit 1b192f6

Please sign in to comment.