0

I'm using openslide-python to read whole slide images in the Mirax format (mrxs). Now I'd like to replace the "label" barcode image with a custom one. Unfortunately,

f.associated_images["label"] = label_new

raises

TypeError: '_AssociatedImageMap' object does not support item assignment

I found that the "label" reference is stored in the image-associated slidedat.ini file

NONHIER_0_VAL_3 = ScanDataLayer_SlideBarcode

But I am not sure what to do with this information.

Any help would be appreciated!

Mario

Mario Kreutzfeldt
  • 559
  • 2
  • 5
  • 13

1 Answers1

0

openslide is reading library, not writing.

You need to create writing library for MIRAX support yourself.

In Dataxxx.dat you keep MIRAX header and image data (in jpg or png format). In Index.dat you keep information about dat file (file index and file size) In Slidedat.ini you put information about your barcode image:

NONHIER_0_VAL_3 = ScanDataLayer_SlideBarcode
NONHIER_0_VAL_3_SECTION = NONHIERLAYER_0_LEVEL_3_SECTION
NONHIER_0_VAL_3_IMAGENUMBER_X = 1
NONHIER_0_VAL_3_IMAGENUMBER_Y = 1

and

[NONHIERLAYER_0_LEVEL_3_SECTION]
BARCODE_IMAGE_TYPE = JPEG
BARCODE_IMAGE_WIDTH = 1782
BARCODE_IMAGE_HEIGHT = 1252