<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Hi Imre,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">you can extract a single slice using <a href="http://www.itk.org/Doxygen/html/classitk_1_1ExtractImageFilter.html">extract filter</a> (collapse on 3rd and 4th dimension). Then you can access it using <a href="http://www.itk.org/Doxygen44/html/RGBImage_8cxx-example.html">RGB syntax</a>. I don't think you need to explicitly set TIFFImageIO, it should be chosen automatically based on the file extension.</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Regards,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Dženan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 20, 2015 at 10:24 AM, Imre Goretzki <span dir="ltr"><<a href="mailto:goretzki.imre@gmail.com" target="_blank">goretzki.imre@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Hey guys,<br>
<br>
i was wondering if you could help me getting all pages from a
multi-paged TIFF image.<br>
<br>
There are plenty of examples on how to read tiff images, e.g.<br>
<br>
<pre style="margin:0px 0px 1em;padding:5px;border:0px;font-size:13px;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;display:block;color:rgb(57,51,24);word-wrap:normal;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;word-spacing:0px;background-color:rgb(238,238,238)"><code style="margin:0px;padding:0px;border:0px;font-size:13px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;background-color:rgb(238,238,238)"><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,139)">typedef</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> itk::RGBAPixel<unsigned char> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(43,145,175)">PixelType</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">;</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(128,128,128)">// Pixel type</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">
</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,139)">const</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,139)">unsigned</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> int</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,139)"></span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(43,145,175)">Dimension</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0p x;font-size:13px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> 3</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(128,0,0)"></span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">;</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">
</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,139)">typedef</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> itk</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">::</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(43,145,175)">Image</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"><</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(43,145,175)">PixelType</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">,</span><span> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(43,145,175)">Dimension</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">></span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(43,145,175)">ImageType</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">;</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">
</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(43,145,175)">ImageType</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">::</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(43,145,175)">Pointer</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> image</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">;
</span></code><code style="margin:0px;padding:0px;border:0px;font-size:13px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;background-color:rgb(238,238,238)"><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,139)">typedef</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> itk</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">::</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(43,145,175)">ImageFileReader</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"><</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(43,145,175)">ImageType</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">></span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(43,145,175)">ReaderType</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">;</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"></span></code>
<code style="margin:0px;padding:0px;border:0px;font-size:13px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;background-color:rgb(238,238,238)"><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"><code style="margin:0px;padding:0px;border:0px;font-size:13px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;background-color:rgb(238,238,238)"><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"><code><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">itk::TIFFImageIO::Pointer io = itk</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">::</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(43,145,175)">TIFFImageIO</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">::</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(43,145,175)">New</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">()</span></code></span></code>
</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(43,145,175)">ReaderType</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">::</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(43,145,175)">Pointer</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> reader</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"></span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(43,145,175)">ReaderType</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">::</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(43,145,175)">New</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">();</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">
</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,139)">const</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,139)">char</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">*</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> filename </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(128,0,0)">"path/to/file.tif"</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">;</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">
</span></code><code style="margin:0px;padding:0px;border:0px;font-size:13px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;background-color:rgb(238,238,238)"><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"><code style="margin:0px;padding:0px;border:0px;font-size:13px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;background-color:rgb(238,238,238)"></code>
reader</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">-></span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(43,145,175)">SetImageIO</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">(io</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">);</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">
reader</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">-></span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(43,145,175)">SetFileName</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">(</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">filename</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">);
</span></code><code style="margin:0px;padding:0px;border:0px;font-size:13px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;background-color:rgb(238,238,238)"><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(43,145,175)">ImageType</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">::</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(43,145,175)">IndexType</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> pixelIndex</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">;</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">
pixelIndex</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">[</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(128,0,0)">0</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">]</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(128,0,0)">103</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">; //x</span><span>
pixelIndex</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">[</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(128,0,0)">1</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">]</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(128,0,0)">178</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">; //y</span><span>
</span></code><code style="margin:0px;padding:0px;border:0px;font-size:13px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;background-color:rgb(238,238,238)"><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"><code style="margin:0px;padding:0px;border:0px;font-size:13px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;background-color:rgb(238,238,238)"><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">pixelIndex</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">[</span><span style="margin:0px;padding:0px;border:0p x;font-size:13px;color:rgb(128,0,0)">2</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">]</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(128,0,0)">0</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">;</span></code>
</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(43,145,175)">ImageType</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">::</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(43,145,175)">PixelType</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> pixelValue </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> image</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">-></span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(43,145,175)">GetPixel</span><span style="margin:0 px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">(</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">pixelIndex</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">);</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">
std</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">::</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">cout </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"><<</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(128,0,0)">"pixel : "</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"><<</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> pixelValue </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"><<</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> std</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">::</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">endl</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">;</span></code>
</pre>
in this example, if i'm not mistaking, the third pixelIndex
corresponds to the pages of a stacked tiff image.<br>
<br>
Is this the right way to get access to single pages? And how do I
get the RGB values?<br>
<br>
My TIFF file is structured as follows:<br>
<br>
It has at least 47 Images stored, each of those has the following
dimensions<br>
520x520x3 (WxHxRGB)<br>
<br>
I checked these informations via
SCIFIOImageIO::ReadImageInformation, like this:<br>
<br>
<pre style="padding:0px;border:0px none white;color:rgb(0,0,0);line-height:1.2em;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:1em;margin:0px;vertical-align:top;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;background:rgb(249,249,249) none repeat scroll 0% 0%"><font face="Helvetica, Arial, sans-serif">std<span style="color:rgb(0,128,128)">::</span><span style="color:rgb(0,0,221)">cout</span> <span style="color:rgb(0,0,128)"><<</span> <span style="color:rgb(255,0,0)">"Pixel Type is "</span> <span style="color:rgb(0,0,128)"><<</span> imageIO<span style="color:rgb(0,0,64)">-</span><span style="color:rgb(0,0,128)">></span>GetComponentTypeAsString<span style="color:rgb(0,128,0)">(</span>pixelType<s style="color:rgb(0,128,0)">) <span style="color:rgb(0,0,128)"><<</span> std<span style="color:rgb(0,128,128)">::</span><span style="color:rgb(0,119,136)">endl</span><span style="color:rgb(0,128,128)">;</span>
<span style="color:rgb(0,0,255)">const</span> <span style="color:rgb(0,0,255)">size_t</span> numDimensions <span style="color:rgb(0,0,128)">=</span> imageIO<span style="color:rgb(0,0,64)">-</span><span style="color:rgb(0,0,128)">></span>GetNumberOfDimensions<span style="color:rgb(0,128,0)">(</span><span style="color:rgb(0,128,0)">)</span><span style="color:rgb(0,128,128)">;</span>
std<span style="color:rgb(0,128,128)">::</span><span style="color:rgb(0,0,221)">cout</span> <span style="color:rgb(0,0,128)"><<</span> <span style="color:rgb(255,0,0)">"numDimensions: "</span> <span style="color:rgb(0,0,128)"><<</span> numDimensions <span style="color:rgb(0,0,128)"><<</span> std<span style="color:rgb(0,128,128)">::</span><span style="color:rgb(0,119,136)">endl</span><span style="color:rgb(0,128,128)">;</span> <span style="color:rgb(102,102,102)">// '5'</span>
std<span style="color:rgb(0,128,128)">::</span><span style="color:rgb(0,0,221)">cout</span> <span style="color:rgb(0,0,128)"><<</span> <span style="color:rgb(255,0,0)">"component size: "</span> <span style="color:rgb(0,0,128)"><<</span> imageIO<span style="color:rgb(0,0,64)">-</span><span style="color:rgb(0,0,128)">></span>GetComponentSize<span style="color:rgb(0,128,0)">(</span><span style="color:rgb(0,128,0)">)</span> <span style="color:rgb(0,0,128)"><<</span> std<span style="color:rgb(0,128,128)">::</span><span style="color:rgb(0,119,136)">endl</span><span style="color:rgb(0,128,128)">;</span> <span style="color:rgb(102,102,102)">// '8'</span>
std<span style="color:rgb(0,128,128)">::</span><span style="color:rgb(0,0,221)">cout</span> <span style="color:rgb(0,0,128)"><<</span> <span style="color:rgb(255,0,0)">"pixel type (string): "</span> <span style="color:rgb(0,0,128)"><<</span> imageIO<span style="color:rgb(0,0,64)">-</span><span style="color:rgb(0,0,128)">></span>GetPixelTypeAsString<span style="color:rgb(0,128,0)">(</span>imageIO<span style="color:rgb(0,0,64)">-</span><span style="color:rgb(0,0,128)">></span>GetPixelType<span style="color:rgb(0,128,0)">(</span><span style="color:rgb(0,128,0)">)</span><span style="color:rgb(0,128,0)">)</span> <span style="color:rgb(0,0,128)"><<</span> std<span style="color:rgb(0,128,128)">::</span><span>endl</span><span style="color:rgb(0,128,128)">;</span> <span style="color:rgb(102,102,102)">// 'vector'</span>
std<span style="color:rgb(0,128,128)">::</span><span style="color:rgb(0,0,221)">cout</span> <span style="color:rgb(0,0,128)"><<</span> <span style="color:rgb(255,0,0)">"pixel type: "</span> <span style="color:rgb(0,0,128)"><<</span> imageIO<span style="color:rgb(0,0,64)">-</span><span style="color:rgb(0,0,128)">></span>GetPixelType<span style="color:rgb(0,128,0)">(</span><span style="color:rgb(0,128,0)">)</span> <span style="color:rgb(0,0,128)"><<</span> std<span style="color:rgb(0,128,128)">::</span><span style="color:rgb(0,119,136)">endl</span><span style="color:rgb(0,128,128)">;</span> <span style="color:rgb(102,102,102)">// '5'</span></s></font></pre>
<br>
or this:<br>
<br>
<pre style="padding:0px;border:0px none white;color:rgb(0,0,0);line-height:1.2em;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:1em;margin:0px;vertical-align:top;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;background:rgb(249,249,249) none repeat scroll 0% 0%"><font face="Helvetica, Arial, sans-serif">ImageType::Pointer img = reader->GetOutput();
ImageType::RegionType = img->GetLargestPossibleRegion();
std<span style="color:rgb(0,128,128)">::</span><span style="color:rgb(0,0,221)">cout</span> <span style="color:rgb(0,0,128)"><<</span> <span style="color:rgb(255,0,0)">"Region: "</span> <span style="color:rgb(0,0,128)"><<</span> region <span style="color:rgb(0,0,128)"><<</span> std<span style="color:rgb(0,128,128)">::</span><span style="color:rgb(0,119,136)">endl</span><span style="color:rgb(0,128,128)">;</span> <span style="color:rgb(102,102,102)">// '5'
OUTPUT:
</span></font>
<font face="Helvetica, Arial, sans-serif"><span style="color:rgb(102,102,102)">Dimension: 5
Index: [0,0,0,0,0]
Size: [520, 520, 47, 1, 3]
</span></font></pre>
<br>
<br>
If I print the pixels, I will get the same output for each channel
(which I guess is RGB).<br>
<br>
If I change the input dimension to 5, the index has to be changed:<br>
<br>
<pre style="margin:0px 0px 1em;padding:5px;border:0px;font-size:13px;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;display:block;color:rgb(57,51,24);word-wrap:normal;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;word-spacing:0px;background-color:rgb(238,238,238)"><code style="margin:0px;padding:0px;border:0px;font-size:13px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;background-color:rgb(238,238,238)"><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(43,145,175)">ImageType</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">::</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(43,145,175)">IndexType</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> pixelIndex</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">;</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">
pixelIndex</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">[</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(128,0,0)">0</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">]</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> 240</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">; //x</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">
pixelIndex</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">[</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(128,0,0)">1</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">]</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> 430</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(128,0,0)"></span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">; //y</span><span>
</span></code><code style="margin:0px;padding:0px;border:0px;font-size:13px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;background-color:rgb(238,238,238)"><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"><code style="margin:0px;padding:0px;border:0px;font-size:13px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;background-color:rgb(238,238,238)"><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">pixelIndex</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">[</span><span style="margin:0px;padding:0px;border:0p x;font-size:13px;color:rgb(128,0,0)">2</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">]</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(128,0,0)">0</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">;</span></code> //z
</span></code><code style="margin:0px;padding:0px;border:0px;font-size:13px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;background-color:rgb(238,238,238)"><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"><code style="margin:0px;padding:0px;border:0px;font-size:13px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;background-color:rgb(238,238,238)"><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">pixelIndex</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">[</span><span style="margin:0px;padding:0px;border:0p x;font-size:13px;color:rgb(128,0,0)">3</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">]</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(128,0,0)">0</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">;</span></code> //timestamp i guess? Dimension of this is always 1 for my data
</span></code><code style="margin:0px;padding:0px;border:0px;font-size:13px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;background-color:rgb(238,238,238)"><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"><code style="margin:0px;padding:0px;border:0px;font-size:13px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;background-color:rgb(238,238,238)"><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">pixelIndex</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">[4</span><span style="margin:0px;padding:0px;border:0 px;font-size:13px;color:rgb(128,0,0)"></span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">]</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(128,0,0)">0</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">;</span></code> //R-Channel</span></code>
<code style="margin:0px;padding:0px;border:0px;font-size:13px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;background-color:rgb(238,238,238)"><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"><code style="margin:0px;padding:0px;border:0px;font-size:13px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;background-color:rgb(238,238,238)"><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">pixelIndex</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">[4</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(128,0,0)"></span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">]</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> 1</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(128,0,0)"></span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">;</span></code> //G-Channel</span></code>
<code style="margin:0px;padding:0px;border:0px;font-size:13px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;background-color:rgb(238,238,238)"><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"><code style="margin:0px;padding:0px;border:0px;font-size:13px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit;background-color:rgb(238,238,238)"><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">pixelIndex</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">[4</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(128,0,0)"></span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">]</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> </span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">=</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)"> 2</span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(128,0,0)"></span><span style="margin:0px;padding:0px;border:0px;font-size:13px;color:rgb(0,0,0)">;</span></code> //B-Channel</span></code>
</pre>
Is this correct?<br>
<br>
<pre style="padding:0px;border:0px none white;color:rgb(0,0,0);line-height:1.2em;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:1em;margin:0px;vertical-align:top;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px;background:rgb(249,249,249) none repeat scroll 0% 0%"><font face="Helvetica, Arial, sans-serif"><span style="color:rgb(102,102,102)">OUTPUT for pixels via img->GetPixel(pixelIndex) is
</span></font>
[930, 930, 930]
<font face="Helvetica, Arial, sans-serif"><span style="color:rgb(102,102,102)">for idx = [ {{240, 430, 0, 0, 0}}</span></font><font face="Helvetica, Arial, sans-serif"><span style="color:rgb(102,102,102)"> , </span></font><font face="Helvetica, Arial, sans-serif"><span style="color:rgb(102,102,102)"> {{240, 430, 0, 0, 1}}</span></font> , <font face="Helvetica, Arial, sans-serif"><span style="color:rgb(102,102,102)">{{240, 430, 0, 0, 2}}</span></font> ]
</pre>
<br>
<br>
I could think of using an ImageIterator, but I don't know how to use
them in a multi-paged image.<br>
<br>
The last thing I would like to ask you is, if you could help me on
how to use the TIFFImageIO::ReadVolume.<br>
It says that you could read 3D images, but there are neither
examples nor tips.<br>
<br>
To sum things up, i would like to know if there is a good way to
access each image in such a multi-paged TIFF file.<br>
<br>
I really hope, you guys can help me.<br>
<br>
Thanks<span class="HOEnZb"><font color="#888888"><br>
Imre<br>
</font></span></div>
<br>_______________________________________________<br>
Community mailing list<br>
<a href="mailto:Community@itk.org">Community@itk.org</a><br>
<a href="http://public.kitware.com/mailman/listinfo/community" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/community</a><br>
<br></blockquote></div><br></div>