Skip to content

Converting between xarray and dataset should convert attrs types better #200

@ctrueden

Description

@ctrueden
>>> import imagej
>>> ij = imagej.init()
>>> d = ij.io().open('/home/curtis/data/blobs.tif')
>>> d
<java object 'net.imagej.DefaultDataset'>
>>> ij.py.from_java(d)
<xarray.DataArray (row: 254, col: 256)>
array([[ 40,  32,  24, ..., 216, 200, 200],
       [ 56,  40,  24, ..., 232, 216, 216],
       [ 64,  48,  24, ..., 240, 232, 232],
       ...,
       [ 72,  80,  80, ...,  48,  48,  48],
       [ 80,  80,  80, ...,  48,  48,  48],
       [ 96,  88,  80, ...,  48,  48,  48]], dtype=uint8)
Coordinates:
  * row      (row) float64 0.0 1.0 2.0 3.0 4.0 ... 249.0 250.0 251.0 252.0 253.0
  * col      (col) float64 0.0 1.0 2.0 3.0 4.0 ... 251.0 252.0 253.0 254.0 255.0
Attributes:
    rois:                    None
    tables:                  None
    scifio.metadata.image:   io.scif.FieldPrinter@661c46bc\n\t--class io.scif...
    scifio.metadata.global:  io.scif.filters.PlaneSeparatorMetadata@37864b77

Note poor stringification of scifio.metadata.image and scifio.metadata.global data structures above.

See also spatial-image/multiscale-spatial-image#23

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions