aaah ok--- so I have to just make sure when I build VIPS from source I compile against openslide as well--- I think last time I compiled it I was building against the latest version of libtiff as well--- how does VIPS "know" which library to use th read the JPEG2000 encoded tiff's or is there some search hierarchy if it finds an encoding library X won't handle, it will go to library Y?<div>
<br></div><div><br></div><div><br><div class="gmail_quote">On Mon, Jun 4, 2012 at 11:06 PM, Benjamin Gilbert <span dir="ltr"><<a href="mailto:bgilbert@cs.cmu.edu" target="_blank">bgilbert@cs.cmu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 06/04/2012 07:39 PM, David Gutman wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Ben--- I've been using vips to transcode raw SVS files into pyramidal<br>
tiff files... and it works as long as the images are not JPEG2000 encoded.<br>
<br>
vips im_vips2tiff INPUT_SVS_FILE.svs<br>
OUTPUT.dzi.tif:jpeg:75,tile:<u></u>256x256,pyramid,,,,8<br>
<br>
Basically the above command tells VIPS to transcode the original SVS<br>
file (layer 0) into a pyramidal tiff at 75% quality as a jpeg, at<br>
256x256 tiles--- the "8" at the end tells it to save it as a BIGTIFF<br>
image. I use the dzi.tif extension to remind me it's a deep<br>
zoom/pyramidal tiff file...<br>
</blockquote>
<br></div>
Actually, Deep Zoom is a particular file format, unrelated to TIFF.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Do you think it would be possible to use VIPS/OpenSlide together to<br>
accomplish the same thing in a single python script? With the recent<br>
integration/support of VIPS and OpenSlide that I saw I was hoping this<br>
possible, but haven't delved into the details.<br>
</blockquote>
<br></div>
I haven't looked at the VIPS Python bindings, but if you have VIPS >= 7.28.3 linked against OpenSlide, it should be straightforward. You can also do this directly from the VIPS command line. The obvious approach with "vips tiffsave" does *not* work, because the TIFF writer gets confused by the fourth (alpha) channel returned by OpenSlide. But you can use im_extract_bands:<br>
<br>
vips im_extract_bands INPUT.svs \<br>
OUTPUT.tif:jpeg:75,tile:<u></u>256x256,pyramid,,,,8 0 3<span class="HOEnZb"><font color="#888888"><br>
<br>
--Benjamin Gilbert<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>David A Gutman, M.D. Ph.D.<br>Assistant Professor of Biomedical Informatics<br>Senior Research Scientist, Center for Comprehensive Informatics<br>
Emory University School of Medicine<br>
</div>