<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=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</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 lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal>Hi All,<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal> I’ve
just started playing with the VTK libraries and seem to have run into a small
issue about reading my tif file. <o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal> If
I use the code to read my tif file:<o:p></o:p></p>
<p class=MsoNormal>----------------------------------<o:p></o:p></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span
style='color:#010001'>vtkSmartPointer</span><<span style='color:#010001'>vtkImageReader2</span>>
<span style='color:#010001'>pReader</span> = <span style='color:#010001'>vtkSmartPointer</span><<span
style='color:#010001'>vtkImageReader2</span>>::<span style='color:#010001'>New</span>();<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span
style='color:#010001'>pReader</span>-><span style='color:#010001'>SetFilePrefix</span>(<span
style='color:#A31515'>"TestImages\\input"</span>);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span
style='color:#010001'>pReader</span>-><span style='color:#010001'>SetFilePattern</span>(<span
style='color:#A31515'>"%s%03d.tif"</span>);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span
style='color:#010001'>pReader</span>-><span style='color:#010001'>SetDataScalarTypeToUnsignedChar</span>();<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span
style='color:#010001'>pReader</span>-><span style='color:#010001'>SetNumberOfScalarComponents</span>(1);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span
style='color:#010001'>pReader</span>-><span style='color:#010001'>SetDataOrigin</span>(0,0,0);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span
style='color:#010001'>pReader</span>-><span style='color:#010001'>SetDataSpacing</span>(1,1,1);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span
style='color:#010001'>pReader</span>-><span style='color:#010001'>SetFileLowerLeft</span>(0);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span
style='color:#010001'>pReader</span>-><span style='color:#010001'>SetDataExtent</span>(0,
274, 0, 246, 0, 10);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>--------------------- <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> The image file is not
correct. It’s kind of weird. It looks like the image is
shifted to the right and a wrap-around is done (where the right one-quarter
side of the image is on the left. <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p> </o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> If I use the code to
read my tif file:<o:p></o:p></span></p>
<p class=MsoNormal>----------------------------------<o:p></o:p></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span
style='color:#010001'>vtkSmartPointer</span><<span style='color:#010001'>vtkImageAppend</span>>
<span style='color:#010001'>pImageList</span> = <span style='color:#010001'>vtkSmartPointer</span><<span
style='color:#010001'>vtkImageAppend</span>>::<span style='color:#010001'>New</span>();<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span
style='color:#010001'>pImageList</span>-><span style='color:#010001'>SetAppendAxis</span>(2);<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span
style='color:blue'>for</span> (<span style='color:blue'>int</span> <span
style='color:#010001'>i</span>=0; <span style='color:#010001'>i</span><10; <span
style='color:#010001'>i</span>++)<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> {<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span
style='color:#010001'>vtkSmartPointer</span><<span style='color:#010001'>vtkTIFFReader</span>>
<span style='color:#010001'>pReader</span> = <span style='color:#010001'>vtkSmartPointer</span><<span
style='color:#010001'>vtkTIFFReader</span>>::<span style='color:#010001'>New</span>();<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span
style='color:#010001'>QString</span> <span style='color:#010001'>file</span> = <span
style='color:#A31515'>"TestImages\\GreenCells\\Images_2_0001_00"</span>
+ <span style='color:#010001'>QString</span>::<span style='color:#010001'>number</span>(<span
style='color:#010001'>i</span>) + <span style='color:#A31515'>".tif"</span>;<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span
style='color:#010001'>pReader</span>-><span style='color:#010001'>SetFileName</span>(<span
style='color:#010001'>file</span>.<span style='color:#010001'>toStdString</span>().<span
style='color:#010001'>c_str</span>());<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> <span
style='color:#010001'>pImageList</span>-><span style='color:#010001'>AddInput</span>(<span
style='color:#010001'>pReader</span>-><span style='color:#010001'>GetOutput</span>());<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> }<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>--------------------- <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> The image looks
beautiful and is correct. <o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p> </o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'> Is there something
that I’m missing on using the ImageReader2? I have a sample image
file if anyone wants to look at it.<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p> </o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'>Dougie<o:p></o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New"'><o:p> </o:p></span></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>---------------------------------------------------<o:p></o:p></p>
<p class=MsoNormal>Doug Hoppes <a href="doug@mbfbioscience.com">doug@mbfbioscience.com</a><o:p></o:p></p>
<p class=MsoNormal>Senior Software Engineer<o:p></o:p></p>
<p class=MsoNormal>MBF Bioscience (Microbrightfield, Inc.)<o:p></o:p></p>
<p class=MsoNormal>+1.802.288.9290 ext:119<o:p></o:p></p>
<p class=MsoNormal><a href="www.mbfbioscience.com">www.mbfbioscience.com</a><o:p></o:p></p>
<p class=MsoNormal>---------------------------------------------------<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>