Page MenuHomePhabricator

[Segmentation] 3D Otsu does not show preview for a second time
Closed, ResolvedPublic

Description

Reproduce:

  1. Create segmentation
  2. Perform Otsu (Preview plus selection)
  3. Try again with other number

-> Nothing happens, no new preview

Revisions and Commits

rMITK MITK

Event Timeline

thomass created this task.

IMO not severe for the upcoming release since Otsu is not often used and it is not a show stopper...

I remember that I had a discussion about this with @floca, he recently did a lot of changes to the seg tools: https://phabricator.mitk.org/D450?vs=on&id=2056#change-lAwYLYHZrN5g
Here he added a condition to only calculate a preview if some settings have changed. Maybe there was a property missing? (check esp. lines 77, 78, 79 in void QmitkOtsuTool3DGUI::OnPreviewBtnClicked()).

Edit
I raised two concerns for the corresponding code changes (commits) - that's just my first assumption.

yes the logic is flaut. I was not carefull enough when I a changed line 77ff in QmitkOtsuTool3DGUI.cpp

it is

if (!m_FirstPreviewComputation ||
    (tool->GetNumberOfRegions() == static_cast<unsigned int>(m_Controls.m_Spinbox->value()) &&
     tool->GetUseValley() == m_Controls.m_ValleyCheckbox->isChecked() &&
     tool->GetNumberOfBins() == static_cast<unsigned int>(m_Controls.m_BinsSpinBox->value())))
    return;

it should be

if (!m_FirstPreviewComputation &&
    (tool->GetNumberOfRegions() == static_cast<unsigned int>(m_Controls.m_Spinbox->value()) &&
     tool->GetUseValley() == m_Controls.m_ValleyCheckbox->isChecked() &&
     tool->GetNumberOfBins() == static_cast<unsigned int>(m_Controls.m_BinsSpinBox->value())))
    return;