Dear ITK Users,<br><br>I'm facing a problem. I was not able to figure out how to get the progression of multiple filters linked together via a pipe (meaning the input of the second filter is the output of the first : Filter2->SetInput(Filter1->GetOutput());<br>
<br>I'm currently setting the observer on the last filter but it only sends the progressEvent when the 2nd filter starts.<br><br>What am I doing wrong ?<br><br>This is an example of one my functions :<br><br>
<meta name="qrichtext" content="1"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style="margin: 0px; text-indent: 0px;">void CVolumeData::Median(int Radius) {</p>
<p style="margin: 0px; text-indent: 0px;">        typedef itk::MedianImageFilter < ITK3DImageType, ITK3DImageType> FilterType;</p>
<p style="margin: 0px; text-indent: 0px;">        FilterType::Pointer Filter = FilterType::New();</p><p style="margin: 0px; text-indent: 0px;"><br></p>
<p style="margin: 0px; text-indent: 0px;">        ITK3DImageType::SizeType indexRadius;</p>
<p style="margin: 0px; text-indent: 0px;">        indexRadius[0] = Radius;</p>
<p style="margin: 0px; text-indent: 0px;">        indexRadius[1] = Radius;</p>
<p style="margin: 0px; text-indent: 0px;">        indexRadius[2] = Radius;</p>
<p style="margin: 0px; text-indent: 0px;">        Filter->SetRadius(indexRadius);</p><p style="margin: 0px; text-indent: 0px;"><br></p>
<p style="margin: 0px; text-indent: 0px;">        Filter->SetInput(GetITK3DImage());</p><p style="margin: 0px; text-indent: 0px;"><br></p>
<p style="margin: 0px; text-indent: 0px;">        typedef itk::RescaleIntensityImageFilter<ITK3DImageType, ITK3DImageType> RescaleFilterType;</p>
<p style="margin: 0px; text-indent: 0px;">        RescaleFilterType::Pointer RescaleFilter = RescaleFilterType::New();</p><p style="margin: 0px; text-indent: 0px;"><br></p>
<p style="margin: 0px; text-indent: 0px;">        RescaleFilter->SetInput(Filter->GetOutput());</p>
<p style="margin: 0px; text-indent: 0px;">        RescaleFilter->SetOutputMaximum(4095);</p>
<p style="margin: 0px; text-indent: 0px;">        RescaleFilter->SetOutputMinimum(0);</p><p style="margin: 0px; text-indent: 0px;"><br></p>
<p style="margin: 0px; text-indent: 0px;">        typedef itk::CStyleCommand CommandType;</p>
<p style="margin: 0px; text-indent: 0px;">        typedef CommandType::Pointer CommandPointer;</p>
<p style="margin: 0px; text-indent: 0px;">        CommandPointer ProgressDialogCallback = CommandType::New();</p><p style="margin: 0px; text-indent: 0px;"><br></p>
<p style="margin: 0px; text-indent: 0px;">        ProgressDialogCallback->SetCallback((CommandType::FunctionPointer)&ITKProgressCallback);</p>
<p style="margin: 0px; text-indent: 0px;">        ProgressDialogCallback->SetClientData(this);</p><p style="margin: 0px; text-indent: 0px;"><br></p>
<p style="margin: 0px; text-indent: 0px;">        unsigned long int ObserverID = RescaleFilter->AddObserver(itk::ProgressEvent(), ProgressDialogCallback);</p><p style="margin: 0px; text-indent: 0px;"><br></p>
<p style="margin: 0px; text-indent: 0px;">        qDebug() << "LOL 1";</p><p style="margin: 0px; text-indent: 0px;"><br></p>
<p style="margin: 0px; text-indent: 0px;">        RescaleFilter->Update();</p>
<p style="margin: 0px; text-indent: 0px;">        SetITK3DImage(RescaleFilter->GetOutput());</p><p style="margin: 0px; text-indent: 0px;"><br></p>
<p style="margin: 0px; text-indent: 0px;">        qDebug() << "LOL 2";</p><p style="margin: 0px; text-indent: 0px;"><br></p>
<p style="margin: 0px; text-indent: 0px;">        if(m_MainView != NULL)</p>
<p style="margin: 0px; text-indent: 0px;">                for(unsigned int i = 0, size = m_MainView->GetImageSubView().size(); i < size; i++) {</p>
<p style="margin: 0px; text-indent: 0px;">                        m_MainView->GetImageSubView().at(i)->PrepareCache();</p>
<p style="margin: 0px; text-indent: 0px;">                }</p><p style="margin: 0px; text-indent: 0px;"><br></p>
<p style="margin: 0px; text-indent: 0px;">        RescaleFilter->RemoveObserver(ObserverID);</p><p style="margin: 0px; text-indent: 0px;"><br></p>
<p style="margin: 0px; text-indent: 0px;">        GetProgressDialog()->close();</p><p style="margin: 0px; text-indent: 0px;"><br></p>
<p style="margin: 0px; text-indent: 0px;">        qDebug() << "LOL 3";</p>
<p style="margin: 0px; text-indent: 0px;">}</p><br><br>Thank you very much for your help !<br><br>Best regards,<br><br><br>Maximilien Renard<br><br>P.S. I apologize if it was explained in the Software Guide in which case I did not find it <br>