Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use a pyvips in python to generate tiff format from mrxs #498

Open
Fighting-bruceCHN opened this issue Aug 27, 2024 · 9 comments
Open

Comments

@Fighting-bruceCHN
Copy link

Hi,
i want to ask if there is a method in pyvips that i can use to transfer a wsi image in mrxs format to the tiff format

Thank you su much for the help

@jcupitt
Copy link
Member

jcupitt commented Aug 27, 2024

Hello @Fighting-bruceCHN,

Yes, they work like any other image format, so maybe:

image = pyvips.Image.new_from_file("xxxx.mrxs")
image.write_to_file("yyyy.tif")

You'll probably want a certain type of tiff, perhaps:

image.write_to_file("yyyy.tif", compression="jpeg", tile=True, pyramid=True)

@Fighting-bruceCHN
Copy link
Author

Thank you for your help,
I have tried your code, does the result it produced a multi level tif or does it only contain certain level, my original mrxs cotains 9 levels, how can i edit the code so that it create a certain level tiles.?
And also when i use image.write_to_file("yyyy.tif"), it produce a tif. file in size 65.3 GB.
image.write_to_file("yyyy.tif", compression="jpeg", tile=True, pyramid=True) produce a file in 1.03gb

@jcupitt
Copy link
Member

jcupitt commented Aug 28, 2024

By default, libvips will open the highest resolution level. You can select a level from the MRXS file with the level= option, perhaps:

image = pyvips.Image.new_from_file("xxxx.mrxs")

When saving a TIFF, by default libvips will write a single uncompressed striped image. You can write other types of TIFF with the various save options.

MRXS files always contain the entire slide area, even if the specimen is much smaller, so there is a lot of wasted space. You can use the autocrop option to only load the specimen area.

I suggest:

image = pyvips.Image.new_from_file("xxxx.mrxs", autocrop=True)
image.write_to_file("yyyy.tif", compression="jpeg", Q=85, tile=True, pyramid=True)

The documentation has all the details:

https://www.libvips.org/API/current/VipsForeignSave.html#vips-openslideload

https://www.libvips.org/API/current/VipsForeignSave.html#vips-tiffsave

@jcupitt
Copy link
Member

jcupitt commented Aug 28, 2024

The vipsheader program can be useful. For example:

