[Insight-users] newbie question - problems running examples/datarepresentation/image/rgbimage.cxx

Luis Ibanez luis.ibanez at kitware.com
Fri Jan 5 14:13:30 EST 2007


Hi Roger,

Please add a try/catch block around the reader->Update() call.

It is very likely that you are providing a filename that has
some problem and ITK is throwing an exception in order to indicate
the error condition.


You will find many examples on how to use try/catch blocks on
the ITK Software Guide


      http://www.itk.org/ItkSoftwareGuide.pdf


Most of the examples will print out the message of the exception.



Regards,


   Luis



-----------------
roger t wrote:
> I was finally successful in compiling and running the "hello world" 
> program. Now I am trying to run the RGB Image example program 
> rgbimage.cxx in the examples folder but the program crashes in the 
> function call-
> 
>  reader->Update();
> 
> in the first line in -
> 
> template <class TOutputImage, class ConvertPixelTraits>
> void ImageFileReader<TOutputImage, ConvertPixelTraits> 
> ::EnlargeOutputRequestedRegion(DataObject *output)
> {
> typename TOutputImage::Pointer out = 
> dynamic_cast<TOutputImage*>(output);//crash
> ...
> ...
> ..
> }
> 
> 
> How do I debug whats going wrong? Again, I am directly compiling (VS6) 
> and using the example code.
> 
> Thanks in advance,
> Roger
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list