<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Avenir Book";}
@font-face
        {font-family:Avenir;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:Avenir;
        color:#222A35;
        font-weight:normal;
        font-style:normal;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1354456432;
        mso-list-type:hybrid;
        mso-list-template-ids:-1326029950 1053202712 134807555 134807557 134807553 134807555 134807557 134807553 134807555 134807557;}
@list l0:level1
        {mso-level-start-at:4;
        mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;
        mso-fareast-font-family:Calibri;
        mso-bidi-font-family:"Times New Roman";}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor="white" lang="EN-GB" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">Ashish,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">You can use libtif to decode and re-save/re-compress* an svs file (jpeg only). This will get rid of all tags except the ones you copy across (I think). I found
 the following in my experimental folder from when I was trying to understand this format. I’ve not checked it still works, but it will give you an idea of where to start.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">HTH<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">Derek<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">* Obviously recompression is undesirable, it’s probably worth modifying to extract the uncompressed data and just saving that back. From memory libtiff supports
 that, and would have the added benefit of allowing you to process jpeg2000 encoded files (which will probably cause the program below to crash as libtiff can’t natively decompress jpeg2000 by default).<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">#include "tiffio.h"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">#include <stdio.h><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">int main(int argc, char* argv[])<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">{<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">    uint16 compression ;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">    uint16 bitspersample ;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">    uint16 samplesperpixel ;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">    uint16 planar ;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">    uint16 datatype ;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">    uint16 photometric ;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">    uint16 format ;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">    uint32 idepth ;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">    uint32 itype ;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">    uint16 ycbcr[2] ;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">    char *desc ;               
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">    TIFF* tif = TIFFOpen(argv[1], "r");<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">    TIFF* tifout = TIFFOpen(argv[2], "w");<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">  
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">    if (tif) {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">        int dircount = 0;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">        do {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                printf("Image # %d\n================\n",dircount) ;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">  
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                TIFFGetField(tif, TIFFTAG_COMPRESSION, &compression);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                TIFFGetField(tif, TIFFTAG_BITSPERSAMPLE, &bitspersample);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                TIFFGetField(tif, TIFFTAG_PLANARCONFIG, &planar);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                TIFFGetField(tif, TIFFTAG_IMAGEDESCRIPTION, &desc);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                TIFFGetField(tif, TIFFTAG_IMAGEDEPTH, &idepth);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                TIFFGetField(tif, TIFFTAG_DATATYPE, &datatype);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                TIFFGetField(tif, TIFFTAG_SUBFILETYPE, &itype);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                TIFFGetField(tif, TIFFTAG_PHOTOMETRIC, &photometric);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                TIFFGetField(tif, TIFFTAG_SAMPLEFORMAT, &format);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                TIFFGetField(tif,TIFFTAG_YCBCRSUBSAMPLING, &(ycbcr[0]), &(ycbcr[1]));<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">               
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                                                    <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                TIFFSetField(tifout, TIFFTAG_COMPRESSION, compression);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                TIFFSetField(tifout, TIFFTAG_BITSPERSAMPLE,bitspersample); 
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                TIFFSetField(tifout, TIFFTAG_SAMPLESPERPIXEL, samplesperpixel);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                TIFFSetField(tifout, TIFFTAG_PLANARCONFIG, planar);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                TIFFSetField(tifout, TIFFTAG_IMAGEDESCRIPTION, desc);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">               
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                TIFFSetField(tifout, TIFFTAG_IMAGEDEPTH, idepth);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                //TIFFSetField(tifout, TIFFTAG_DATATYPE, datatype);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                TIFFSetField(tifout, TIFFTAG_SUBFILETYPE, itype);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                TIFFSetField(tifout, TIFFTAG_PHOTOMETRIC, photometric);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                //TIFFSetField(tifout, TIFFTAG_SAMPLEFORMAT, format);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                TIFFSetField(tifout,TIFFTAG_YCBCRSUBSAMPLING, ycbcr[0],ycbcr[1]);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">               
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                if(TIFFIsTiled(tif)){<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                // Tiled<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    uint32 w, h;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    uint32 tileWidth, tileLength;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    uint32 x, y;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                   
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    tdata_t buf;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &w);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    TIFFGetField(tif, TIFFTAG_TILEWIDTH, &tileWidth);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    TIFFGetField(tif, TIFFTAG_TILELENGTH, &tileLength);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35"> 
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    TIFFSetField(tifout, TIFFTAG_IMAGEWIDTH, w);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    TIFFSetField(tifout, TIFFTAG_IMAGELENGTH, h);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    TIFFSetField(tifout, TIFFTAG_TILEWIDTH, tileWidth);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    TIFFSetField(tifout, TIFFTAG_TILELENGTH, tileLength);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                                     
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    printf("Description: \n%s\n",desc) ;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    printf("Size %d,%d (%d,%d)\n",w,h,tileWidth,tileLength) ;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    buf = _TIFFmalloc(TIFFTileSize(tif));<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    printf("Buffer size: %d\n",TIFFTileSize(tif)) ;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    for (y = 0; y < h; y += tileLength){<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                        for (x = 0; x < w; x += tileWidth){<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                           
</span><span lang="FR" style="font-size:14.0pt;font-family:Avenir;color:#222A35">TIFFReadTile(tif, buf, x, y, 0,0);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                           
</span><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">TIFFWriteTile(tifout, buf, x, y, 0,0);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                        }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    _TIFFfree(buf);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                   
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    TIFFWriteDirectory(tifout) ;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                else{<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    uint32 rowsPerStrip;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    uint32 w, h;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    tdata_t buf;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    tstrip_t strip;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    printf("Image is striped\n") ;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &w);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                   TIFFGetField(tif,TIFFTAG_ROWSPERSTRIP, &rowsPerStrip);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                   
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    TIFFSetField(tifout, TIFFTAG_IMAGEWIDTH, w);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    TIFFSetField(tifout, TIFFTAG_IMAGELENGTH, h);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    TIFFSetField(tifout, TIFFTAG_ROWSPERSTRIP, rowsPerStrip);                                 
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    printf("Description: \n%s\n",desc) ;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    printf("Size %d,%d (%d)\n",w,h,rowsPerStrip) ;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                   
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    buf = _TIFFmalloc(TIFFStripSize(tif));<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    for (strip = 0; strip < TIFFNumberOfStrips(tif); strip++){<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                        TIFFReadEncodedStrip(tif, strip, buf, (tsize_t) -1);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                        TIFFWriteEncodedStrip(tifout, strip, buf, TIFFStripSize(tif));<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    _TIFFfree(buf); 
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                    TIFFWriteDirectory(tifout) ;                   
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">               
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">         <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">                <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">            dircount++;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">        } while (TIFFReadDirectory(tif));<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">        printf("%d directories in %s\n", dircount, argv[1]);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">        TIFFClose(tif);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">        TIFFClose(tifout);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">    } 
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">    else{<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">        printf("Failed to open %s\n",argv[1]) ;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">    }<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">   
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><a name="_MailEndCompose"><span style="font-size:11.0pt;color:#1F497D"><o:p> </o:p></span></a></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> openslide-users [mailto:openslide-users-bounces+d.r.magee=leeds.ac.uk@lists.andrew.cmu.edu]
<b>On Behalf Of </b>Sharma, Ashish<br>
<b>Sent:</b> 17 August 2017 19:24<br>
<b>To:</b> openslide-users@lists.andrew.cmu.edu<br>
<b>Subject:</b> edit Aperio metadata<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">Has anyone written an OpenSlide or TIFF based utility that allows one to edit header attributes, possibly as part of some anonymization script?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">Or alternatively, scrub a specific tag like “Image-Description” or Comment in Aperio.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">-Thanks<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35">Ashish
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:14.0pt;font-family:Avenir;color:#222A35"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Avenir Book";color:#222A35">————————————————————————————————————<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Avenir Book";color:#222A35">Ashish Sharma, PhD<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Avenir Book";color:#222A35">Assistant Professor<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Avenir Book";color:#222A35">Department of Biomedical Informatics<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Avenir Book";color:#222A35">Emory University<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Avenir Book";color:#222A35"> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Avenir Book";color:#222A35">Woodruff Memorial Research Building<br>
101 Woodruff Circle, #4105<br>
Atlanta, GA 30322<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Avenir Book";color:#222A35"> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Avenir Book";color:#222A35">Ph: (404) 654-0124<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Avenir Book";color:#222A35"><a href="mailto:ashish.sharma@emory.edu">ashish.sharma@emory.edu</a></span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Times New Roman","serif""><o:p> </o:p></span></p>
<div class="MsoNormal" align="center" style="text-align:center"><span lang="EN-US" style="font-family:"Times New Roman","serif"">
<hr size="2" width="100%" align="center">
</span></div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:7.5pt;font-family:"Arial","sans-serif";color:gray"><br>
This e-mail message (including any attachments) is for the sole use of<br>
the intended recipient(s) and may contain confidential and privileged<br>
information. If the reader of this message is not the intended<br>
recipient, you are hereby notified that any dissemination, distribution<br>
or copying of this message (including any attachments) is strictly<br>
prohibited.<br>
<br>
If you have received this message in error, please contact<br>
the sender by reply e-mail message and destroy all copies of the<br>
original message (including attachments).</span><span lang="EN-US" style="font-family:"Times New Roman","serif""><o:p></o:p></span></p>
</div>
</body>
</html>