Driver ID | File format | File extensions |
---|---|---|
SVS | Aperio SVS | *.svs |
AFI | Aperio AFI - Fluorescent images | *.afi |
SCN | Leica SCN images | *.scn |
CZI | [Zeiss CZI](https://www.zeiss.com/microsc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load input scene from a scn file | |
scene = slideio.open_slide(input_path, 'AUTO').get_scene(0) | |
params = slideio.SVSJpegParameters() | |
params.quality = 75 # compression quality | |
output_path = "./temp/converted.svs" | |
delete_file(output_path) | |
# Saving scene as SVS file | |
scene.save_image(params,output_path) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
params = slideio.ColorTransformation() | |
params.color_space = slideio.ColorSpace.GRAY | |
transformed_scene = scene.apply_transformation([params]) | |
image = transformed_scene.read_block(size=(0,500)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
slide = slideio.open_slide(path,'DCM') | |
scene = slide.get_scene(0) | |
raw_metadata = scene.get_raw_metadata() | |
metadata = json.loads(raw_metadata) | |
modality = metadata['00080060']['Value'][0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
slide = slideio.open_slide(image_path,"SVS") | |
raw_string = slide.raw_metadata |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rect = (50, 50, 10000, 10000) # read block with ofsets (50,50) from the left top corner and size (10000x10000) pixels | |
size = (500, 0) # resize block to 500x500 size (the height will be computed automaticaly to avoid image distorsion | |
block = scene.read_block(rect, size=size, channel_indices=[2]) # read the block to numpy array |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
num_scenes = slide.num_scenes | |
scene = slide.get_scene(0) | |
block = scene.read_block() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import slideio | |
slide = slideio.open_slide(image_path,'SVS') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import slideio | |
slide = slideio.open_slidei(file_path="/data/a.czi",driver_id="CZI") | |
scene = slide.get_scene(0) | |
block = scene.read_block() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python -m pip install slideio |
NewerOlder