[Insight-users] Qt itk filter

Matthias Ebert mebert at uni-koblenz.de
Sat Dec 9 08:35:28 EST 2006


Hi everyone,

i am new to this mailing list, so first of all: hello :)

i try to get a simple qt-itk example to work, but i got some problems
launching my filter using a qt button.
i dont know if its the right way i try to do this:

1.) i create a median filter (according to the example in
ItkSoftwareGuide):

  typedef itk::MedianImageFilter <InputImageType, OutputImageType>
FilterType;
  FilterType::Pointer filter = FilterType::New();

2.) i create a simple qt-button:

  QPushButton medianFilterButton("Median Filter", &mainWidget);
  medianFilterButton.setGeometry(horizontalPosition, 20, buttonWidth,
buttonHeight);

3.) i use the qt-itk-adaptor (guess this is wrong):

  typedef itk::QtSlotAdaptor<FilterType> SlotAdaptorType;
  SlotAdaptorType slotAdaptor;
  slotAdaptor.SetCallbackFunction(filter, & FilterType::Update);
  QObject::connect(&medianFilterButton, SIGNAL(clicked()), &slotAdaptor,
SLOT(Slot()));

so here are my questions:

how do i launch my median filter using a qt-button? i need to set the
input for the filter and the writer doing something like this:

  filter->SetInput(reader->GetOutput());
  writer->SetInput(filter->GetOutput());

but thats not the way i want to do it. i just want this to happen after
pushing the button.
can anyone explain me how i figure out which filter has which slots? i
am a bit confused about this ...

if u need more code to understand what i mean, please let me know!

thanks for help,

Matthias


More information about the Insight-users mailing list