<div dir="ltr">hi Timothee,<div><br></div><div>1. I did that. With .jpg on the filename, when running</div><div><br></div><div>writer->Update()</div><div><br></div><div>I get:</div><div><span style="font-family:Courier;font-size:10pt;color:rgb(0,0,0)">c:\itk-4.8.0\modules\io\jpeg\src\itkjpegimageio.cxx:454</span><br></div><div><span style="font-family:Courier;font-size:10pt;color:rgb(0,0,0)">Contents of that:</span></div><div><table class="" style="border-collapse:collapse;border-spacing:0px;color:rgb(51,51,51);font-family:Helvetica,arial,nimbussansl,liberationsans,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:13px;line-height:18.2px"><tbody><tr><td id="LC443" class="" style="padding:0px 10px;vertical-align:top;font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal"><span class="" style="color:rgb(167,29,93)">void</span> <span class="" style="color:rgb(121,93,163)">JPEGImageIO::WriteSlice</span>(std::string & fileName, <span class="" style="color:rgb(167,29,93)">const</span> <span class="" style="color:rgb(167,29,93)">void</span> *buffer)
<table class="" style="white-space:normal;border-collapse:collapse;border-spacing:0px;font-family:Helvetica,arial,nimbussansl,liberationsans,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:13px;line-height:18.2px"><tbody><tr><td id="LC444" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">{</td></tr><tr><td id="L445" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td id="LC445" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">  <span class="" style="color:rgb(150,152,150)">// use this class so return will call close</span></td></tr><tr><td id="L446" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td id="LC446" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">  JPEGFileWrapper <span class="">JPEGfp</span>(fileName.<span class="" style="color:rgb(0,134,179)">c_str</span>(), <span class="" style="color:rgb(24,54,145)"><span class="">"</span>wb<span class="">"</span></span>);</td></tr><tr><td id="L447" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td id="LC447" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">  <span class="" style="color:rgb(0,134,179)">FILE</span> *          fp = JPEGfp.<span class="">m_FilePointer</span>;</td></tr><tr><td id="L448" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td id="LC448" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">
</td></tr><tr><td id="L449" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td id="LC449" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">  <span class="" style="color:rgb(167,29,93)">if</span> ( !fp )</td></tr><tr><td id="L450" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td id="LC450" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">    {</td></tr><tr><td id="L451" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td id="LC451" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">    <span class="" style="color:rgb(0,134,179)">itkExceptionMacro</span>( <span class="" style="color:rgb(24,54,145)"><span class="">"</span>Unable to open file <span class="">"</span></span></td></tr><tr><td id="L452" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td id="LC452" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">                       << fileName</td></tr><tr><td id="L453" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td id="LC453" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">                       << <span class="" style="color:rgb(24,54,145)"><span class="">"</span> for writing.<span class="">"</span></span></td></tr><tr><td id="L454" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td id="LC454" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">                       << std::endl</td></tr><tr><td id="L455" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td id="LC455" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">                       << <span class="" style="color:rgb(24,54,145)"><span class="">"</span>Reason: <span class="">"</span></span></td></tr><tr><td id="L456" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td id="LC456" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">                       << <span class="" style="color:rgb(0,134,179)">itksys::SystemTools::GetLastSystemError</span>() );</td></tr><tr><td id="L457" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td id="LC457" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">    }</td></tr></tbody></table>
<table class="" style="white-space:normal;border-collapse:collapse;border-spacing:0px;font-family:Helvetica,arial,nimbussansl,liberationsans,freesans,clean,sans-serif,'Segoe UI Emoji','Segoe UI Symbol';font-size:13px;line-height:18.2px"><tbody><tr><td id="LC444" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">{</td></tr><tr><td id="L445" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td id="LC445" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">  <span class="" style="color:rgb(150,152,150)">// use this class so return will call close</span></td></tr><tr><td id="L446" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td id="LC446" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">  JPEGFileWrapper <span class="">JPEGfp</span>(fileName.<span class="" style="color:rgb(0,134,179)">c_str</span>(), <span class="" style="color:rgb(24,54,145)"><span class="">"</span>wb<span class="">"</span></span>);</td></tr><tr><td id="L447" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td id="LC447" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">  <span class="" style="color:rgb(0,134,179)">FILE</span> *          fp = JPEGfp.<span class="">m_FilePointer</span>;</td></tr><tr><td id="L448" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td id="LC448" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">
</td></tr><tr><td id="L449" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td id="LC449" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">  <span class="" style="color:rgb(167,29,93)">if</span> ( !fp )</td></tr><tr><td id="L450" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td id="LC450" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">    {</td></tr><tr><td id="L451" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td id="LC451" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">    <span class="" style="color:rgb(0,134,179)">itkExceptionMacro</span>( <span class="" style="color:rgb(24,54,145)"><span class="">"</span>Unable to open file <span class="">"</span></span></td></tr><tr><td id="L452" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td id="LC452" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">                       << fileName</td></tr><tr><td id="L453" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td id="LC453" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">                       << <span class="" style="color:rgb(24,54,145)"><span class="">"</span> for writing.<span class="">"</span></span></td></tr><tr><td id="L454" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td id="LC454" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">                       << std::endl</td></tr><tr><td id="L455" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td id="LC455" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">                       << <span class="" style="color:rgb(24,54,145)"><span class="">"</span>Reason: <span class="">"</span></span></td></tr><tr><td id="L456" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td id="LC456" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">                       << <span class="" style="color:rgb(0,134,179)">itksys::SystemTools::GetLastSystemError</span>() );</td></tr><tr><td id="L457" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;width:50px;min-width:50px;white-space:nowrap;font-size:12px;line-height:18px;color:rgba(0,0,0,0.298039);vertical-align:top;text-align:right;border-style:solid;border-color:rgb(238,238,238);border-width:0px 1px 0px 0px"></td><td id="LC457" class="" style="font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;padding:0px 10px;vertical-align:top;font-size:12px;white-space:pre;overflow:visible;word-wrap:normal">    }</td></tr></tbody></table></td></tr></tbody></table></div><div><br></div><div><div>2. I try with png. No exception, but I get a black image (same with another inputs).</div><div><br></div><div>3. Oook, let's try with bmp.</div></div><div><div>Another exception:</div><div><span style="font-family:Courier;font-size:10pt;color:rgb(0,0,0)">c:\itk-4.8.0\modules\io\bmp\src\itkbmpimageio.cxx:727</span></div></div><div><br></div><div><br></div><div><div>Seriously, it's frustating. Maybe I should come back to the <span style="color:rgb(128,0,128);white-space:pre-wrap">ExtractSliceImag</span><span style="color:rgb(128,0,128);white-space:pre-wrap">eFilter.</span></div><div>That's what I'm trying to do: just export a slice from my image.</div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-09-08 21:43 GMT+02:00 Timothee Evain <span dir="ltr"><<a href="mailto:tevain@telecom-paristech.fr" target="_blank">tevain@telecom-paristech.fr</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Marcos,<br>
<br>
Regarding the ExtractImageFilter, this is an expected result. As you can read here, <a href="http://www.itk.org/Doxygen/html/classitk_1_1ExtractImageFilter.html" rel="noreferrer" target="_blank">http://www.itk.org/Doxygen/html/classitk_1_1ExtractImageFilter.html</a> , setting the collapse direction is mandatory. The default setting is "Unknown" and the filter will not run correctly.<br>
<br>
So I suggest you add:<br>
extracter->DirectionCollapseToIdentity();<br>
<br>
This should works.<br>
<br>
<br>
Tim<br>
<br>
<br>
----- Mail original -----<br>
De: "Marcos" <<a href="mailto:fotosentido@gmail.com">fotosentido@gmail.com</a>><br>
À: <a href="mailto:insight-users@itk.org">insight-users@itk.org</a><br>
Envoyé: Mardi 8 Septembre 2015 21:06:25<br>
Objet: Re: [ITK] [ITK-users] itkImageFileWriter + ExtractSliceImageFilter: largest region exception<br>
<span class=""><br>
Hi,<br>
<br>
I know the input and desired regions, not sure how to look for the buffered region.<br>
<br>
1. Reviewing my code I saw I didn't set the input image for the extracter, so I added:<br>
extracter->SetInput(image);<br>
<br>
Good, right? But no. Still the same error.<br>
<br>
2. Then I tried switching to itkExtractImageFilter, and I got:<br>
Exception at 0x7633c42d, code: 0xe06d7363: C++ exception, flags=0x1 (execution cannot be continued) (first chance) at c:\itk-4.8.0-installed\include\itk-4.8\itkextractimagefilter.hxx:242<br>
<br>
So I had to look inside this code (why don't throw me more info in the try catch?) to see what's happening, and I read this:<br>
</span>itkExceptionMacro ( << " It is required that the strategy for collapsing the direction matrix be explicitly specified. " << " Set with either myfilter->SetDirectionCollapseToIdentity() or myfilter->SetDirectionCollapseToSubmatrix() "       << typeid ( ImageBase< InputImageDimension > * ). name () );<br>
<div><div class="h5">3. I also tried to insert a:<br>
image->Update();<br>
or<br>
image->UpdateOutputData();<br>
with same results.<br>
<br>
I was thinking about passing the reader, but I'd like to apply changes to my image, so this method would receive a modified copy (no DeepCopy method like in vtk?)<br>
<br>
<br>
Yes, the input image is connected to a pipeline:<br>
itk::Image -> itk:: ImageToVTKImageFilter -> vtk:: vtkImageFlip -> vtkImageData -> vtkImageViewer2<br>
<br>
<br>
Thanks again for your interest.<br>
<br>
<br>
2015-09-08 16:16 GMT+02:00 Bradley Lowekamp < <a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a> > :<br>
<br>
<br>
<br>
Hello,<br>
<br>
What is the buffered region for the input image? Is the input image connected to a pipeline?<br>
<br>
Perhaps you just forgot to update the input image before running this function?<br>
<br>
Brad<br>
<br>
On Sep 7, 2015, at 5:21 PM, Marcos < <a href="mailto:fotosentido@gmail.com">fotosentido@gmail.com</a> > wrote:<br>
<br>
<br>
<br>
<br>
Hi,<br>
<br>
I have a method that was exporting fine one frame from my itk::Image.<br>
<br>
My method:<br>
<br>
void Exporter :: exportOriginal ( QString fileName , ImageType :: Pointer image , int frame )<br>
{<br>
typedef itk :: ImageFileWriter < FrameImageType > WriterType ;<br>
WriterType :: Pointer writer = WriterType :: New ();<br>
<br>
writer -> SetFileName ( fileName . toStdString (). c_str ());<br>
<br>
ImageType :: RegionType inputRegion = image -> GetLargestPossibleRegion ();<br>
<br>
ImageType :: IndexType index = inputRegion . GetIndex ();<br>
ImageType :: SizeType size = inputRegion . GetSize ();<br>
<br>
index [ 0 ] = 0 ;<br>
index [ 1 ] = 0 ;<br>
index [ 2 ] = frame ;<br>
<br>
// 3D to 2D<br>
size [ 2 ] = 0 ;<br>
<br>
ImageType :: RegionType outputRegion ;<br>
outputRegion . SetIndex ( index );<br>
outputRegion . SetSize ( size );<br>
<br>
</div></div>typedef itk :: Testing :: ExtractSliceImageFilter < ImageType , FrameImageType > ExtractType ;<br>
<div><div class="h5">ExtractType :: Pointer extracter = ExtractType :: New ();<br>
extracter -> SetExtractionRegion ( outputRegion );<br>
<br>
writer -> SetInput ( extracter -> GetOutput ());<br>
try<br>
{<br>
writer -> Update ();<br>
}<br>
catch ( itk :: ExceptionObject & ex )<br>
{<br>
std : cerr << ex << std :: endl ;<br>
}<br>
}<br>
<br>
as inputRegion, I have:<br>
index: [0, 0, 0]<br>
size: [512, 512, 12]<br>
<br>
as outputRegion, I have:<br>
index: [0, 0, 1] # first frame<br>
size: [512, 512, 0]<br>
<br>
<br>
<br>
But I'm not sure what happened, now with every image I got an exception:<br>
itkimagefilewriter.hxx:287: " Largest possible region does not fully contain requested paste IO region "<br>
<br>
By the way, my try catch is not getting the exception message, I had to look inside the writer class.<br>
Any ideas? Thank you.<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" rel="noreferrer" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/insight-users</a><br>
<br>
<br>
<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" rel="noreferrer" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/insight-users</a><br>
<br>
</div></div>_______________________________________________<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>
</blockquote></div><br></div>