I think the problem is simply a missing rendering update.You can try to add the 
following call at the end of your Activated() function:

mitk::RenderingManager::GetInstance()->RequestUpdateAll();

Regards


On 15.10.2012, at 16:56, Félix C. Morency wrote:

> Andreas,
> 
> Thanks for the reply. Yes, the threshold itself works perfectly. The
> only problem is the display update when the tool is activated (given
> focus). The steps are:
> 
> 1) Select my threshold module
> 2) Change the threshold: display is okay, I see the threshold overlay
> 3) Click anywhere in the stdmultiwidgeteditor: tool deactivated and
> threshold overlay is hidden
> 4) Click on the threshold slider again, without changing the slider
> value: tool activated, focus given but threshold overlay is still
> hidden
> 5) Change the threshold slider value: threshold overlay display is okay
> 
> I rewrote my own GUI for this tool to make it usable in a non-blocking
> way (no dialog). Its not complete yet but gives me more control.
> 
> Regards,
> -F
> 
> On Mon, Oct 15, 2012 at 10:45 AM, Fetzer, Andreas
> <[email protected]> wrote:
>> Hi Felix,
>> 
>> have you set the mitkBinaryThresholdTool as the tool for the 
>> QmitkBinaryThresholdToolGUI like it is done in the QmitkThresholdAction?
>> 
>> Best Regards
>> Andreas
>> 
>> On 10.10.2012, at 22:17, Félix C. Morency wrote:
>> 
>> Hi,
>> 
>> I made my own binary threshold segmentation plugin reusing tools and
>> GUI from QmitkBinaryThresholdTool and QmitkBinaryThresholdToolGUI. My
>> own view is non-blocking compared to the MITK original binary
>> threshold dialog. The problem is that the overlay display doesn't
>> update itself when the tool is activated.
>> 
>> void MyThreshold::Activated()
>> {
>>   m_ToolManager->RegisterClient();
>>   m_ToolManager->SetReferenceData(m_SelectedNode);
>>   m_ToolManager->ActivateTool(
>>     m_ToolManager->GetToolIdByToolType<mitk::BinaryThresholdTool>());
>> 
>>   m_ToolManager->ActiveToolChanged += mitk::MessageDelegate<MyThreshold>(
>>     this, &MyThreshold::OnThresholdingToolManagerToolModified);
>> }
>> 
>> void MyThreshold::Deactivated()
>> {
>>   m_ToolManager->ActiveToolChanged -= mitk::MessageDelegate<MyThreshold>(
>>     this, &MyThreshold::OnThresholdingToolManagerToolModified);
>>   m_ToolManager->SetReferenceData(0);
>>   m_ToolManager->ActivateTool(-1);
>>   m_ToolManager->UnregisterClient();
>> }
>> 
>> I need to move the threshold slider to see the threshold preview. I
>> see no way of triggering an update programmatically. The only public
>> method accessible from QmitkBinaryThresholdToolGUI is
>> 
>> void OnThresholdingValueChanged(double current);
>> 
>> but I can't access the current slider value.
>> 
>> Is there a way of achieving this without modifying MITK?
>> 
>> Thanks,
>> --
>> Félix C. Morency, M.Sc.
>> Plateforme d’analyse et de visualisation d’images
>> Centre Hospitalier Universitaire de Sherbrooke
>> Centre de recherche clinique Étienne-Le Bel
>> Local Z5-3031 | 819.346.1110 ext 16634
>> 
>> ------------------------------------------------------------------------------
>> Don't let slow site performance ruin your business. Deploy New Relic APM
>> Deploy New Relic app performance management and know exactly
>> what is happening inside your Ruby, Python, PHP, Java, and .NET app
>> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>> http://p.sf.net/sfu/newrelic-dev2dev
>> _______________________________________________
>> mitk-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/mitk-users
>> 
> 
> 
> 
> -- 
> --
> Félix C. Morency, M.Sc.
> Plateforme d’analyse et de visualisation d’images
> Centre Hospitalier Universitaire de Sherbrooke
> Centre de recherche clinique Étienne-Le Bel
> Local Z5-3031 | 819.346.1110 ext 16634


------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to