Hi, Melanie.<div><br></div><div>Use The metaheader format (.mha or mhd) with itkImageFileWriter. They can handle the covariant vector image type. No idea of Nrrd supports covariant vectors</div><div><br></div><div>Regards<br>
<br><div class="gmail_quote">On Thu, Apr 7, 2011 at 5:10 PM, Melanie Uks <span dir="ltr">&lt;<a href="mailto:meluks2010@googlemail.com">meluks2010@googlemail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I tried to design an example for the GradientRecursiveGaussianImageFilter. Now I have a problem finding a file format for the &quot;CovariantVector&quot;-OutputImage. I tried to use nrrd :<br><br>    itk::NrrdImageIO::Pointer io = itk::NrrdImageIO::New();<br>

    //io-&gt;SetNrrdVectorType( nrrdKindList );<br>    io-&gt;SetFileType( itk::ImageIOBase::ASCII );<br>    <br>    //create the reader and writer <br>     ReaderType::Pointer reader = ReaderType::New();<br>     WriterType::Pointer nrrdWriter = WriterType::New();<br>

    <br>    //recover file names from command line arguments<br>    const char * inputFilename  = argv[1];<br>    const char * outputFilename = argv[2];<br><br>    reader-&gt;SetFileName( inputFilename  );<br>    nrrdWriter-&gt;UseInputMetaDataDictionaryOn();<br>

    nrrdWriter-&gt;SetImageIO(io);<br>    nrrdWriter-&gt;SetFileName(outputFilename);<br><br>    //  processing pipeline:<br>    filter-&gt;SetInput( reader-&gt;GetOutput() );<br>    nrrdWriter-&gt;SetInput( filter-&gt;GetOutput() );<br>

<br>    try <br>    { <br>        //execute the pipeline<br>        nrrdWriter-&gt;Update(); <br>    } <br>    catch( itk::ExceptionObject &amp; err ) <br>    { <br>        std::cerr &lt;&lt; &quot;ExceptionObject caught !&quot; &lt;&lt; std::endl; <br>

        std::cerr &lt;&lt; err &lt;&lt; std::endl; <br>        return EXIT_FAILURE;<br>    } <br><br>This didn&#39;t work! I guess the following part would help (copied from<a href="http://www.itk.org/Wiki/Getting_Started_with_the_NRRD_Format" target="_blank"> here</a>)<br>

<pre style="font-family:arial,helvetica,sans-serif">  itk::NrrdImageIO::Pointer io = itk::NrrdImageIO::New();
  // This statement is to be added to the ITK CVS Release
  <b>io-&gt;SetNrrdVectorType( nrrdKindList )</b>;
  io-&gt;SetFileType( itk::ImageIOBase::ASCII );</pre>But it was not possible because &quot;SetNrrdVectorType&quot; does not exist...<br><br>Anyway: is there a file format to save vector images and how to do???<br><br>Thanks for your help!<br>
<font color="#888888">
<br>Melanie</font><div><div></div><div class="h5"><br><br><br><div class="gmail_quote">2011/4/5 Melanie Uks <span dir="ltr">&lt;<a href="mailto:meluks2010@googlemail.com" target="_blank">meluks2010@googlemail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Ok, I try to. I will contact you, if I need help for the example...<br><font color="#888888">Melanie</font><div><div></div><div><br><br><div class="gmail_quote">2011/4/5 David Doria <span dir="ltr">&lt;<a href="mailto:daviddoria@gmail.com" target="_blank">daviddoria@gmail.com</a>&gt;</span><br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="gmail_quote"><div>On Tue, Apr 5, 2011 at 5:32 AM, Sergio Vera <span dir="ltr">&lt;<a href="mailto:sergio.vera@alma3d.com" target="_blank">sergio.vera@alma3d.com</a>&gt;</span> wrote:<br>



<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi, Melanie<div>Indeed, using that filter you will obtain only the gradient magnitude.</div><div><br></div><div>If you need the gradient as a vector image, use <a href="http://www.itk.org/Doxygen320/html/classitk_1_1GradientRecursiveGaussianImageFilter.html#_details" target="_blank">http://www.itk.org/Doxygen320/html/classitk_1_1GradientRecursiveGaussianImageFilter.html#_details</a> for instance</div>




<div><br></div><div>regards<br></div></blockquote><div><br></div></div><div>Melanie,</div><div><br>It looks like we do not have an example of GradientRecursiveGaussianImageFilter. If you could add one here: </div><a href="http://www.itk.org/Wiki/ITK/Examples#Image_Edges.2C_Gradients.2C_and_Derivatives" target="_blank">http://www.itk.org/Wiki/ITK/Examples#Image_Edges.2C_Gradients.2C_and_Derivatives</a><div>



<br></div><div><a href="http://www.itk.org/Wiki/ITK/Examples#Image_Edges.2C_Gradients.2C_and_Derivatives" target="_blank"></a>once you get this working it would be a great help.<br><br></div><div>David </div></div></div>



</blockquote></div><br>
</div></div></blockquote></div><br>
</div></div><br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" 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" 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.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 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 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><br clear="all"><br>-- <br>Sergio Vera<br><br> Alma IT Systems<br> C/ Vilana, 4B, 4º 1ª<br> 08022 Barcelona<br> T. (+34) 932 380 592<br> <a href="http://www.alma3d.com">www.alma3d.com</a><br>
</div>