<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">
<div>
<div style="direction: ltr;">
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;">Hi. I have a bunch of Leica fluorescence images. Some with 3 channels (red, green, blue) and others with two channels (green, blue). I'm trying to read them in, but get the following
error when I run openslide_get_level_count: "Found multiple macro images". And when I try to read the dimensions of level 0 using openslide_get_level_dimensions I get a segmentation fault. </div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;">I see from the documentation that there may be some problem reading these types of Leica files. Am I running into this or am I just doing something wrong? Is there any workaround? I'm
only interested in accessing the highest resolution layer. My code and output is below (for one of the 3 channel images). </div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;">Thanks again,</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;">Melanie</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;">-----Start Code-----</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
<div>
<div><span style="font-size: 10pt;">// g++ -Wall -I/usr/local/include/openslide -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -L/usr/lib -lm -lglib-2.0 -lopenslide -o AccessSlides AccessSlides.cc</span></div>
<div><span style="font-size: 10pt;"><br>
</span></div>
<div><span style="font-size: 10pt;">extern "C" {</span></div>
<div> #include <openslide.h></div>
<div>}</div>
<div>#include <iostream></div>
<div>#include <cstdlib></div>
<div>#include <cmath></div>
<div>#include <ctime></div>
<div>#include <glib.h></div>
<div>using namespace std;</div>
<div>int main (int argc, char * argv[])</div>
<div>{</div>
<div><br>
</div>
<div> // Pick Slide</div>
<div> string fn="data/Slide_901822B_DAPI_CD31_COLIV.scn";</div>
<div> cout << "File: " << fn << endl;</div>
<div><br>
</div>
<div> // Open Slide</div>
<div> openslide_t *oslide;</div>
<div> oslide=openslide_open(fn.c_str()); </div>
<div> if (oslide == NULL) {cout << "Open Slide: Failed" << endl;} </div>
<div> else {cout << "Open Slide: Successful" << endl;}</div>
<div> </div>
<div> // Get Level Count</div>
<div> int32_t lc=0;</div>
<div> lc=openslide_get_level_count(oslide);</div>
<div> cout << "Level Count: " << lc << endl;</div>
<div> if (lc == -1)</div>
<div> {</div>
<div> cout << "Error: " << endl << openslide_get_error(oslide) << endl;</div>
<div> }</div>
<div><br>
</div>
<div> //Get Level0 Dimensions</div>
<div> int64_t * ww=NULL, * hh=NULL;</div>
<div> openslide_get_level_dimensions(oslide,0,ww,hh);</div>
<div> if (ww != NULL && hh != NULL) </div>
<div> {</div>
<div> cout << "Level 0 Dimensions: " << ww << " x " << hh << endl;</div>
<div> }</div>
<div><br>
</div>
<div> // Close Slide</div>
<div> openslide_close(oslide);</div>
<div><br>
</div>
<div> return 0;</div>
<div>}</div>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;">-----End Code-----</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;">-----Start Output-----</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;">
<div style="font-size: 10pt;">File: data/Slide_901822B_DAPI_CD31_COLIV.scn</div>
<div style="font-size: 10pt;">Open Slide: Successful</div>
<div style="font-size: 10pt;">Level Count: -1</div>
<div style="font-size: 10pt;">Error: </div>
<div style="font-size: 10pt;">Found multiple macro images</div>
<div style="font-size: 10pt;">Segmentation fault</div>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;">-----End Output-----</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Tahoma; font-size: 10pt;"><br>
</div>
</div>
</div>
</div>
</body>
</html>