$ vipsheader -a CMU-3.mrxs
CMU-3.mrxs: 109240x220696 uchar, 4 bands, srgb, openslideload
width: 109240
height: 220696
bands: 4
format: uchar
coding: none
interpretation: srgb
xoffset: 0
yoffset: 0
xres: 4301.08
yres: 4301.08
filename: CMU-3.mrxs
vips-loader: openslideload
slide-level: 0
mirax.DATAFILE.FILE_0: Data0000.dat
mirax.DATAFILE.FILE_1: Data0001.dat
mirax.DATAFILE.FILE_10: Data0010.dat
mirax.DATAFILE.FILE_11: Data0011.dat
mirax.DATAFILE.FILE_12: Data0012.dat
mirax.DATAFILE.FILE_13: Data0013.dat
mirax.DATAFILE.FILE_14: Data0014.dat
mirax.DATAFILE.FILE_15: Data0015.dat
mirax.DATAFILE.FILE_16: Data0016.dat
mirax.DATAFILE.FILE_17: Data0017.dat
mirax.DATAFILE.FILE_18: Data0018.dat
mirax.DATAFILE.FILE_19: Data0019.dat
mirax.DATAFILE.FILE_2: Data0002.dat
mirax.DATAFILE.FILE_20: Data0020.dat
mirax.DATAFILE.FILE_21: Data0021.dat
mirax.DATAFILE.FILE_22: Data0022.dat
mirax.DATAFILE.FILE_3: Data0003.dat
mirax.DATAFILE.FILE_4: Data0004.dat
mirax.DATAFILE.FILE_5: Data0005.dat
mirax.DATAFILE.FILE_6: Data0006.dat
mirax.DATAFILE.FILE_7: Data0007.dat
mirax.DATAFILE.FILE_8: Data0008.dat
mirax.DATAFILE.FILE_9: Data0009.dat
mirax.DATAFILE.FILE_COUNT: 23
mirax.GENERAL.ADAPTER_SIZE: 1
mirax.GENERAL.CAMERA_TYPE: Hitachi_HV_F22CL
mirax.GENERAL.CURRENT_SLIDE_VERSION: 1.9
mirax.GENERAL.CameraImageDivisionsPerSide: 4
mirax.GENERAL.IMAGENUMBER_X: 352
mirax.GENERAL.IMAGENUMBER_Y: 976
mirax.GENERAL.IMAGE_OVERLAP_MICROMETERS_X: 0
mirax.GENERAL.IMAGE_OVERLAP_MICROMETERS_Y: 0
mirax.GENERAL.OBJECTIVE_MAGNIFICATION: 20
mirax.GENERAL.OBJECTIVE_NAME: Default objective
mirax.GENERAL.OPTOVAR_SIZE: 1
mirax.GENERAL.PROJECT_NAME: ProjectName
mirax.GENERAL.SLIDE_CONTENT: DIGITAL_SLIDE
mirax.GENERAL.SLIDE_CREATIONDATETIME: 29/12/2009 13:06:34
mirax.GENERAL.SLIDE_ID: 055C060128414D858E65DBDCE7B2BB01
mirax.GENERAL.SLIDE_NAME: CMU-3
mirax.GENERAL.SLIDE_POSITION_X: 0
mirax.GENERAL.SLIDE_POSITION_Y: 0
mirax.GENERAL.SLIDE_TYPE: SLIDE_TYPE_BRIGHTFIELD
mirax.GENERAL.SLIDE_VERSION: 01.02
mirax.HIERARCHICAL.HIER_0_COUNT: 10
mirax.HIERARCHICAL.HIER_0_DEFAULT: 0
mirax.HIERARCHICAL.HIER_0_NAME: Slide zoom level
mirax.HIERARCHICAL.HIER_0_SECTION: LAYER_0_SECTION
mirax.HIERARCHICAL.HIER_0_VAL_0: ZoomLevel_0
mirax.HIERARCHICAL.HIER_0_VAL_0_SECTION: LAYER_0_LEVEL_0_SECTION
mirax.HIERARCHICAL.HIER_0_VAL_1: ZoomLevel_1
mirax.HIERARCHICAL.HIER_0_VAL_1_SECTION: LAYER_0_LEVEL_1_SECTION
mirax.HIERARCHICAL.HIER_0_VAL_2: ZoomLevel_2
mirax.HIERARCHICAL.HIER_0_VAL_2_SECTION: LAYER_0_LEVEL_2_SECTION
mirax.HIERARCHICAL.HIER_0_VAL_3: ZoomLevel_3
mirax.HIERARCHICAL.HIER_0_VAL_3_SECTION: LAYER_0_LEVEL_3_SECTION
mirax.HIERARCHICAL.HIER_0_VAL_4: ZoomLevel_4
mirax.HIERARCHICAL.HIER_0_VAL_4_SECTION: LAYER_0_LEVEL_4_SECTION
mirax.HIERARCHICAL.HIER_0_VAL_5: ZoomLevel_5
mirax.HIERARCHICAL.HIER_0_VAL_5_SECTION: LAYER_0_LEVEL_5_SECTION
mirax.HIERARCHICAL.HIER_0_VAL_6: ZoomLevel_6
mirax.HIERARCHICAL.HIER_0_VAL_6_SECTION: LAYER_0_LEVEL_6_SECTION
mirax.HIERARCHICAL.HIER_0_VAL_7: ZoomLevel_7
mirax.HIERARCHICAL.HIER_0_VAL_7_SECTION: LAYER_0_LEVEL_7_SECTION
mirax.HIERARCHICAL.HIER_0_VAL_8: ZoomLevel_8
mirax.HIERARCHICAL.HIER_0_VAL_8_SECTION: LAYER_0_LEVEL_8_SECTION
mirax.HIERARCHICAL.HIER_0_VAL_9: ZoomLevel_9
mirax.HIERARCHICAL.HIER_0_VAL_9_SECTION: LAYER_0_LEVEL_9_SECTION
mirax.HIERARCHICAL.HIER_1_COUNT: 3
mirax.HIERARCHICAL.HIER_1_DEFAULT: 0
mirax.HIERARCHICAL.HIER_1_NAME: Slide filter level
mirax.HIERARCHICAL.HIER_1_SECTION: LAYER_1_SECTION
mirax.HIERARCHICAL.HIER_1_VAL_0: FilterLevel_0
mirax.HIERARCHICAL.HIER_1_VAL_0_SECTION: LAYER_1_LEVEL_0_SECTION
mirax.HIERARCHICAL.HIER_1_VAL_1: FilterLevel_1
mirax.HIERARCHICAL.HIER_1_VAL_1_SECTION: LAYER_1_LEVEL_1_SECTION
mirax.HIERARCHICAL.HIER_1_VAL_2: FilterLevel_2
mirax.HIERARCHICAL.HIER_1_VAL_2_SECTION: LAYER_1_LEVEL_2_SECTION
mirax.HIERARCHICAL.HIER_2_COUNT: 2
mirax.HIERARCHICAL.HIER_2_DEFAULT: 0
mirax.HIERARCHICAL.HIER_2_NAME: Scan info layer
mirax.HIERARCHICAL.HIER_2_SECTION: LAYER_2_SECTION
mirax.HIERARCHICAL.HIER_2_VAL_0: ScanInfoLayer_DefaultLevel
mirax.HIERARCHICAL.HIER_2_VAL_0_SECTION: LAYER_2_LEVEL_0_SECTION
mirax.HIERARCHICAL.HIER_2_VAL_1: ScanInfoLayer_XMLInfoLevel
mirax.HIERARCHICAL.HIER_2_VAL_1_SECTION: LAYER_2_LEVEL_1_SECTION
mirax.HIERARCHICAL.HIER_COUNT: 3
mirax.HIERARCHICAL.INDEXFILE: Index.dat
mirax.HIERARCHICAL.NONHIER_0_COUNT: 10
mirax.HIERARCHICAL.NONHIER_0_NAME: Scan data layer
mirax.HIERARCHICAL.NONHIER_0_SECTION: NONHIERLAYER_0_SECTION
mirax.HIERARCHICAL.NONHIER_0_VAL_0: ScanDataLayer_ScanMap
mirax.HIERARCHICAL.NONHIER_0_VAL_0_IMAGENUMBER_X: 1
mirax.HIERARCHICAL.NONHIER_0_VAL_0_IMAGENUMBER_Y: 1
mirax.HIERARCHICAL.NONHIER_0_VAL_0_SECTION: NONHIERLAYER_0_LEVEL_0_SECTION
mirax.HIERARCHICAL.NONHIER_0_VAL_1: ScanDataLayer_XMLInfoHeader
mirax.HIERARCHICAL.NONHIER_0_VAL_1_IMAGENUMBER_X: 1
mirax.HIERARCHICAL.NONHIER_0_VAL_1_IMAGENUMBER_Y: 1
mirax.HIERARCHICAL.NONHIER_0_VAL_1_SECTION: NONHIERLAYER_0_LEVEL_1_SECTION
mirax.HIERARCHICAL.NONHIER_0_VAL_2: ScanDataLayer_SlideThumbnail
mirax.HIERARCHICAL.NONHIER_0_VAL_2_IMAGENUMBER_X: 1
mirax.HIERARCHICAL.NONHIER_0_VAL_2_IMAGENUMBER_Y: 1
mirax.HIERARCHICAL.NONHIER_0_VAL_2_SECTION: NONHIERLAYER_0_LEVEL_2_SECTION
mirax.HIERARCHICAL.NONHIER_0_VAL_3: ScanDataLayer_SlideBarcode
mirax.HIERARCHICAL.NONHIER_0_VAL_3_IMAGENUMBER_X: 1
mirax.HIERARCHICAL.NONHIER_0_VAL_3_IMAGENUMBER_Y: 1
mirax.HIERARCHICAL.NONHIER_0_VAL_3_SECTION: NONHIERLAYER_0_LEVEL_3_SECTION
mirax.HIERARCHICAL.NONHIER_0_VAL_4: ScanDataLayer_SlidePreview
mirax.HIERARCHICAL.NONHIER_0_VAL_4_IMAGENUMBER_X: 1
mirax.HIERARCHICAL.NONHIER_0_VAL_4_IMAGENUMBER_Y: 1
mirax.HIERARCHICAL.NONHIER_0_VAL_4_SECTION: NONHIERLAYER_0_LEVEL_4_SECTION
mirax.HIERARCHICAL.NONHIER_0_VAL_5: ScanDataLayer_StagePositionMap
mirax.HIERARCHICAL.NONHIER_0_VAL_5_IMAGENUMBER_X: 1
mirax.HIERARCHICAL.NONHIER_0_VAL_5_IMAGENUMBER_Y: 1
mirax.HIERARCHICAL.NONHIER_0_VAL_5_SECTION: NONHIERLAYER_0_LEVEL_5_SECTION
mirax.HIERARCHICAL.NONHIER_0_VAL_6: ScanDataLayer_Empty
mirax.HIERARCHICAL.NONHIER_0_VAL_6_IMAGENUMBER_X: 1
mirax.HIERARCHICAL.NONHIER_0_VAL_6_IMAGENUMBER_Y: 1
mirax.HIERARCHICAL.NONHIER_0_VAL_6_SECTION: NONHIERLAYER_0_LEVEL_6_SECTION
mirax.HIERARCHICAL.NONHIER_0_VAL_7: ProfileXMLHeader
mirax.HIERARCHICAL.NONHIER_0_VAL_7_IMAGENUMBER_X: 1
mirax.HIERARCHICAL.NONHIER_0_VAL_7_IMAGENUMBER_Y: 1
mirax.HIERARCHICAL.NONHIER_0_VAL_7_SECTION: NONHIERLAYER_0_LEVEL_7_SECTION
mirax.HIERARCHICAL.NONHIER_0_VAL_8: ProfileXML
mirax.HIERARCHICAL.NONHIER_0_VAL_8_IMAGENUMBER_X: 1
mirax.HIERARCHICAL.NONHIER_0_VAL_8_IMAGENUMBER_Y: 1
mirax.HIERARCHICAL.NONHIER_0_VAL_8_SECTION: NONHIERLAYER_0_LEVEL_8_SECTION
mirax.HIERARCHICAL.NONHIER_0_VAL_9: ScannedFOVsMap
mirax.HIERARCHICAL.NONHIER_0_VAL_9_IMAGENUMBER_X: 1
mirax.HIERARCHICAL.NONHIER_0_VAL_9_IMAGENUMBER_Y: 1
mirax.HIERARCHICAL.NONHIER_0_VAL_9_SECTION: NONHIERLAYER_0_LEVEL_9_SECTION
mirax.HIERARCHICAL.NONHIER_1_COUNT: 1
mirax.HIERARCHICAL.NONHIER_1_NAME: VIMSLIDE_HISTOGRAM_DATA
mirax.HIERARCHICAL.NONHIER_1_SECTION: NONHIERLAYER_1_SECTION
mirax.HIERARCHICAL.NONHIER_1_VAL_0: default
mirax.HIERARCHICAL.NONHIER_1_VAL_0_IMAGENUMBER_X: 1
mirax.HIERARCHICAL.NONHIER_1_VAL_0_IMAGENUMBER_Y: 1
mirax.HIERARCHICAL.NONHIER_1_VAL_0_SECTION: NONHIERLAYER_1_LEVEL_0_SECTION
mirax.HIERARCHICAL.NONHIER_2_COUNT: 1
mirax.HIERARCHICAL.NONHIER_2_NAME: StitchingLayer
mirax.HIERARCHICAL.NONHIER_2_SECTION: NONHIERLAYER_2_SECTION
mirax.HIERARCHICAL.NONHIER_2_VAL_0: DataLevel_V1.0
mirax.HIERARCHICAL.NONHIER_2_VAL_0_IMAGENUMBER_X: 1
mirax.HIERARCHICAL.NONHIER_2_VAL_0_IMAGENUMBER_Y: 1
mirax.HIERARCHICAL.NONHIER_2_VAL_0_SECTION: NONHIERLAYER_2_LEVEL_0_SECTION
mirax.HIERARCHICAL.NONHIER_3_COUNT: 1
mirax.HIERARCHICAL.NONHIER_3_NAME: VIMSLIDE_POSITION_BUFFER
mirax.HIERARCHICAL.NONHIER_3_SECTION: NONHIERLAYER_3_SECTION
mirax.HIERARCHICAL.NONHIER_3_VAL_0: default
mirax.HIERARCHICAL.NONHIER_3_VAL_0_IMAGENUMBER_X: 1
mirax.HIERARCHICAL.NONHIER_3_VAL_0_IMAGENUMBER_Y: 1
mirax.HIERARCHICAL.NONHIER_3_VAL_0_SECTION: NONHIERLAYER_3_LEVEL_0_SECTION
mirax.HIERARCHICAL.NONHIER_COUNT: 4
mirax.HIERARCHICAL.PAGEELEMENTCOUNT: 128
mirax.HIERARCHICAL.PAGELENGTH: 2048
mirax.LAYER_0_LEVEL_0_SECTION.DIGITIZER_HEIGHT: 256
mirax.LAYER_0_LEVEL_0_SECTION.DIGITIZER_WIDTH: 340
mirax.LAYER_0_LEVEL_0_SECTION.IMAGE_COMPRESSION_FACTOR: 80
mirax.LAYER_0_LEVEL_0_SECTION.IMAGE_CONCAT_FACTOR: 0
mirax.LAYER_0_LEVEL_0_SECTION.IMAGE_FILL_COLOR_BGR: 16777215
mirax.LAYER_0_LEVEL_0_SECTION.IMAGE_FORMAT: JPEG
mirax.LAYER_0_LEVEL_0_SECTION.MICROMETER_PER_PIXEL_X: 0.2325
mirax.LAYER_0_LEVEL_0_SECTION.MICROMETER_PER_PIXEL_Y: 0.2325
mirax.LAYER_0_LEVEL_0_SECTION.OVERLAP_X: 120
mirax.LAYER_0_LEVEL_0_SECTION.OVERLAP_Y: 120
mirax.LAYER_0_LEVEL_1_SECTION.DIGITIZER_HEIGHT: 256
mirax.LAYER_0_LEVEL_1_SECTION.DIGITIZER_WIDTH: 340
mirax.LAYER_0_LEVEL_1_SECTION.IMAGE_COMPRESSION_FACTOR: 80
mirax.LAYER_0_LEVEL_1_SECTION.IMAGE_CONCAT_FACTOR: 1
mirax.LAYER_0_LEVEL_1_SECTION.IMAGE_FILL_COLOR_BGR: 16777215
mirax.LAYER_0_LEVEL_1_SECTION.IMAGE_FORMAT: JPEG
mirax.LAYER_0_LEVEL_1_SECTION.MICROMETER_PER_PIXEL_X: 0.465
mirax.LAYER_0_LEVEL_1_SECTION.MICROMETER_PER_PIXEL_Y: 0.465
mirax.LAYER_0_LEVEL_1_SECTION.OVERLAP_X: 60
mirax.LAYER_0_LEVEL_1_SECTION.OVERLAP_Y: 60
mirax.LAYER_0_LEVEL_2_SECTION.DIGITIZER_HEIGHT: 256
mirax.LAYER_0_LEVEL_2_SECTION.DIGITIZER_WIDTH: 340
mirax.LAYER_0_LEVEL_2_SECTION.IMAGE_COMPRESSION_FACTOR: 80
mirax.LAYER_0_LEVEL_2_SECTION.IMAGE_CONCAT_FACTOR: 1
mirax.LAYER_0_LEVEL_2_SECTION.IMAGE_FILL_COLOR_BGR: 16777215
mirax.LAYER_0_LEVEL_2_SECTION.IMAGE_FORMAT: JPEG
mirax.LAYER_0_LEVEL_2_SECTION.MICROMETER_PER_PIXEL_X: 0.93
mirax.LAYER_0_LEVEL_2_SECTION.MICROMETER_PER_PIXEL_Y: 0.93
mirax.LAYER_0_LEVEL_2_SECTION.OVERLAP_X: 30
mirax.LAYER_0_LEVEL_2_SECTION.OVERLAP_Y: 30
mirax.LAYER_0_LEVEL_3_SECTION.DIGITIZER_HEIGHT: 256
mirax.LAYER_0_LEVEL_3_SECTION.DIGITIZER_WIDTH: 340
mirax.LAYER_0_LEVEL_3_SECTION.IMAGE_COMPRESSION_FACTOR: 80
mirax.LAYER_0_LEVEL_3_SECTION.IMAGE_CONCAT_FACTOR: 1
mirax.LAYER_0_LEVEL_3_SECTION.IMAGE_FILL_COLOR_BGR: 16777215
mirax.LAYER_0_LEVEL_3_SECTION.IMAGE_FORMAT: JPEG
mirax.LAYER_0_LEVEL_3_SECTION.MICROMETER_PER_PIXEL_X: 1.86
mirax.LAYER_0_LEVEL_3_SECTION.MICROMETER_PER_PIXEL_Y: 1.86
mirax.LAYER_0_LEVEL_3_SECTION.OVERLAP_X: 15
mirax.LAYER_0_LEVEL_3_SECTION.OVERLAP_Y: 15
mirax.LAYER_0_LEVEL_4_SECTION.DIGITIZER_HEIGHT: 256
mirax.LAYER_0_LEVEL_4_SECTION.DIGITIZER_WIDTH: 340
mirax.LAYER_0_LEVEL_4_SECTION.IMAGE_COMPRESSION_FACTOR: 80
mirax.LAYER_0_LEVEL_4_SECTION.IMAGE_CONCAT_FACTOR: 1
mirax.LAYER_0_LEVEL_4_SECTION.IMAGE_FILL_COLOR_BGR: 16777215
mirax.LAYER_0_LEVEL_4_SECTION.IMAGE_FORMAT: JPEG
mirax.LAYER_0_LEVEL_4_SECTION.MICROMETER_PER_PIXEL_X: 3.71723625557207
mirax.LAYER_0_LEVEL_4_SECTION.MICROMETER_PER_PIXEL_Y: 3.71631683168317
mirax.LAYER_0_LEVEL_4_SECTION.OVERLAP_X: 7.5
mirax.LAYER_0_LEVEL_4_SECTION.OVERLAP_Y: 7.5
mirax.LAYER_0_LEVEL_5_SECTION.DIGITIZER_HEIGHT: 256
mirax.LAYER_0_LEVEL_5_SECTION.DIGITIZER_WIDTH: 340
mirax.LAYER_0_LEVEL_5_SECTION.IMAGE_COMPRESSION_FACTOR: 80
mirax.LAYER_0_LEVEL_5_SECTION.IMAGE_CONCAT_FACTOR: 1
mirax.LAYER_0_LEVEL_5_SECTION.IMAGE_FILL_COLOR_BGR: 16777215
mirax.LAYER_0_LEVEL_5_SECTION.IMAGE_FORMAT: JPEG
mirax.LAYER_0_LEVEL_5_SECTION.MICROMETER_PER_PIXEL_X: 7.42898176335156
mirax.LAYER_0_LEVEL_5_SECTION.MICROMETER_PER_PIXEL_Y: 7.42533245151627
mirax.LAYER_0_LEVEL_5_SECTION.OVERLAP_X: 3.75
mirax.LAYER_0_LEVEL_5_SECTION.OVERLAP_Y: 3.75
mirax.LAYER_0_LEVEL_6_SECTION.DIGITIZER_HEIGHT: 256
mirax.LAYER_0_LEVEL_6_SECTION.DIGITIZER_WIDTH: 340
mirax.LAYER_0_LEVEL_6_SECTION.IMAGE_COMPRESSION_FACTOR: 80
mirax.LAYER_0_LEVEL_6_SECTION.IMAGE_CONCAT_FACTOR: 1
mirax.LAYER_0_LEVEL_6_SECTION.IMAGE_FILL_COLOR_BGR: 16777215
mirax.LAYER_0_LEVEL_6_SECTION.IMAGE_FORMAT: JPEG
mirax.LAYER_0_LEVEL_6_SECTION.MICROMETER_PER_PIXEL_X: 14.8470224637232
mirax.LAYER_0_LEVEL_6_SECTION.MICROMETER_PER_PIXEL_Y: 14.8361339197615
mirax.LAYER_0_LEVEL_6_SECTION.OVERLAP_X: 1.875
mirax.LAYER_0_LEVEL_6_SECTION.OVERLAP_Y: 1.875
mirax.LAYER_0_LEVEL_7_SECTION.DIGITIZER_HEIGHT: 256
mirax.LAYER_0_LEVEL_7_SECTION.DIGITIZER_WIDTH: 340
mirax.LAYER_0_LEVEL_7_SECTION.IMAGE_COMPRESSION_FACTOR: 80
mirax.LAYER_0_LEVEL_7_SECTION.IMAGE_CONCAT_FACTOR: 1
mirax.LAYER_0_LEVEL_7_SECTION.IMAGE_FILL_COLOR_BGR: 16777215
mirax.LAYER_0_LEVEL_7_SECTION.IMAGE_FORMAT: JPEG
mirax.LAYER_0_LEVEL_7_SECTION.MICROMETER_PER_PIXEL_X: 29.6722110708821
mirax.LAYER_0_LEVEL_7_SECTION.MICROMETER_PER_PIXEL_Y: 29.6432910154609
mirax.LAYER_0_LEVEL_7_SECTION.OVERLAP_X: 0.9375
mirax.LAYER_0_LEVEL_7_SECTION.OVERLAP_Y: 0.9375
mirax.LAYER_0_LEVEL_8_SECTION.DIGITIZER_HEIGHT: 256
mirax.LAYER_0_LEVEL_8_SECTION.DIGITIZER_WIDTH: 340
mirax.LAYER_0_LEVEL_8_SECTION.IMAGE_COMPRESSION_FACTOR: 80
mirax.LAYER_0_LEVEL_8_SECTION.IMAGE_CONCAT_FACTOR: 1
mirax.LAYER_0_LEVEL_8_SECTION.IMAGE_FILL_COLOR_BGR: 16777215
mirax.LAYER_0_LEVEL_8_SECTION.IMAGE_FORMAT: JPEG
mirax.LAYER_0_LEVEL_8_SECTION.MICROMETER_PER_PIXEL_X: 59.3444221417643
mirax.LAYER_0_LEVEL_8_SECTION.MICROMETER_PER_PIXEL_Y: 59.2865820309218
mirax.LAYER_0_LEVEL_8_SECTION.OVERLAP_X: 0.46875
mirax.LAYER_0_LEVEL_8_SECTION.OVERLAP_Y: 0.46875
mirax.LAYER_0_LEVEL_9_SECTION.DIGITIZER_HEIGHT: 256
mirax.LAYER_0_LEVEL_9_SECTION.DIGITIZER_WIDTH: 340
mirax.LAYER_0_LEVEL_9_SECTION.IMAGE_COMPRESSION_FACTOR: 80
mirax.LAYER_0_LEVEL_9_SECTION.IMAGE_CONCAT_FACTOR: 1
mirax.LAYER_0_LEVEL_9_SECTION.IMAGE_FILL_COLOR_BGR: 16777215
mirax.LAYER_0_LEVEL_9_SECTION.IMAGE_FORMAT: JPEG
mirax.LAYER_0_LEVEL_9_SECTION.MICROMETER_PER_PIXEL_X: 118.688844283529
mirax.LAYER_0_LEVEL_9_SECTION.MICROMETER_PER_PIXEL_Y: 118.573164061844
mirax.LAYER_0_LEVEL_9_SECTION.OVERLAP_X: 0.234375
mirax.LAYER_0_LEVEL_9_SECTION.OVERLAP_Y: 0.234375
mirax.LAYER_0_SECTION.GAMMA_APPLIED: False
mirax.LAYER_0_SECTION.GAMMA_VALUE: 1
mirax.LAYER_0_SECTION.SHARPENED: False
mirax.LAYER_0_SECTION.SQRT2_RESIZED: False
mirax.LAYER_1_LEVEL_0_SECTION.ACTIVE: ON
mirax.LAYER_1_LEVEL_0_SECTION.COLOR_B: 0
mirax.LAYER_1_LEVEL_0_SECTION.COLOR_G: 0
mirax.LAYER_1_LEVEL_0_SECTION.COLOR_R: 0
mirax.LAYER_1_LEVEL_0_SECTION.DATA_IN_THIS_FILTER_LEVEL: FilterLevel_0
mirax.LAYER_1_LEVEL_0_SECTION.DIGITALGAIN: 0
mirax.LAYER_1_LEVEL_0_SECTION.EXPOSUREPERCENTAGE: 100
mirax.LAYER_1_LEVEL_0_SECTION.EXPOSURE_TIME: 1838
mirax.LAYER_1_LEVEL_0_SECTION.EXTENDED_STEP_COUNT: 1
mirax.LAYER_1_LEVEL_0_SECTION.EXTENDED_STEP_SIZE: 0
mirax.LAYER_1_LEVEL_0_SECTION.FILTER_NAME: Default
mirax.LAYER_1_LEVEL_0_SECTION.FILTER_REAL_POSITION: 9
mirax.LAYER_1_LEVEL_0_SECTION.IS_MASTER_FILTER: True
mirax.LAYER_1_LEVEL_0_SECTION.IS_STITCHING_FILTER: 1
mirax.LAYER_1_LEVEL_0_SECTION.MODIFY: ON
mirax.LAYER_1_LEVEL_0_SECTION.STORING_CHANNEL_NUMBER: 0
mirax.LAYER_1_LEVEL_0_SECTION.THRESHOLD: 0
mirax.LAYER_1_LEVEL_0_SECTION.USE_BLUE_CHANNEL: False
mirax.LAYER_1_LEVEL_0_SECTION.USE_GREEN_CHANNEL: False
mirax.LAYER_1_LEVEL_0_SECTION.USE_RED_CHANNEL: False
mirax.LAYER_1_LEVEL_0_SECTION.XDIFF: 0
mirax.LAYER_1_LEVEL_0_SECTION.YDIFF: 0
mirax.LAYER_1_LEVEL_0_SECTION.ZDIFF: 0
mirax.LAYER_1_LEVEL_1_SECTION.ACTIVE: ON
mirax.LAYER_1_LEVEL_1_SECTION.COLOR_B: 0
mirax.LAYER_1_LEVEL_1_SECTION.COLOR_G: 0
mirax.LAYER_1_LEVEL_1_SECTION.COLOR_R: 0
mirax.LAYER_1_LEVEL_1_SECTION.DATA_IN_THIS_FILTER_LEVEL: FilterLevel_0
mirax.LAYER_1_LEVEL_1_SECTION.DIGITALGAIN: 0
mirax.LAYER_1_LEVEL_1_SECTION.EXPOSUREPERCENTAGE: 100
mirax.LAYER_1_LEVEL_1_SECTION.EXTENDED_STEP_COUNT: 1
mirax.LAYER_1_LEVEL_1_SECTION.EXTENDED_STEP_SIZE: 0
mirax.LAYER_1_LEVEL_1_SECTION.FILTER_NAME: Default
mirax.LAYER_1_LEVEL_1_SECTION.FILTER_REAL_POSITION: 9
mirax.LAYER_1_LEVEL_1_SECTION.IS_MASTER_FILTER: True
mirax.LAYER_1_LEVEL_1_SECTION.IS_STITCHING_FILTER: 1
mirax.LAYER_1_LEVEL_1_SECTION.MODIFY: ON
mirax.LAYER_1_LEVEL_1_SECTION.STORING_CHANNEL_NUMBER: 1
mirax.LAYER_1_LEVEL_1_SECTION.THRESHOLD: 0
mirax.LAYER_1_LEVEL_1_SECTION.USE_BLUE_CHANNEL: False
mirax.LAYER_1_LEVEL_1_SECTION.USE_GREEN_CHANNEL: False
mirax.LAYER_1_LEVEL_1_SECTION.USE_RED_CHANNEL: False
mirax.LAYER_1_LEVEL_1_SECTION.XDIFF: 0
mirax.LAYER_1_LEVEL_1_SECTION.YDIFF: 0
mirax.LAYER_1_LEVEL_1_SECTION.ZDIFF: 0
mirax.LAYER_1_LEVEL_2_SECTION.ACTIVE: ON
mirax.LAYER_1_LEVEL_2_SECTION.COLOR_B: 0
mirax.LAYER_1_LEVEL_2_SECTION.COLOR_G: 0
mirax.LAYER_1_LEVEL_2_SECTION.COLOR_R: 0
mirax.LAYER_1_LEVEL_2_SECTION.DATA_IN_THIS_FILTER_LEVEL: FilterLevel_0
mirax.LAYER_1_LEVEL_2_SECTION.DIGITALGAIN: 0
mirax.LAYER_1_LEVEL_2_SECTION.EXPOSUREPERCENTAGE: 100
mirax.LAYER_1_LEVEL_2_SECTION.EXTENDED_STEP_COUNT: 1
mirax.LAYER_1_LEVEL_2_SECTION.EXTENDED_STEP_SIZE: 0
mirax.LAYER_1_LEVEL_2_SECTION.FILTER_NAME: Default
mirax.LAYER_1_LEVEL_2_SECTION.FILTER_REAL_POSITION: 9
mirax.LAYER_1_LEVEL_2_SECTION.IS_MASTER_FILTER: True
mirax.LAYER_1_LEVEL_2_SECTION.IS_STITCHING_FILTER: 1
mirax.LAYER_1_LEVEL_2_SECTION.MODIFY: ON
mirax.LAYER_1_LEVEL_2_SECTION.STORING_CHANNEL_NUMBER: 2
mirax.LAYER_1_LEVEL_2_SECTION.THRESHOLD: 0
mirax.LAYER_1_LEVEL_2_SECTION.USE_BLUE_CHANNEL: False
mirax.LAYER_1_LEVEL_2_SECTION.USE_GREEN_CHANNEL: False
mirax.LAYER_1_LEVEL_2_SECTION.USE_RED_CHANNEL: False
mirax.LAYER_1_LEVEL_2_SECTION.XDIFF: 0
mirax.LAYER_1_LEVEL_2_SECTION.YDIFF: 0
mirax.LAYER_1_LEVEL_2_SECTION.ZDIFF: 0
mirax.NONHIERLAYER_0_LEVEL_0_SECTION.SCANMAP_IMAGE_HEIGHT: 244
mirax.NONHIERLAYER_0_LEVEL_0_SECTION.SCANMAP_IMAGE_TYPE: PNG
mirax.NONHIERLAYER_0_LEVEL_0_SECTION.SCANMAP_IMAGE_WIDTH: 88
mirax.NONHIERLAYER_0_LEVEL_2_SECTION.THUMBNAIL_IMAGE_HEIGHT: 1128
mirax.NONHIERLAYER_0_LEVEL_2_SECTION.THUMBNAIL_IMAGE_TYPE: JPEG
mirax.NONHIERLAYER_0_LEVEL_2_SECTION.THUMBNAIL_IMAGE_WIDTH: 563
mirax.NONHIERLAYER_0_LEVEL_3_SECTION.BARCODE_IMAGE_HEIGHT: 462
mirax.NONHIERLAYER_0_LEVEL_3_SECTION.BARCODE_IMAGE_TYPE: JPEG
mirax.NONHIERLAYER_0_LEVEL_3_SECTION.BARCODE_IMAGE_WIDTH: 615
mirax.NONHIERLAYER_0_LEVEL_4_SECTION.PREVIEW_IMAGE_HEIGHT: 1724
mirax.NONHIERLAYER_0_LEVEL_4_SECTION.PREVIEW_IMAGE_TYPE: JPEG
mirax.NONHIERLAYER_0_LEVEL_4_SECTION.PREVIEW_IMAGE_WIDTH: 854
mirax.NONHIERLAYER_0_LEVEL_5_SECTION.STAGEPOSMAP_IMAGE_HEIGHT: 244
mirax.NONHIERLAYER_0_LEVEL_5_SECTION.STAGEPOSMAP_IMAGE_TYPE: PNG
mirax.NONHIERLAYER_0_LEVEL_5_SECTION.STAGEPOSMAP_IMAGE_WIDTH: 88
mirax.NONHIERLAYER_0_LEVEL_9_SECTION.SCANNED_FOVS_MAP_IMAGE_HEIGHT: 244
mirax.NONHIERLAYER_0_LEVEL_9_SECTION.SCANNED_FOVS_MAP_IMAGE_TYPE: PNG
mirax.NONHIERLAYER_0_LEVEL_9_SECTION.SCANNED_FOVS_MAP_IMAGE_WIDTH: 88
mirax.NONHIERLAYER_0_SECTION.AVEGARE_IMAGE_OVERLAP_X_IN_PIXELS: 120
mirax.NONHIERLAYER_0_SECTION.AVEGARE_IMAGE_OVERLAP_Y_IN_PIXELS: 120
mirax.NONHIERLAYER_0_SECTION.CAMERA_ROTATION: 0
mirax.NONHIERLAYER_0_SECTION.OBJECT_GUIDE_HYSTERESIS_X: 84
mirax.NONHIERLAYER_0_SECTION.OBJECT_GUIDE_HYSTERESIS_Y: 84
mirax.NONHIERLAYER_0_SECTION.SCANNED_FOV_COUNT: 2749
mirax.NONHIERLAYER_0_SECTION.SCANNER_CAMERA_TYPE: Default Camera
mirax.NONHIERLAYER_0_SECTION.SCANNER_HARDWARE_VERSION: v0.5
mirax.NONHIERLAYER_0_SECTION.SCANNER_SOFTWARE_VERSION: 1,12,25,1
mirax.NONHIERLAYER_0_SECTION.SCANNING_TIME_IN_SEC: 599
mirax.NONHIERLAYER_1_SECTION.VIMSLIDE_HISTOGRAM_DATA_CHANNEL_NUM: 3
mirax.NONHIERLAYER_1_SECTION.VIMSLIDE_HISTOGRAM_DATA_CHANNEL_SIZE: 256
mirax.NONHIERLAYER_1_SECTION.VIMSLIDE_HISTOGRAM_DATA_FORMAT_VERSION: 257
mirax.NONHIERLAYER_2_SECTION.DATA_FORMAT_VERSION: 258
mirax.NONHIERLAYER_3_SECTION.VIMSLIDE_POSITION_DATA_FORMAT_VERSION: 257
openslide.background-color: FFFFFF
openslide.bounds-height: 138396
openslide.bounds-width: 90531
openslide.bounds-x: 9912
openslide.bounds-y: 57714
openslide.level-count: 10
openslide.level[0].downsample: 1
openslide.level[0].height: 220696
openslide.level[0].width: 109240
openslide.level[1].downsample: 2
openslide.level[1].height: 110348
openslide.level[1].width: 54620
openslide.level[2].downsample: 4
openslide.level[2].height: 55174
openslide.level[2].width: 27310
openslide.level[3].downsample: 8
openslide.level[3].height: 27587
openslide.level[3].width: 13655
openslide.level[4].downsample: 16
openslide.level[4].height: 13793
openslide.level[4].width: 6827
openslide.level[5].downsample: 32
openslide.level[5].height: 6896
openslide.level[5].width: 3413
openslide.level[6].downsample: 64
openslide.level[6].height: 3448
openslide.level[6].width: 1706
openslide.level[7].downsample: 128
openslide.level[7].height: 1724
openslide.level[7].width: 853
openslide.level[8].downsample: 256
openslide.level[8].height: 862
openslide.level[8].width: 426
openslide.level[9].downsample: 512
openslide.level[9].height: 431
openslide.level[9].width: 213
openslide.mpp-x: 0.23250000000000001
openslide.mpp-y: 0.23250000000000001
openslide.objective-power: 20
openslide.quickhash-1: c572830e3d9526bd3117940ef25ff2014fbd6b0a883a9fee34311647df05c008
openslide.vendor: mirax
slide-associated-images: label, macro, thumbnail

