Skip to content

Conversation

@thewtex
Copy link
Member

@thewtex thewtex commented May 19, 2022

2D, uint8 pixel and 3 or 4 components -> Assume we want to render like
an RGB / RGBA.

2D, uint8 pixel and 3 or 4 components -> Assume we want to render like
an RGB / RGBA.
@thewtex thewtex requested a review from PaulHax May 19, 2022 00:47
@thewtex
Copy link
Member Author

thewtex commented May 19, 2022

@PaulHax I did not test this -- are any of the testing datasets we have relevant?

@PaulHax
Copy link
Collaborator

PaulHax commented May 19, 2022

The removed logo.zarr matched that signature.

@PaulHax
Copy link
Collaborator

PaulHax commented May 19, 2022

Swapped in this

const computePixelType = (components, arrayShape, componentType) => {
  // is 2D and unsigned 8 bit?  (arrayShape.get('z') may be 1)
  if ((arrayShape.get('z') ?? 1) === 1 && componentType === IntTypes.UInt8) {
    if (components === 3) return PixelTypes.RGB
    if (components === 4) return PixelTypes.RGBA
  }
  return components > 1 ? PixelTypes.VariableLengthVector : PixelTypes.Scalar
}

Here


  const componentType = getComponentType(info.pixelArrayMetadata.dtype)

  const pixelType = computePixelType(components, info.arrayShape, componentType)

  const imageType = {

gets me a logo.zarr like this:
Screenshot from 2022-05-19 09-45-05

Just lines, like I was seeing before this last Zarr effort.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants