[Insight-users] Exception when execute update of a writer

Sergio Vera sergio.vera at alma3d.com
Wed Sep 14 05:18:03 EDT 2011


CC'ing to the ML :P

2011/9/14 Sergio Vera <sergio.vera at alma3d.com>

> Hi Antonio...
> 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.
>
> If imagereader is a pointer to a filter, then * writer->SetInput( salida )
> ; *should be* ** writer->SetInput( salida->GetOutput() ) ; *instead
>
>
> 2011/9/14 Antonio Gómez Barquero <agb1 at alu.upct.es>
>
>> Hi all!****
>>
>> 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:****
>>
>> *                // Saving the result into a file*
>>
>> *                salida = ui.imageframe->imagereader;*
>>
>> *                writer = itk::ImageFileWriter<ImageType>::New(); *
>>
>> *                writer->SetInput( salida ) ; *
>>
>> *                writer->SetFileName ( "output.jpeg");*
>>
>> *                writer->Update();// ---> EXCEPTION!!*
>>
>> ** **
>>
>> The exception goes to  xmtx.c  file ( mutex[mutual exclusion] support for
>> VC++), ****
>>
>> It goes to the last line of this part of the code:****
>>
>> ** **
>>
>> *_RELIABILITY_CONTRACT*
>>
>> *void  __CLRCALL_PURE_OR_CDECL _Mtxlock(_Rmtx *_Mtx)*
>>
>> *                {              /* lock mutex */*
>>
>> *#ifdef _M_CEE*
>>
>> *                System::Threading::Thread::BeginThreadAffinity();*
>>
>> *#endif*
>>
>> *                EnterCriticalSection(_Mtx);*
>>
>> *                }*
>>
>> ** **
>>
>> Does any of you have had the same problem? Any hint for fixing it?****
>>
>> ** **
>>
>> Thanks in advance****
>>
>> ** **
>>
>> Antonio Gómez Barquero****
>>
>> ** **
>>
>> ** **
>>
>> Ingeniero de Telecomunicaciones -Becario Investigador asociado a
>> Actividades de I+D+I ****
>>
>> GTTS ( Grupo de Tratamiento y Teoría de la Señal)[ http://gtts.upct.es/]*
>> ***
>>
>> UPCT (Universidad Politécnica de Cartagena)[ http://www.upct.es/]****
>>
>> ** **
>>
>> _____________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Kitware offers ITK Training Courses, for more information visit:
>> http://www.kitware.com/products/protraining.html
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-users
>>
>>
>
>
> --
> Sergio Vera
>
>  Alma IT Systems
>  C/ Vilana, 4B, 4º 1ª
>  08022 Barcelona
>  T. (+34) 932 380 592
>  www.alma3d.com
>



-- 
Sergio Vera

 Alma IT Systems
 C/ Vilana, 4B, 4º 1ª
 08022 Barcelona
 T. (+34) 932 380 592
 www.alma3d.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110914/60705a1f/attachment.htm>


More information about the Insight-users mailing list