[Insight-users] itk & wxWidgets

marquis2 at etu.unige.ch marquis2 at etu.unige.ch
Wed Jan 5 09:00:03 EST 2005


hello

> Hello,
> 
> Two months ago I started using wxWidgets in combination with ITK and VTK
> for  a project in the hospital I am working. 
did you try it on windows (bcc? vc++?) also or only on linux? 

> Your submitted code is not
> incorrect, at least not the ITK stuff. If you send your header file and
> complete implementation file I can look at it if you want. Or is it in the
> meantime already solved?
this is the code which crashes at run-time on windows
at "reader = ReaderType::New()" :

#include <itkImage.h>
#include <itkImageFileReader.h>
#include "wx/wxprec.h"

#ifndef WX_PRECOMP
    #include "wx/wx.h"
#endif

#ifdef __BORLANDC__
     #pragma hdrstop
#endif

class MainFrame : public wxFrame {
public:
  MainFrame();
};

class MyApp : public wxApp {
public:
  virtual bool OnInit();
};

MainFrame::MainFrame() : wxFrame(NULL, -1, "") {
}

IMPLEMENT_APP(MyApp)

bool MyApp::OnInit() {
  typedef itk::Image< unsigned char, 2 > ImageType;
  typedef itk::ImageFileReader< ImageType > ReaderType;
  ReaderType::Pointer reader;
  reader = ReaderType::New();// <===== crash here

  MainFrame *frame = new MainFrame();
  frame->Show(TRUE);
  return TRUE;
}

It works fine on linux with gcc 3.3.

Unless somebody has a clue,
I have various choices now:
- get another compiler and try again;
- look for another multiplatform GUI toolkit ( may be FLTK )

If anybody has any suggestion, I would appreciate any help!

TIA
Samuel









More information about the Insight-users mailing list