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

Antonio Gómez Barquero agb1 at alu.upct.es
Wed Sep 14 06:30:04 EDT 2011


 

First of all, Thanks for replying! J

 

In this case, both, salida and ui.imageframe->imagereader are
'itk::Image<TPixel,VImageDimension>'. Then, as they are no filters, there no
method ‘GetOutput()’ to apply in this case. 

 

Now, I think that I should translate the image into a filter, I am thinking
about using the itk::ImportImageFilter, is this the best option?

 

Thanks !!

 

Antonio

 

 

De: Sergio Vera [mailto:sergio.vera at alma3d.com] 
Enviado el: miércoles, 14 de septiembre de 2011 11:17
Para: Antonio Gómez Barquero
Asunto: Re: [Insight-users] Exception when execute update of a writer

 

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110914/349154f9/attachment-0001.htm>


More information about the Insight-users mailing list