-
Notifications
You must be signed in to change notification settings - Fork 50
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
Issues with writing to SVS files #480
Comments
Sorry, I've never tried to write SVS. It's a pretty non-standard and proprietary TIFF though, so I think you'll have a range problems, especially around metadata. Do you have to use SVS? One of the standard slide image formats, like DICOM or plain TIFF, or even OME-TIFF, would probably suit you better. From a quick look at your code, SVS is row major, so you'll need to transpose the tiles. SVS has very few pyramid levels, you'll need to remove most of yours. Your loop looks confusing, is there an indentation problem? Or is this two separate pieces of code? You'll need quite a bit of code to generate the correct I'd read the SVS loader in openslide and make sure you're following that layout. https://github.com/openslide/openslide/blob/main/src/openslide-vendor-aperio.c |
Thank you for your answer. As a beginner, my code is quite messy. Because I encountered a memory overflow issue with numpy arrays, I wanted to try first chunking the image, converting each chunk to a numpy array, and then writing them one by one into an SVS file. I used two nested for loops to chunk the image and then placed the code to write to the SVS file inside the loop. The code did not produce any errors, but when I try to open the SVS file with software, it is not usable. I cannot find the problem. Here is the code without the chunking process。
|
Writing SVS is difficult, and even if you do get it working, it will be extremely slow. A fast, high-quality SVS writer will take many weeks of effort. Are you certain you have to write SVS? Why not use OME-TIFF or DICOM or plain TIFF? |
As you know unfortunately There is a code to write svs with the I tried it, it writes svs and the metadata in the file is supported by openslide, for example I was able to read the "label" or "macro" data from this svs file using openslide, but unfortunately tifffile reads the whole file by loading it into ram and this is a bit of a problem |
Ah, nice! But as you say, doing this efficiently is quite a bit more difficult. |
Yes I agree with you, it will be difficult to write completely, maybe by changing the IFD and description structure, the tif file can be transformed to svs, but I'm not sure, what do you think ? |
I would use pyvips to fetch single tiles from the source image, then write each one back with tiffile. But it will probably not be quick :( |
When I convert a pyvips object to numpy, I encounter a memory overflow issue. After I chunk the image and write it back to the same SVS file, the SVS file becomes unusable. Is there a problem with my logic?
The text was updated successfully, but these errors were encountered: