MathOnco / valis

Virtual Alignment of pathoLogy Image Series
https://valis.readthedocs.io/en/latest/
MIT License
115 stars 28 forks source link

slide level save #109

Open lingxitong opened 5 months ago

lingxitong commented 5 months ago

hello,the original svs has 5 level 80X 40X 20X 10X 5X ,how to make the ome.tiff save 20X rather 80X

syy-create commented 5 months ago

Hello, have you resolved it? I also want to know how to save as a specific magnification.

cdgatenbee commented 5 months ago

Hi @lingxitong and @syy-create, Apologies for taking so long to respond. The level argument in the functions related to saving slides (Valis.warp_and_save_slides, Valis.warp_and_merge_slides, slide_io.convert_to_ome_tiff, etc...) lets you determine which magnification you would like to save. level refers to the pyramid level you want to access, where level=0 is the largest image, and increasing the level yields smaller images. So, if your image pyramid is 80X, 40X, 20X, 10X, 5X then setting level=2 should save the images at 20X. Also, if you want to know the dimensions of the images in each pyramid level, you can do so by looking at Slide.slide_dimensions_wh, e.g.:

ref_slide = registrar.get_ref_slide()
print(ref_slide.slide_dimensionsions_wh)

I hope that helps, and please let me know if you have any other questions.

Best, -Chandler