rapidsai / cucim

cuCIM - RAPIDS GPU-accelerated image processing library
https://docs.rapids.ai/api/cucim/stable/
Apache License 2.0
359 stars 61 forks source link

[FEA] Support Leica SCN format #143

Open JosephRyanPeterson opened 3 years ago

JosephRyanPeterson commented 3 years ago

Is your feature request related to a problem? Please describe. Leica SCN format is a popular digital pathology image format. Files are commonly found in lab settings. Support for SCN would be necessary to allow adoption of digital pathology solutions in many hospital networks.

SCN is a single-file pyramidal tiled BigTIFF with non-standard metadata stored as XML. It supports brightfield, flourescence, and z-stacking. Data is stored with JPEG compression.

One tricky issue is that an SCN file may contain multiple regions, which appear as multiple main images, with different image acquisition parameters. This is an ongoing issue for OpenSlide.

Example slides can be found on the OpenSlide example repository.

Describe the solution you'd like Implement SCN. Support for just a single region would be sufficient, but ultimately, support for multiple regions would be ideal.

Additional context Example metadata for a multi-region SCN file can be found below (with UID data censored):

<?xml version="1.0" encoding="utf-8"?>
<scn xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.leica-microsystems.com/scn/2010/10/01 scn.xsd" uuid="urn:uuid:<UID Censored>" xmlns="http://www.leica-microsystems.com/scn/2010/10/01">
  <collection name="" uuid="urn:uuid:<UID Censored>" sizeX="25000000" sizeY="75000000">
    <image name="Stitch<UID Censored>" uuid="urn:uuid:<UID Censored>">
      <creationDate>2021-07-16T16:35:58Z</creationDate>
      <device model="Versa" version="1.0" />
      <pixels sizeX="5732" sizeY="12884">
        <dimension sizeX="5732" sizeY="12884" r="0" z="0" ifd="0" />
        <dimension sizeX="2866" sizeY="6442" r="1" z="0" ifd="1" />
        <dimension sizeX="1433" sizeY="3221" r="2" z="0" ifd="2" />
        <dimension sizeX="716" sizeY="1610" r="3" z="0" ifd="3" />
        <dimension sizeX="358" sizeY="805" r="4" z="0" ifd="4" />
        <dimension sizeX="179" sizeY="402" r="5" z="0" ifd="5" />
      </pixels>
      <view sizeX="25000000" sizeY="56000000" offsetX="0" offsetY="1000000" spacingZ="0" />
      <scanSettings>
        <objectiveSettings>
          <objective>1.25</objective>
          <configuration>PLFL-DRY</configuration>
        </objectiveSettings>
        <illuminationSettings>
          <numericalAperture>0</numericalAperture>
          <illuminationSource>brightfield</illuminationSource>
        </illuminationSettings>
      </scanSettings>
    </image>
    <image name="Stitch<UID Censored>" uuid="urn:uuid:<UID Censored>">
      <creationDate>2021-07-16T23:42:09Z</creationDate>
      <device model="Versa" version="1.0" />
      <pixels sizeX="70150" sizeY="70754">
        <dimension sizeX="70150" sizeY="70754" r="0" z="0" ifd="7" />
        <dimension sizeX="35075" sizeY="35377" r="1" z="0" ifd="8" />
        <dimension sizeX="17537" sizeY="17688" r="2" z="0" ifd="9" />
        <dimension sizeX="8768" sizeY="8844" r="3" z="0" ifd="10" />
        <dimension sizeX="4384" sizeY="4422" r="4" z="0" ifd="11" />
        <dimension sizeX="2192" sizeY="2211" r="5" z="0" ifd="12" />
        <dimension sizeX="1096" sizeY="1105" r="6" z="0" ifd="13" />
        <dimension sizeX="548" sizeY="552" r="7" z="0" ifd="14" />
        <dimension sizeX="274" sizeY="276" r="8" z="0" ifd="15" />
      </pixels>
      <view sizeX="9573374" sizeY="9660063" offsetX="10902760" offsetY="24677984" spacingZ="0" />
      <scanSettings>
        <objectiveSettings>
          <objective>40</objective>
          <configuration>PLAPO-DRY-MEDIUM</configuration>
        </objectiveSettings>
        <illuminationSettings>
          <numericalAperture>0</numericalAperture>
          <illuminationSource>brightfield</illuminationSource>
        </illuminationSettings>
      </scanSettings>
    </image>
    <image name="Stitch<UID Censored>" uuid="urn:uuid:<UID Censored>">
      <creationDate>2021-07-16T23:49:59Z</creationDate>
      <device model="Versa" version="1.0" />
      <pixels sizeX="16294" sizeY="17892">
        <dimension sizeX="16294" sizeY="17892" r="0" z="0" ifd="16" />
        <dimension sizeX="8147" sizeY="8946" r="1" z="0" ifd="17" />
        <dimension sizeX="4073" sizeY="4473" r="2" z="0" ifd="18" />
        <dimension sizeX="2036" sizeY="2236" r="3" z="0" ifd="19" />
        <dimension sizeX="1018" sizeY="1118" r="4" z="0" ifd="20" />
        <dimension sizeX="509" sizeY="559" r="5" z="0" ifd="21" />
        <dimension sizeX="254" sizeY="279" r="6" z="0" ifd="22" />
      </pixels>
      <view sizeX="2223657" sizeY="2442758" offsetX="8012074" offsetY="25532117" spacingZ="0" />
      <scanSettings>
        <objectiveSettings>
          <objective>40</objective>
          <configuration>PLAPO-DRY-MEDIUM</configuration>
        </objectiveSettings>
        <illuminationSettings>
          <numericalAperture>0</numericalAperture>
          <illuminationSource>brightfield</illuminationSource>
        </illuminationSettings>
      </scanSettings>
    </image>
    <supplementalImage type="label" ifd="6" />
  </collection>
</scn>
gigony commented 3 years ago

Thanks @JosephRyanPeterson for creating the issue with useful information! We would consider supporting Leica SCN format once other features (https://github.com/rapidsai/cucim/projects/5) scheduled are implemented (we also have a plan to support Ventana .bif with a higher priority). Thank you!

fmhoward commented 3 years ago

Our group would appreciate Leica SCN format support, thank you for considering!

carlosmacarro commented 4 months ago

Any news about this feature request? We will also benefit a lot from it, even if only support for just a single region is implemented.