Skip to content

Commit

Permalink
Define metadata within kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
gselzer committed May 31, 2023
1 parent 66b0a28 commit 096ee03
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/napari_imagej/types/converters/images.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,10 @@ def _java_image_to_image_layer(image: Any) -> Image:
view = ij().convert().convert(image, jc.DatasetView)
# Construct an xarray from the DatasetView
xarr: DataArray = java_to_xarray(ij(), view.getData())
# Construct metadata
metadata = getattr(xarr, "attrs", {}).copy()
metadata["dims"] = xarr.dims
metadata["coords"] = xarr.coords
# Construct a map of Image layer parameters
kwargs = dict(
data=xarr,
metadata=metadata,
metadata=getattr(xarr, "attrs", {}),
name=view.getData().getName(),
)
if view.getColorTables() and view.getColorTables().size() > 0:
Expand Down

0 comments on commit 096ee03

Please sign in to comment.