Sakura format

Format
SQLite database containing pyramid tiles and metadata
File extensions
.svslide
OpenSlide vendor backend
sakura

Detection

OpenSlide will detect a file as Sakura if:

  1. The file is a SQLite database.
  2. The DataManagerSQLiteConfigXPO table contains exactly one row, and its TableName field refers to a unique table.
  3. The unique table contains a row with id = "++MagicBytes" and data = "SVGigaPixelImage".

File Organization

Sakura slides are SQLite 3 database files written by the eXpress Persistent Objects ORM. Tables contain slide metadata, associated images, and JPEG tiles. Tiles are addressed as (focal plane, downsample, level-0 X coordinate, level-0 Y coordinate, color channel), with separate grayscale JPEGs for each color channel. Despite the generality of the address format, tiles appear to be organized in a regular grid, with power-of-two level downsamples and without overlapping tiles. The structure of the file allows scans to be sparse, but it is not clear if this is actually done.

SQL Tables

Some irrelevant tables and columns have been omitted from the summary below.

DataManagerSQLiteConfigXPO

Useful only to get a reference to the unique table. OpenSlide requires this table to contain exactly one row.

ColumnTypeDescription
TableNametextName of the unique table, described below

SVSlideDataXPO

High-level metadata about a slide. OpenSlide assumes this table will contain exactly one row.

ColumnTypeDescription
OIDintegerPrimary key
m_labelScanintegerForeign key to label associated image in SVScannedImageDataXPO
m_overviewScanintegerForeign key to macro associated image in SVScannedImageDataXPO
SlideIdtextUUID
DatetextFile creation date?
DescriptiontextDescriptive text?
CreatortextAuthor?
DiagnosisCodetextUnknown, have seen “0”
HRScanCountintegerPresumably the number of corresponding rows in SVHRScanDataXPO
KeywordstextDescriptive text?
TotalDataSizeBytesintegerPresumably the sum of TotalDataSizeBytes in corresponding SVHRScanDataXPO rows

SVHRScanDataXPO

A single high-resolution scan of a slide from SVSlideDataXPO. OpenSlide assumes this table will contain exactly one row.

ColumnTypeDescription
OIDintegerPrimary key
ParentSlideintegerForeign key to SVSlideDataXPO
ScanIdtextUUID
DatetextScan date?
DescriptiontextDescriptive text?
NametextScan name?
PosOnSlideMmblob16 bytes of binary
ResolutionMmPerPixrealMillimeters per pixel
NominalLensMagnificationrealObjective power
ThumbnailImageblobthumbnail associated image data
TotalDataSizeBytesintegerSame as TOTAL_SIZE blob in unique table
FocussingMethodintegerUnknown; have seen “1”
FocusStackblob8 bytes of binary per focal plane; the center focal plane apparently has all zeroes

SVScannedImageDataXPO

Contains associated images other than the thumbnail.

ColumnTypeDescription
OIDintegerPrimary key
IdtextUUID
PosOnSlideMmblob16 bytes of binary
ScanCenterPosMmblob16 bytes of binary
ResolutionMmPerPixrealMillimeters per pixel
ImageblobJPEG image data
ThumbnailImageblobLow-resolution JPEG thumbnail

tile

This table is most naturally used to map tile coordinates to tile IDs, but is not suitable for individual lookups because it has no useful indexes. In addition, some Sakura slides don’t have it. OpenSlide ignores the table and constructs tile IDs directly from tile coordinates.

ColumnTypeDescription
TILEIDtextForeign key to unique table
PYRAMIDLEVELintegerDownsample of the pyramid level
COLUMNINDEXintegerLevel-0 X coordinate of the top-left corner of the tile
ROWINDEXintegerLevel-0 Y coordinate of the top-left corner of the tile
COLORINDEXinteger0 for red, 1 for green, 2 for blue

Unique table

This is the table named by DataManagerSQLiteConfigXPO.TableName. It contains named blobs including the JPEG tile data.

ColumnTypeDescription
idtextPrimary key
sizeintegerLength of data field
datablobData item

This table stores a variety of blob types.

idDescription
++MagicBytesSVGigaPixelImage
++VersionBytesFormat version, e.g. 1.0.0
HeaderSee below
TOTAL_SIZEThe data field is empty. The size field is the sum of all other size fields except ++MagicBytes and ++VersionBytes.
T;2048|4096;4;2;0Image tile with downsample 4, X coordinate 2048, Y coordinate 4096, channel 2 (blue), focal plane 0
T;2048|4096;4;2;0#MD5 hash of the T;2048|4096;4;2;0 image tile
Header blob

The Header blob is a small binary structure containing little-endian integers as follows:

OffsetSizeDescription
04Tile size in pixels
44Image width in pixels
84Image height in pixels
124Unknown; have seen “8” (bits per channel?)
164Number of focal planes
204Unknown; have seen “3” (number of channels?)
244Unknown; have seen “1”
282Unknown; have seen “256”
304Unknown; have seen “1”
344Unknown; have seen “2”
384Unknown; have seen “3”
424Unknown; have seen “4”
464Unknown; have seen “5”
504Unknown; have seen “6”

Associated Images

label
SVScannedImageDataXPO.Image corresponding to SVSlideDataXPO.m_labelScan
macro
SVScannedImageDataXPO.Image corresponding to SVSlideDataXPO.m_overviewScan
thumbnail
SVHRScanDataXPO.ThumbnailImage

Known Properties

sakura.Creator
SVSlideDataXPO.Creator
sakura.Date
SVSlideDataXPO.Date
sakura.Description
SVSlideDataXPO.Description
sakura.DiagnosisCode
SVSlideDataXPO.DiagnosisCode
sakura.FocussingMethod
SVHRScanDataXPO.FocussingMethod
sakura.Keywords
SVSlideDataXPO.Keywords
sakura.NominalLensMagnification
SVHRScanDataXPO.NominalLensMagnification
sakura.ResolutionMmPerPix
SVHRScanDataXPO.ResolutionMmPerPix
sakura.ScanId
SVHRScanDataXPO.ScanId
sakura.SlideId
SVSlideDataXPO.SlideId
openslide.mpp-x
calculated as 1000 * sakura.ResolutionMmPerPix
openslide.mpp-y
calculated as 1000 * sakura.ResolutionMmPerPix
openslide.objective-power
normalized sakura.NominalLensMagnification

Test Data

No public data available. Contact the mailing list if you have some.