Hallo itk users,<br><br>now take a look at some real strange bug. I programmed a ConnectedThresholdImageFilter, which works (surprisingly).<br>But if add add some lines of QT code into the method (which don't mess with the filter) - all I get is a black output!<br>
This kind of bug has happened to me a lot lately. Sometimes a filter doesn't seem to work, I tinker around with it for a day and after the SAME code works! <br>I even have a fast marching filter which only works, if I add some lines in which I create some itk::ImageFileWriter objects (BUT I DON'T USE THEM!).<br>
And once I get a code to work, it only works in the current method/class/project. If I copy and paste the code -> black ouput!<br>Do Someone know, what went wrong?<br><br>Thanx in advance, Michael<br><br><br><br>void MyMainWindow::connectedThresholdFilter()<br>
{<br> typedef itk::ConnectedThresholdImageFilter<ImageType, ImageType> ThresholderType;<br> ThresholderType::Pointer thresholder = ThresholderType::New();<br> thresholder->SetInput( m_Dicomreader->GetITKOutput() );<br>
<br> // if I uncomment following line, I get a black output !!!!<br> //QString s1 = this->qlineedit1->text();<br><br> thresholder->SetLower(0);<br> thresholder->SetUpper(800);<br> ImageType::IndexType index;<br>
index[0] = 250;<br> index[1] = 250;<br> thresholder->SetSeed(index);<br> thresholder->SetReplaceValue(255);<br><br> try<br> {<br> thresholder->Update();<br> }<br> catch( itk::ExceptionObject & excep )<br>
{<br> std::cerr << "Exception caught !" << std::endl;<br> std::cerr << excep << std::endl;<br> }<br><br> // Here I use a vtkImageViewer2 to show the output<br> Utility::popUpImage(thresholder->GetOutput());<br>
}<br>