CC'ing to the ML :P<br><br><div class="gmail_quote">2011/9/14 Sergio Vera <span dir="ltr"><<a href="mailto:sergio.vera@alma3d.com">sergio.vera@alma3d.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Antonio...<div>at first sight the code seems ok to me, perhaps the only odd thing is that you store imagereader into salida (it seems that imagereader is a (smart)Pointer to a itkFilter and you are using it as an input to writer.</div>
<div><br></div><div>If imagereader is a pointer to a filter, then <span lang="EN-US"><i> writer->SetInput( salida ) ; </i>should be<i> </i></span><span lang="EN-US"><i> writer->SetInput( salida-<b>>GetOutput()</b> ) ; </i>instead</span></div>
<div><br></div><div><br><div class="gmail_quote"><div><div></div><div class="h5">2011/9/14 Antonio Gómez Barquero <span dir="ltr"><<a href="mailto:agb1@alu.upct.es" target="_blank">agb1@alu.upct.es</a>></span><br></div>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="h5">
<div lang="ES" link="blue" vlink="purple"><div><p class="MsoNormal"><span lang="EN-US">Hi all!<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">I have an image in an “itk::image<Pixeltype, 2>::Pointer salida”. I have checked that it has the correct pixelvalues. I want to save the image into a file, but in the last line, it gives me an exception and now I don’t know what to do:<u></u><u></u></span></p>
<p class="MsoNormal"><i><span lang="EN-US"> // Saving the result into a file<u></u><u></u></span></i></p><p class="MsoNormal"><i><span lang="EN-US"> salida = ui.imageframe->imagereader;<u></u><u></u></span></i></p>
<p class="MsoNormal"><i><span lang="EN-US"> writer = itk::ImageFileWriter<ImageType>::New(); <u></u><u></u></span></i></p><p class="MsoNormal"><i><span lang="EN-US"> writer->SetInput( salida ) ; <u></u><u></u></span></i></p>
<p class="MsoNormal"><i><span lang="EN-US"> writer->SetFileName ( "output.jpeg");<u></u><u></u></span></i></p><p class="MsoNormal"><i><span lang="EN-US"> writer->Update();// ---> EXCEPTION!!<u></u><u></u></span></i></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">The exception goes to xmtx.c file ( mutex[mutual exclusion] support for VC++), <u></u><u></u></span></p><p class="MsoNormal">
<span lang="EN-US">It goes to the last line of this part of the code:<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal" style="margin-left:35.4pt"><i><span lang="EN-US">_RELIABILITY_CONTRACT<u></u><u></u></span></i></p>
<p class="MsoNormal" style="margin-left:35.4pt"><i><span lang="EN-US">void __CLRCALL_PURE_OR_CDECL _Mtxlock(_Rmtx *_Mtx)<u></u><u></u></span></i></p><p class="MsoNormal" style="margin-left:35.4pt"><i><span lang="EN-US"> { /* lock mutex */<u></u><u></u></span></i></p>
<p class="MsoNormal" style="margin-left:35.4pt"><i><span lang="EN-US">#ifdef _M_CEE<u></u><u></u></span></i></p><p class="MsoNormal" style="margin-left:35.4pt"><i><span lang="EN-US"> System::Threading::Thread::BeginThreadAffinity();<u></u><u></u></span></i></p>
<p class="MsoNormal" style="margin-left:35.4pt"><i><span lang="EN-US">#endif<u></u><u></u></span></i></p><p class="MsoNormal" style="margin-left:35.4pt"><i><span lang="EN-US"> EnterCriticalSection(_Mtx);<u></u><u></u></span></i></p>
<p class="MsoNormal" style="margin-left:35.4pt"><i><span lang="EN-US"> }<u></u><u></u></span></i></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span lang="EN-US">Does any of you have had the same problem? Any hint for fixing it?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal">Thanks in advance<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Antonio Gómez Barquero<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><span lang="ES-TRAD" style="font-size:8.0pt">Ingeniero de Telecomunicaciones -Becario Investigador asociado a Actividades de I+D+I <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="ES-TRAD" style="font-size:8.0pt">GTTS ( Grupo de Tratamiento y Teoría de la Señal)[ </span><span style="font-size:8.0pt"><a href="http://gtts.upct.es/" target="_blank"><span style="color:blue">http://gtts.upct.es/</span></a></span><span lang="ES-TRAD" style="font-size:8.0pt">]<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="ES-TRAD" style="font-size:8.0pt">UPCT (Universidad Politécnica de Cartagena)[ </span><span style="font-size:8.0pt"><a href="http://www.upct.es/" target="_blank"><span style="color:blue">http://www.upct.es/</span></a>]</span><span lang="ES-TRAD" style="font-size:8.0pt"><u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p></div></div><br></div></div>_____________________________________<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><font color="#888888"><br><br clear="all"><div><br></div>-- <br>Sergio Vera<br><br> Alma IT Systems<br> C/ Vilana, 4B, 4º 1ª<br> 08022 Barcelona<br> T. <a href="tel:%28%2B34%29%20932%20380%20592" value="+34932380592" target="_blank">(+34) 932 380 592</a><br>
<a href="http://www.alma3d.com" target="_blank">www.alma3d.com</a><br>
</font></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <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>