Kitware / UPennContrast

UPenn ?
https://upenn-contrast.netlify.com/
Apache License 2.0
8 stars 6 forks source link

Import RGB files #594

Open arjunrajlab opened 11 months ago

arjunrajlab commented 11 months ago

Would be great to import RGB histology files. It sounded like the easiest way to do this would be to create a multi-source JSON (I think, if I understood correctly) that would split up the file into channels (R, G, B). These channels would then be just imported as individual layers. which then could be put together as a grouped layer.

manthey commented 11 months ago

When the metadata for a WSI file returns a bandCount other than 1, then these can be used as multiple channels. For example, using one the TCGA svs files, the multi source yaml file might look like this:

---
  sources:
    - path: ./TCGA-02-0010-01Z-00-DX4.07de2e55-a8fe-40ee-9e98-bcb78050b9f7.svs
      style: {"bands": [{"band": 1}]}
      c: 0
      channel: "red"
    - path: ./TCGA-02-0010-01Z-00-DX4.07de2e55-a8fe-40ee-9e98-bcb78050b9f7.svs
      style: {"bands": [{"band": 2}]}
      c: 1
      channel: "green"
    - path: ./TCGA-02-0010-01Z-00-DX4.07de2e55-a8fe-40ee-9e98-bcb78050b9f7.svs
      style: {"bands": [{"band": 3}]}
      c: 2
      channel: "blue"

Note that bands are numbered starting at 1 (blame the geospatial community), but we start channels at 0.