I&#39;ll try to reproduce the problem. Probably not until later though.<br><br><div class="gmail_quote">On Wed, May 18, 2011 at 10:12 AM, Dora Szasz <span dir="ltr">&lt;<a href="mailto:dora.szasz@yahoo.com">dora.szasz@yahoo.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: times new roman,new york,times,serif; font-size: 12pt;">
<div><span>Yes. Exactly the same one.</span></div><div><br></div><div style="font-size: 12pt; font-family: &#39;times new roman&#39;,&#39;new york&#39;,times,serif;"><div style="font-size: 12pt; font-family: &#39;times new roman&#39;,&#39;new york&#39;,times,serif;">
<font size="2" face="Arial"><div class="im"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Bill Lorensen &lt;<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>&gt;<br><b><span style="font-weight: bold;">To:</span></b> Dora Szasz &lt;<a href="mailto:dora.szasz@yahoo.com" target="_blank">dora.szasz@yahoo.com</a>&gt;<br>
<b><span style="font-weight: bold;">Cc:</span></b> &quot;<a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a>&quot; &lt;<a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a>&gt;<br>
</div><b><span style="font-weight: bold;">Sent:</span></b> Wednesday, May 18, 2011 5:06 PM<div><div></div><div class="h5"><br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Insight-users] Problem generating a 3D volume from a set of slices<br>
</div></div></font><div><div></div><div class="h5"><br><div>Do you get the same exception message?<br><br><div>On Wed, May 18, 2011 at 9:07 AM, Dora Szasz <span dir="ltr">&lt;<a rel="nofollow" href="mailto:dora.szasz@yahoo.com" target="_blank">dora.szasz@yahoo.com</a>&gt;</span> wrote:<br>
<blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 12pt; font-family: &#39;times new roman&#39;,&#39;new york&#39;,times,serif;"><div><span><div>It writes me the name of the files, but no .mhd ouput file.</div>

<div><br></div><div>File: Dora0001.png</div><div>File: Dora0002.png</div><div>File: Dora0003.png</div><div>File: Dora0004.png</div><div>File: Dora0005.png</div></span></div><div style="font-size: 12pt;">
<br></div><div style="font-size: 12pt;"><div style="font-size: 12pt;"><font size="2" face="Arial"><div>
<hr size="1"><b><span style="font-weight: bold;">From:</span></b> Bill Lorensen &lt;<a rel="nofollow" href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>&gt;<br><b><span style="font-weight: bold;">To:</span></b> Dora Szasz &lt;<a rel="nofollow" href="mailto:dora.szasz@yahoo.com" target="_blank">dora.szasz@yahoo.com</a>&gt;<br>

<b><span style="font-weight: bold;">Cc:</span></b> Insight-Users
 &lt;<a rel="nofollow" href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a>&gt;<br></div><b><span style="font-weight: bold;">Sent:</span></b> Wednesday, May 18, 2011 3:27 PM<div><div><br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Insight-users] Problem generating a 3D volume from a set of slices<br>

</div></div></font><div><div><br>
<div>[please keep the mailing list involved]<br>Try printing out the generated filenames. Something like:<br><br>  std::vector&lt;std::string&gt; names = nameGenerator-&gt;GetFileNames();<br>  std::vector&lt;std::string&gt;::iterator nit;<br>


<br>  for (nit = names.begin();<br>       nit != names.end();<br>       nit++)<br>    {<br>    std::cout &lt;&lt; &quot;File: &quot; &lt;&lt; (*nit).c_str() &lt;&lt; std::endl;<br>    }<br><br><br><br><br><div>
On Wed, May 18, 2011 at 8:16 AM, Dora Szasz <span dir="ltr">&lt;<a rel="nofollow" href="mailto:dora.szasz@yahoo.com" target="_blank">dora.szasz@yahoo.com</a>&gt;</span> wrote:<br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">


<div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 12pt;"><div>I&#39;ve tried all the possibilities. Even if I run BrainModel.exe 1 5 out.mhd the error appears and I don&#39;t know why.</div>


<div><br></div><div style="font-size: 12pt;"><div style="font-size: 12pt;"><font size="2" face="Arial"><div>
<hr size="1"><b><span style="font-weight: bold;">From:</span></b> Bill Lorensen &lt;<a rel="nofollow" href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>&gt;<br><b><span style="font-weight: bold;">To:</span></b> Dora Szasz &lt;<a rel="nofollow" href="mailto:dora.szasz@yahoo.com" target="_blank">dora.szasz@yahoo.com</a>&gt;<br>


