[Insight-users] Re: [vtkusers] Error: abnormal program termination

Luis Ibanez luis.ibanez at kitware.com
Thu Oct 21 10:41:51 EDT 2004


Hi Venu,

Please look at the example:


   InsightApplications/Auxiliary/vtk/
              itkReadITKImageShowVTK.cxx


it loads an image using ITK readers,
converts it to a vtkImageData and then
displays the image using a minimal VTK
visualization pipeline.

In the future, please put try/catch blocks
around code that may trigger exceptions.

You will find numerous examples on how to
catch exception in the ITK Software Guide


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




    Regards,


       Luis


------------------------
¿ Venu Thomas ¿ wrote:

> Dear,
>        all...
>  
>         iam making a new sample pgm.. if i want to build this sample 
> program in VS C++ .. then i got a error(as bellow).. how is avoid it? 
> pls send to me..
>  
> Error:
>   *Debug error !*
> *        *
> *        program :..../sample/myproject.cxx*
> ** 
> *    abnormal program termination*
> ** 
> *    (Press Retry to debug the application)*
>  
>  
> My program is ..
>  
> *myprogram.cxx:*
>  
> #include "itkImage.h"
> #include "itkImageFileReader.h"
> #include "itkImageToVTKImageFilter.h"
> #include "vtkImageViewer.h"
> #include "vtkRenderWindowInteractor.h"
> int main( int argc, char **argv ) {
> typedef itk::Image<unsigned short,2> ImageType;
> typedef itk::ImageFileReader<ImageType> ReaderType;
> typedef itk::ImageToVTKImageFilter< ImageType> ConnectorType;
> ReaderType::Pointer reader = ReaderType::New();
> ConnectorType::Pointer connector = ConnectorType::New();
> reader->SetFileName( argv[1] );
> connector->SetInput( reader->GetOutput() );
> vtkImageViewer * viewer = vtkImageViewer::New();
> vtkRenderWindowInteractor * renderWindowInteractor =
> vtkRenderWindowInteractor::New();
> viewer->SetupInteractor( renderWindowInteractor );
> viewer->SetInput( connector->GetOutput() );
> viewer->Render();
> viewer->SetColorWindow( 255 );
> viewer->SetColorLevel( 128 );
> renderWindowInteractor->Start();
> return 0;
> }
>  
> I wait for ur reply....
>  
>  
> Regards,
>           Venu Thomas
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers






More information about the Insight-users mailing list