You can see there is a lot of extra information that might be useful.

The vipsdisp image viewer can be useful too:

https://github.com/jcupitt/vipsdisp

Press alt-enter to see the image properties:

image

@Fighting-bruceCHN
Copy link
Author

Thank you for the reply , still one small question.The tif and tiff suffixes don't affect the nature of the image when saved, right?

@jcupitt
Copy link
Member

jcupitt commented Aug 28, 2024

No, there's no difference.

@prasadbandodkar
Copy link

Hi @jcupitt, I have a question related to this. The output of the vips_openslide function is a rgb or rgba image. I have a mrxs file that has 5 channels. When I open it in libvips, I can see that 4 of the channels are in the four bands. Therefore, I can split the bands and get the channels. I don't know how to obtain the 5th channel though. Is there another parameter I can supply to the vips_openslide function to get other channel? Any idea how how one might retrieve channels from mrxs images that have more that 5 channels?

@libvips libvips deleted a comment from Fighting-bruceCHN Nov 2, 2024
@jcupitt
Copy link
Member

jcupitt commented Nov 2, 2024

Sorry, openslide is RGB only, there's no way to get extra channels.

I think you'll need to look into the 3dhistech SDK.

@prasadbandodkar
Copy link

Thanks a lot @jcupitt for the clarification!

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

No branches or pull requests

3 participants