</div><b><span style="font-weight: bold;">Cc:</span></b> Insight-Users &lt;<a rel="nofollow" href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a>&gt;<br><b><span style="font-weight: bold;">Sent:</span></b> Wednesday, May 18, 2011 3:00 PM<div>


<div><br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Insight-users] Problem generating a 3D
 volume from a set of slices<br></div></div></font><div><div><br>
<div>But the program should be run as:<br>BrainModel.exe 1 5 out.mhd<br><br>at least according to the source you attached.<br><br><div>On Wed, May 18, 2011 at 2:00 AM, Dora Szasz <span dir="ltr">&lt;<a rel="nofollow" href="mailto:dora.szasz@yahoo.com" target="_blank">dora.szasz@yahoo.com</a>&gt;</span> wrote:<br>



<blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 12pt;">

<div><span><div>Hi Bill,</div><div><br></div><div>Yes, the names of the files are correct, but the following  error message appears:</div><div>I have verified and the size of the pictures is the same. I don&#39;t know what could be the problem.</div>



<div>Thank you!</div><div><br></div><div><i>D:\Lib\Project\Dora\bin\Debug&gt;BrainModel.exe Dora0001d.png Dora0005d.png out.mhd</i></div><div><i>ExceptionObject caught !</i></div><div><i><br></i></div><div><i>itk::ExceptionObject (00B2F4D8)</i></div>



<div><i>Location: &quot;void __thiscall itk::ImageFileWriter&lt;class itk::Image&lt;unsigned char,3</i></div><div><i>&gt; &gt;::Write(void)&quot;</i></div><div><i>File: d:\lib\_itk\source\code\io\itkImageFileWriter.txx</i></div>



<div><i>Line: 271</i></div><div><i>Description: itk::ERROR: ImageFileWriter(0012F3F8): Largest possible region
 does</i></div><div><i> not fully contain requested paste IO regionPaste IO region: ImageIORegion (00B2</i></div><div><i>F910)</i></div><div><i>  Dimension: 3</i></div><div><i>  Index: 0 0 0</i></div><div><i>  Size: 0 0 1</i></div>



<div><i>Largest possible region: ImageRegion (00B2F9C4)</i></div><div><i>  Dimension: 3</i></div><div><i>  Index: [0, 0, 0]</i></div><div><i>  Size: [0, 0, 1]</i></div></span></div><div style="font-size: 12pt;">
<br></div><div style="font-size: 12pt;"><div style="font-size: 12pt;"><div>
<font size="2" face="Arial"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Bill Lorensen &lt;<a rel="nofollow" href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>&gt;<br><b><span style="font-weight: bold;">To:</span></b> Dora Szasz &lt;<a rel="nofollow" href="mailto:dora.szasz@yahoo.com" target="_blank">dora.szasz@yahoo.com</a>&gt;<br>



<b><span style="font-weight: bold;">Cc:</span></b> &quot;<a rel="nofollow" href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a>&quot; &lt;<a rel="nofollow" href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a>&gt;<br>



<b><span style="font-weight: bold;">Sent:</span></b> Wednesday, May 18, 2011 7:03 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Insight-users] Problem generating a 3D volume from a set of slices<br></font></div>



<div><div><br>
<div>Oops...<br>Dora0001d.png<br>Dora0002d.png<br>Dora0003d.png<br>...<br><br><br><div>On Wed, May 18, 2011 at 12:02 AM, Bill Lorensen <span dir="ltr">&lt;<a rel="nofollow" href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>&gt;</span> wrote:<br>




<blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">What are the names of the file? From your code they should be something like:<br><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">Dora00001d.png</font><br>




<font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">Dora00002d.png<br>
</font><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">Dora00003d.png<br>...<br><br>Is that how your files are named?<br><br>Bill<br><br></font><div><div><div>
On Tue, May 17, 2011 at 4:19 PM, Dora Szasz <span dir="ltr">&lt;<a rel="nofollow" href="mailto:dora.szasz@yahoo.com" target="_blank">dora.szasz@yahoo.com</a>&gt;</span> wrote:<br>
</div></div><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 12pt;">





<div style="font-size: 12pt;">Hello all,</div><div style="font-size: 12pt;"><br>

</div><div style="font-size: 12pt;">I am trying to make a 3D volume using a set of .png images. I want to obtain a 3D image (for example .mhd), but It doesn&#39;t generate any output.</div>

<div style="font-size: 12pt;">My code is the following:</div><div style="font-size: 12pt;">

<br></div><div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">#include &quot;itkImage.h&quot;</font></div><div><font face="&#39;times new
 roman&#39;, &#39;new york&#39;, times, serif"> #include &quot;itkImageSeriesReader.h&quot;</font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif"> #include &quot;itkImageFileWriter.h&quot;</font></div>





<div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif"> #include &quot;itkNumericSeriesFileNames.h&quot;</font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif"> #include &quot;itkPNGImageIO.h&quot;</font></div>





<div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif"><br></font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif"> int main( int argc, char ** argv )</font></div>





<div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif"> {</font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">  // Verify the number of
 parameters in the command line</font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">  if( argc &lt; 4 )</font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">    {</font></div>





<div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">    std::cerr &lt;&lt; &quot;Usage: &quot; &lt;&lt; std::endl;</font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">    std::cerr &lt;&lt; argv[0] &lt;&lt; &quot; firstSliceValue lastSliceValue outputImageFile &quot; &lt;&lt; std::endl;</font></div>





<div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">    return EXIT_FAILURE;</font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">    }</font></div><div><font face="&#39;times new
 roman&#39;, &#39;new york&#39;, times, serif"><br></font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">  typedef unsigned char   PixelType;</font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">  const unsigned int Dimension = 3;</font></div>





<div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif"><br></font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">  typedef itk::Image&lt; PixelType, Dimension &gt;  ImageType;</font></div>





<div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">  typedef itk::ImageSeriesReader&lt; ImageType &gt;  ReaderType;</font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">  typedef itk::ImageFileWriter&lt;   ImageType &gt;
  WriterType;</font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif"><br></font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">  ReaderType::Pointer reader = ReaderType::New();</font></div>





<div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">  WriterType::Pointer writer = WriterType::New();</font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif"><br>





</font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">  const unsigned int first = atoi( argv[1] );</font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">  const unsigned int last  = atoi( argv[2] );</font></div>





<div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif"><br></font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">  const char * outputFilename = argv[3];</font></div>





<div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif"><br></font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">  typedef itk::NumericSeriesFileNames    NameGeneratorType;</font></div>





<div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif"><br></font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">  NameGeneratorType::Pointer nameGenerator = NameGeneratorType::New();</font></div>





<div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif"><br></font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">  nameGenerator-&gt;SetSeriesFormat( &quot;Dora00%02d.png&quot; );</font></div>





<div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif"><br></font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">  nameGenerator-&gt;SetStartIndex( first );</font></div>





<div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">  nameGenerator-&gt;SetEndIndex( last );</font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">  nameGenerator-&gt;SetIncrementIndex( 1 );</font></div>





<div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif"><br></font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">  reader-&gt;SetImageIO( itk::PNGImageIO::New() );</font></div>





<div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">  reader-&gt;SetFileNames( nameGenerator-&gt;GetFileNames()
  );</font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif"><br></font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">  writer-&gt;SetFileName( outputFilename );</font></div>





<div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">  writer-&gt;SetInput( reader-&gt;GetOutput() );</font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">  try</font></div>





<div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">    {</font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">    writer-&gt;UpdateLargestPossibleRegion();</font></div>





<div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">        writer-&gt;Update();</font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">    }</font></div><div>




<font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">  catch( itk::ExceptionObject &amp; err )</font></div>
<div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">    {</font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">    std::cerr &lt;&lt; &quot;ExceptionObject caught !&quot; &lt;&lt; std::endl;</font></div>





<div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">    std::cerr &lt;&lt; err &lt;&lt; std::endl;</font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">    return EXIT_FAILURE;</font></div>





<div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">    }</font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">  return EXIT_SUCCESS;</font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif"> }</font></div>





<div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif"><br></font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">1. How could I modify it in order to obtain the volume?</font></div>





<div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">2. How could I modify it in order to use &quot;itkImageToVTKImageFilter.h&quot; to display it on vtk window?</font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif"><br>





</font></div><div><font face="&#39;times new roman&#39;, &#39;new york&#39;, times, serif">Thank you a lot!</font></div></div><div style="font-size: 12pt;">

<br></div></div></div><br></div></div>_____________________________________<br>
Powered by <a rel="nofollow" href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a rel="nofollow" href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a rel="nofollow" href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a rel="nofollow" href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a rel="nofollow" href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>
</blockquote></div><br>
</div><br><br></div></div></div></div></div></div></blockquote></div><br>
</div><br><br></div></div></div></div></div></div></blockquote></div><br>
</div><br><br></div></div></div></div></div></div></blockquote></div><br>
</div><br><br></div></div></div></div></div></div></blockquote></div><br>