Public Slots | Public Member Functions | Protected Member Functions | Protected Attributes

QmitkThresholdComponent Class Reference

ComponentClass to find an adequate threshold for a selected imageThis class inherits from

More...

#include <QmitkThresholdComponent.h>

Inheritance diagram for QmitkThresholdComponent:
Inheritance graph
[legend]
Collaboration diagram for QmitkThresholdComponent:
Collaboration graph
[legend]

List of all members.

Public Slots

virtual void DataStorageChanged (mitk::DataStorage::Pointer ds)
void ImageSelected (const mitk::DataNode *item)
 Slot method that will be called if TreeNodeSelector widget was activated to select the current image.
void ShowThreshold (bool show=true)
 Slot method that will be called if the CheckBox at the Threshold-Group-Box was toggled to show the threshold image or not.
void ShowThresholdFinderContent (bool show=true)
 Slot method that will be called if the CheckBox at the Threshold-Group-Box was toggled to show the threshold image or not.
void ShowImageContent (bool show=true)
 Slot method that will be called if the CheckBox at the TreeNodeSelector-Group-Box was toggled to show the TreeNodeSelector or not.
void ThresholdSliderChanged (int moved=0)
 Slot method that will be called if the Thresholdslider was moved to update the shown image and the ThresholdLineEdit.
void ThresholdValueChanged ()
 Slot method that will be called if the ThresholdLineEdit was changed to update the shown image and the ThresholdSlider.
void CreateThresholdSegmentation ()
 Slot method that will be called if the "Create Segmentation"-Button was pressed to create a new segmentation image. Everything over the threshold will have the value 1, all other 0.

Public Member Functions

 QmitkThresholdComponent (QObject *parent=0, const char *parentName=0, bool updateSelector=true, bool showSelector=true, QmitkStdMultiWidget *mitkStdMultiWidget=NULL)
 Constructor.
virtual ~QmitkThresholdComponent ()
 Destructor.
void CreateQtPartControl (QWidget *parent, mitk::DataStorage::Pointer dataStorage)
 Method to create the GUI for the component from the .ui-File. This Method is obligatory.
virtual void CreateConnections ()
 Method to create the connections for the component. This Method is obligatory even if no connections is needed.
virtual void SetSelectorVisibility (bool visibility)
 Method to set the Image Selector visible or invisible.
virtual QmitkDataStorageComboBoxGetTreeNodeSelector ()
 Method to return the TreeNodeSelector-QmitkDataStorageComboBox.
virtual void SetDataStorage (mitk::DataStorage::Pointer dataStorage)
 Method to set the DataStorage.
virtual mitk::DataStorage::Pointer GetDataStorage ()
 Method to get the DataStorage.
virtual QGroupBox * GetContentContainer ()
 Method to return the ComboBox that includes all GUI-elements instead of the outermost checkable CheckBox and that can be set visible or not.
virtual QGroupBox * GetMainCheckBoxContainer ()
 Method to return the outermost checkable ComboBox that is to decide whether the content shall be shown or not.
virtual QGroupBox * GetImageContent ()
 Method to return the group-box that contains the tree-node-selector.
virtual void Activated ()
 Method to set m_Activated to true.
virtual void Deactivated ()
 Method to set m_Activated to false.

Protected Member Functions

mitk::DataNode::Pointer CreateSegmentationNode (mitk::Image *image)
void DataObjectSelected ()
 Method that controls everything what happend after an image was selected.

Protected Attributes

mitk::DataStorage::Pointer m_DataStorage
 Item on the actual selected Image in the TreeNodeSelector.
mitk::DataNode::Pointer m_ThresholdImageNode

Detailed Description

ComponentClass to find an adequate threshold for a selected image

This class inherits from

Overview

The ThresholdComponent is a class to easy find an adequate threshold. On two ways the user can insert a possible threshold: as a number in a textfield or by moving a scrollbar. The selected threshold will be shown on the image as an new binary layer that contains those areas above the theshold. Like all other componentes the QmitkThresholdComponent inherits from QmitkFunctionalityComponentContainer.

Definition at line 47 of file QmitkThresholdComponent.h.


Constructor & Destructor Documentation

QmitkThresholdComponent::QmitkThresholdComponent ( QObject *  parent = 0,
const char *  parentName = 0,
bool  updateSelector = true,
bool  showSelector = true,
QmitkStdMultiWidget mitkStdMultiWidget = NULL 
)

Constructor.

Definition at line 45 of file QmitkThresholdComponent.cpp.

References QmitkBaseComponent::SetAvailability(), and QmitkFunctionalityComponentContainer::SetComponentName().

: QmitkFunctionalityComponentContainer(parent, parentName, updateSelector, showSelector),
m_ThresholdImageNode(NULL),
m_ThresholdComponentGUI(NULL),
m_ThresholdNodeExisting(false)
{
  SetAvailability(true);

  SetComponentName("ThresholdFinder");
}
QmitkThresholdComponent::~QmitkThresholdComponent (  ) [virtual]

Destructor.

Definition at line 57 of file QmitkThresholdComponent.cpp.

{

}

Member Function Documentation

void QmitkThresholdComponent::Activated (  ) [virtual]

Method to set m_Activated to true.

*********** SET CONTENT CONTAINER VISIBLE ************/

Reimplemented from QmitkFunctionalityComponentContainer.

Definition at line 315 of file QmitkThresholdComponent.cpp.

References QmitkFunctionalityComponentContainer::m_Active, QmitkBaseComponent::m_AddedChildList, and ShowThreshold().

{
  QmitkBaseFunctionalityComponent::Activated();
  m_Active = true;
  for(unsigned int i = 0;  i < m_AddedChildList.size(); i++)
  {
    m_AddedChildList[i]->Activated();
  } 
  CreateThresholdImageNode();
  ShowThreshold();
  SetSliderRange();
}
void QmitkThresholdComponent::CreateConnections (  ) [virtual]

Method to create the connections for the component. This Method is obligatory even if no connections is needed.

Reimplemented from QmitkFunctionalityComponentContainer.

Definition at line 87 of file QmitkThresholdComponent.cpp.

References CreateThresholdSegmentation(), ImageSelected(), QmitkFunctionalityComponentContainer::SetContentContainerVisibility(), ShowImageContent(), ShowThresholdFinderContent(), ThresholdSliderChanged(), and ThresholdValueChanged().

Referenced by CreateQtPartControl().

{
  if ( m_ThresholdComponentGUI )
  {
    connect( (QObject*)(m_TreeNodeSelector), SIGNAL(OnSelectionChanged (const mitk::DataNode *)), (QObject*) this, SLOT(ImageSelected(const mitk::DataNode *)));
    connect( (QObject*)(m_ThresholdFinder), SIGNAL(toggled(bool)), (QObject*) this, SLOT(ShowThresholdFinderContent(bool)));     
    connect( (QObject*)(m_ThresholdSelectDataGroupBox), SIGNAL(toggled(bool)), (QObject*) this, SLOT(ShowImageContent(bool))); 

    connect( (QObject*)(m_ThresholdInputSlider), SIGNAL(sliderMoved(int)), (QObject*) this, SLOT(ThresholdSliderChanged(int)));
    connect( (QObject*)(m_ThresholdInputNumber), SIGNAL(returnPressed()), (QObject*) this, SLOT(ThresholdValueChanged()));    
    //connect( (QObject*)( m_ShowThresholdGroupBox), SIGNAL(toggled(bool)), (QObject*) this, SLOT(ShowThreshold(bool)));  

    //to connect the toplevel checkable GroupBox with the method SetContentContainerVisibility to inform all containing komponent to shrink or to expand
    connect( (QObject*)(m_ThresholdFinder),  SIGNAL(toggled(bool)), (QObject*) this, SLOT(SetContentContainerVisibility(bool))); 
    connect( (QObject*)(m_CreateSegmentationButton),  SIGNAL(released()), (QObject*) this, SLOT(CreateThresholdSegmentation())); 
  }
}
void QmitkThresholdComponent::CreateQtPartControl ( QWidget *  parent,
mitk::DataStorage::Pointer  dataStorage 
) [virtual]

Method to create the GUI for the component from the .ui-File. This Method is obligatory.

Reimplemented from QmitkFunctionalityComponentContainer.

Definition at line 180 of file QmitkThresholdComponent.cpp.

References CreateConnections(), QmitkFunctionalityComponentContainer::m_GUI, QmitkFunctionalityComponentContainer::m_ShowSelector, mitk::NodePredicateDataType::New(), QmitkDataStorageComboBox::SetDataStorage(), SetDataStorage(), QmitkDataStorageComboBox::SetPredicate(), and Ui_QmitkThresholdComponentControls::setupUi().

{
  m_GUI = new QWidget;
  m_ThresholdComponentGUI = new Ui::QmitkThresholdComponentControls;
  m_ThresholdComponentGUI->setupUi(m_GUI);



  /*CREATE GUI ELEMENTS*/

  m_ThresholdFinder = new QGroupBox("2. Find Threshold", m_GUI);
  m_ThresholdSelectDataGroupBox = new QGroupBox("Show Image Selector", m_ThresholdFinder);
  m_TreeNodeSelector = new QmitkDataStorageComboBox(m_ThresholdSelectDataGroupBox);
  m_ImageContent = new QGroupBox("m_ImageContent", m_ThresholdSelectDataGroupBox);
  m_ContainerContent = new QGroupBox(m_ImageContent);
  m_ShowThresholdGroupBox = new QGroupBox("m_ShowThresholdGroupBox", m_ContainerContent);
  m_ThresholdInputNumber = new QLineEdit(m_ShowThresholdGroupBox);
  m_ThresholdInputSlider = new QSlider(m_ShowThresholdGroupBox);
  m_ThresholdInputSlider->setOrientation(Qt::Horizontal);
  m_ThresholdValueContent = new QGroupBox("m_ThresholdValueContent", m_ShowThresholdGroupBox);
  m_CreateSegmentationButton = new QPushButton("Create Segmentation", m_ThresholdValueContent);
  m_DeleateImageIfDeactivatedCheckBox = new QCheckBox("Deleate Threshold Image if \nComponent is deactivated", m_ThresholdValueContent);

  m_ThresholdFinder->setCheckable(true);
  m_ThresholdFinder->setChecked(true);
  
  m_ThresholdSelectDataGroupBox->setCheckable(true);
  m_ThresholdSelectDataGroupBox->setChecked(true);
  
  m_ThresholdInputNumber->setFixedSize(40, 20);
  QIntValidator* intValid = new QIntValidator(-32000, 5000, m_ThresholdInputNumber);
  m_ThresholdInputNumber->setValidator(intValid);
  m_ThresholdInputNumber->setText("0");

  m_ThresholdValueContent->setMaximumHeight(90);

  // m_ThresholdSelectDataGroupBox->setContentsMargins(0,9,9,9);
  // m_ImageContent->setContentsMargins(0,9,9,9);
  // m_ContainerContent->setContentsMargins(0,9,9,9);
  // m_ShowThresholdGroupBox->setContentsMargins(0,9,9,9);
  //m_ThresholdValueContent->setContentsMargins(0,9,9,9);

  //m_ThresholdFinder->setFlat(true);
  //m_ThresholdSelectDataGroupBox->setFlat(true);
  //m_ImageContent->setFlat(true);
  //m_ContainerContent->setFlat(true);
  //m_ShowThresholdGroupBox->setFlat(true);
  //m_ThresholdValueContent->setFlat(true);



  QVBoxLayout* guiLayout = new QVBoxLayout(m_GUI);
  m_GUI->setLayout(guiLayout);
  guiLayout->addWidget(m_ThresholdFinder);

  QVBoxLayout* thresholdFinderLayout = new QVBoxLayout(m_ThresholdFinder);
  thresholdFinderLayout->setContentsMargins(0,9,0,9);
  m_ThresholdFinder->setLayout(thresholdFinderLayout);
  thresholdFinderLayout->addWidget(m_ThresholdSelectDataGroupBox);
  thresholdFinderLayout->addWidget(m_ImageContent);

  QVBoxLayout* thresholdSelectDataGroupBoxLayout = new QVBoxLayout(m_ThresholdSelectDataGroupBox);
  thresholdSelectDataGroupBoxLayout->setContentsMargins(0,9,0,9);
  m_ThresholdSelectDataGroupBox->setLayout(thresholdSelectDataGroupBoxLayout);
  thresholdSelectDataGroupBoxLayout->addWidget(m_TreeNodeSelector);


  QVBoxLayout* imageContentLayout = new QVBoxLayout(m_ImageContent);
  imageContentLayout->setContentsMargins(0,9,0,9);
  m_ImageContent->setLayout(imageContentLayout);
  imageContentLayout->addWidget(m_ContainerContent);

  QVBoxLayout* containerContentLayout = new QVBoxLayout(m_ContainerContent);
  containerContentLayout->setContentsMargins(0,9,0,9);
  m_ContainerContent->setLayout(containerContentLayout);
  containerContentLayout->addWidget(m_ShowThresholdGroupBox);

  QVBoxLayout* showThresholdGroupBoxLayout = new QVBoxLayout(m_ShowThresholdGroupBox);
  showThresholdGroupBoxLayout->setContentsMargins(0,9,0,9);
  m_ShowThresholdGroupBox->setLayout(showThresholdGroupBoxLayout);
  QHBoxLayout* thresholdInputLayout = new QHBoxLayout(m_ShowThresholdGroupBox);
  thresholdInputLayout->addWidget(m_ThresholdInputNumber);
  thresholdInputLayout->addWidget(m_ThresholdInputSlider);
  showThresholdGroupBoxLayout->addLayout(thresholdInputLayout);
  showThresholdGroupBoxLayout->addWidget(m_ThresholdValueContent);

  QVBoxLayout* thresholdValueContentLayout = new QVBoxLayout(m_ThresholdValueContent);
  thresholdValueContentLayout->setContentsMargins(0,9,0,9);
  m_ThresholdValueContent->setLayout(thresholdValueContentLayout);
  thresholdValueContentLayout->addWidget(m_DeleateImageIfDeactivatedCheckBox);
  thresholdValueContentLayout->addWidget(m_CreateSegmentationButton);

  this->CreateConnections();
  SetDataStorage(dataStorage);

  m_TreeNodeSelector->SetDataStorage(dataStorage);
  m_TreeNodeSelector->SetPredicate(mitk::NodePredicateDataType::New("Image"));

  if(m_ShowSelector)
  {
    m_ImageContent->setShown( m_ThresholdSelectDataGroupBox->isChecked());
    //m_ImageContent->setShown(true);
  }
  else
  {
    m_ThresholdSelectDataGroupBox->setShown(m_ShowSelector);
    //m_ThresholdSelectDataGroupBox->setShown(true);
  }
}
mitk::DataNode::Pointer QmitkThresholdComponent::CreateSegmentationNode ( mitk::Image image ) [protected]

Method to create the node for the thresholdbased segmentation

Definition at line 575 of file QmitkThresholdComponent.cpp.

References mitk::FloatProperty::New(), mitk::LevelWindowProperty::New(), mitk::IntProperty::New(), mitk::ColorProperty::New(), mitk::BoolProperty::New(), mitk::StringProperty::New(), and mitk::DataNode::New().

Referenced by CreateThresholdSegmentation().

{

  if (!image) return NULL;

  // decorate the datatreenode with some properties
  mitk::DataNode::Pointer segmentationNode = mitk::DataNode::New();
  segmentationNode->SetData( image );

  // name
  segmentationNode->SetProperty( "name", mitk::StringProperty::New( "TH segmentation from ThresholdFinder" ) );

  // visualization properties
  segmentationNode->SetProperty( "binary", mitk::BoolProperty::New(true) );
  segmentationNode->SetProperty( "color", mitk::ColorProperty::New(0.0, 1.0, 0.0) );
  segmentationNode->SetProperty( "texture interpolation", mitk::BoolProperty::New(false) );
  segmentationNode->SetProperty( "layer", mitk::IntProperty::New(10) );
  segmentationNode->SetProperty( "levelwindow", mitk::LevelWindowProperty::New( mitk::LevelWindow(0.5, 1) ) );
  segmentationNode->SetProperty( "opacity", mitk::FloatProperty::New(0.3) );
  segmentationNode->SetProperty( "segmentation", mitk::BoolProperty::New(true) );
  segmentationNode->SetProperty( "showVolume", mitk::BoolProperty::New( false ) );

  return segmentationNode;
}
void QmitkThresholdComponent::CreateThresholdSegmentation (  ) [slot]

Slot method that will be called if the "Create Segmentation"-Button was pressed to create a new segmentation image. Everything over the threshold will have the value 1, all other 0.

Definition at line 514 of file QmitkThresholdComponent.cpp.

References AccessFixedDimensionByItk_2, CreateSegmentationNode(), berry::SmartPointer< TObjectType >::GetPointer(), QmitkDataStorageComboBox::GetSelectedNode(), m_DataStorage, MITK_INFO, mitk::ImageTimeSelector::New(), and mitk::Image::New().

Referenced by CreateConnections().

{
  mitk::Image::Pointer original = dynamic_cast<mitk::Image*>(m_TreeNodeSelector->GetSelectedNode()->GetData());
  // we NEED a reference image for size etc.
  if (!original) return;

  // actually create a new empty segmentation
  mitk::PixelType pixelType( typeid(DefaultSegmentationDataType) );
  mitk::Image::Pointer segmentation = mitk::Image::New();
  //segmentation->SetProperty( "organ type", OrganTypeProperty::New( organType ) );

  segmentation->Initialize( pixelType, original->GetDimension(), original->GetDimensions() );

  unsigned int byteSize = sizeof(DefaultSegmentationDataType);
  for (unsigned int dim = 0; dim < segmentation->GetDimension(); ++dim) 
  {
    byteSize *= segmentation->GetDimension(dim);
  }
  memset( segmentation->GetData(), 0, byteSize );

  if (original->GetTimeSlicedGeometry() )
  {
    mitk::AffineGeometryFrame3D::Pointer originalGeometryAGF = original->GetTimeSlicedGeometry()->Clone();
    mitk::TimeSlicedGeometry::Pointer originalGeometry = dynamic_cast<mitk::TimeSlicedGeometry*>( originalGeometryAGF.GetPointer() );
    segmentation->SetGeometry( originalGeometry );
  }
  else
  {
    MITK_INFO<<"Original image does not have a 'Time sliced geometry'! Cannot create a segmentation.";
    return ;
  }

  mitk::DataNode::Pointer emptySegmentationNode = CreateSegmentationNode( segmentation);

  if (emptySegmentationNode)
  {
    // actually perform a thresholding and ask for an organ type
    for (unsigned int timeStep = 0; timeStep < original->GetTimeSteps(); ++timeStep)
    {
      try
      {
        mitk::ImageTimeSelector::Pointer timeSelector = mitk::ImageTimeSelector::New();
        timeSelector->SetInput( original );
        timeSelector->SetTimeNr( timeStep );
        timeSelector->UpdateLargestPossibleRegion();
        mitk::Image::Pointer image3D = timeSelector->GetOutput();

        AccessFixedDimensionByItk_2( image3D, ITKThresholding, 3, dynamic_cast<mitk::Image*>(emptySegmentationNode->GetData()), timeStep );
      }
      catch(...)
      {
        MITK_INFO<<"Error accessing single time steps of the original image. Cannot create segmentation.";
      }
    }

    mitk::DataNode::Pointer originalNode = m_TreeNodeSelector->GetSelectedNode();
    m_DataStorage->Add( emptySegmentationNode, originalNode ); // add as a child, because the segmentation "derives" from the original
   
  }
}
void QmitkThresholdComponent::DataObjectSelected (  ) [protected]

Method that controls everything what happend after an image was selected.

Definition at line 150 of file QmitkThresholdComponent.cpp.

References QmitkDataStorageComboBox::GetSelectedNode(), QmitkFunctionalityComponentContainer::m_Active, m_ThresholdImageNode, and ShowThreshold().

Referenced by DataStorageChanged(), and ImageSelected().

{
  if(m_Active)
  {
    if(m_ThresholdNodeExisting)
    {
      m_ThresholdImageNode->SetData(m_TreeNodeSelector->GetSelectedNode()->GetData());
    }
    else
    {
      CreateThresholdImageNode();
      m_ThresholdImageNode->SetData(m_TreeNodeSelector->GetSelectedNode()->GetData());
    }
    ShowThreshold();
  }
}
void QmitkThresholdComponent::DataStorageChanged ( mitk::DataStorage::Pointer  ds ) [virtual, slot]

Reimplemented from QmitkFunctionalityComponentContainer.

Definition at line 106 of file QmitkThresholdComponent.cpp.

References DataObjectSelected(), QmitkBaseFunctionalityComponent::DataStorageChanged(), QmitkBaseComponent::m_AddedChildList, m_DataStorage, QmitkDataStorageComboBox::SetDataStorage(), and ShowThreshold().

{
  if(!ds)
    return;
  m_DataStorage = ds;
  m_TreeNodeSelector->SetDataStorage(ds);

  if(m_ThresholdComponentGUI != NULL)
  {
    for(unsigned int i = 0;  i < m_AddedChildList.size(); i++) 
    {
      QmitkBaseFunctionalityComponent* functionalityComponent = dynamic_cast<QmitkBaseFunctionalityComponent*>(m_AddedChildList[i]);
      if (functionalityComponent != NULL)
        functionalityComponent->DataStorageChanged(ds);
    }
  }
  if(!ds)
    return;

  DataObjectSelected();
  SetSliderRange();
  ShowThreshold();
}
void QmitkThresholdComponent::Deactivated (  ) [virtual]

Method to set m_Activated to false.

Reimplemented from QmitkFunctionalityComponentContainer.

Definition at line 329 of file QmitkThresholdComponent.cpp.

References QmitkFunctionalityComponentContainer::m_Active, QmitkBaseComponent::m_AddedChildList, and ShowThreshold().

{
  QmitkBaseFunctionalityComponent::Deactivated();
  m_Active = false;
  for(unsigned int i = 0;  i < m_AddedChildList.size(); i++)
  {
    m_AddedChildList[i]->Deactivated();
  } 
  ShowThreshold();
  if( m_DeleateImageIfDeactivatedCheckBox->isChecked())
  {
    DeleteThresholdNode();
  }
}
QGroupBox * QmitkThresholdComponent::GetContentContainer (  ) [virtual]

Method to return the ComboBox that includes all GUI-elements instead of the outermost checkable CheckBox and that can be set visible or not.

Reimplemented from QmitkFunctionalityComponentContainer.

Definition at line 291 of file QmitkThresholdComponent.cpp.

{
  return  m_ContainerContent;
}
mitk::DataStorage::Pointer QmitkThresholdComponent::GetDataStorage (  ) [virtual]

Method to get the DataStorage.

Reimplemented from QmitkFunctionalityComponentContainer.

Definition at line 174 of file QmitkThresholdComponent.cpp.

References m_DataStorage.

{
  return m_DataStorage;
}
QGroupBox * QmitkThresholdComponent::GetImageContent (  ) [virtual]

Method to return the group-box that contains the tree-node-selector.

Reimplemented from QmitkFunctionalityComponentContainer.

Definition at line 74 of file QmitkThresholdComponent.cpp.

{
  return (QGroupBox*) m_ImageContent;
}
QGroupBox * QmitkThresholdComponent::GetMainCheckBoxContainer (  ) [virtual]

Method to return the outermost checkable ComboBox that is to decide whether the content shall be shown or not.

Reimplemented from QmitkFunctionalityComponentContainer.

Definition at line 297 of file QmitkThresholdComponent.cpp.

{
  return  m_ThresholdFinder;
}
QmitkDataStorageComboBox * QmitkThresholdComponent::GetTreeNodeSelector (  ) [virtual]

Method to return the TreeNodeSelector-QmitkDataStorageComboBox.

Reimplemented from QmitkFunctionalityComponentContainer.

Definition at line 81 of file QmitkThresholdComponent.cpp.

{
  return m_TreeNodeSelector;
}
void QmitkThresholdComponent::ImageSelected ( const mitk::DataNode item ) [virtual, slot]

Slot method that will be called if TreeNodeSelector widget was activated to select the current image.

Reimplemented from QmitkFunctionalityComponentContainer.

Definition at line 131 of file QmitkThresholdComponent.cpp.

References DataObjectSelected(), QmitkBaseFunctionalityComponent::ImageSelected(), QmitkBaseComponent::m_AddedChildList, QmitkDataStorageComboBox::SetSelectedNode(), and ShowThreshold().

Referenced by CreateConnections().

{
  if(m_ThresholdComponentGUI != NULL)
  {
    mitk::DataNode::Pointer selectedItem = const_cast< mitk::DataNode*>(item);
    m_TreeNodeSelector->SetSelectedNode(selectedItem);
    for(unsigned int i = 0;  i < m_AddedChildList.size(); i++) 
    {
      QmitkBaseFunctionalityComponent* functionalityComponent = dynamic_cast<QmitkBaseFunctionalityComponent*>(m_AddedChildList[i]);
      if (functionalityComponent != NULL)
        functionalityComponent->ImageSelected(item);
    }
  }
  DataObjectSelected();
  SetSliderRange();
  ShowThreshold();
}
void QmitkThresholdComponent::SetDataStorage ( mitk::DataStorage::Pointer  dataStorage ) [virtual]

Method to set the DataStorage.

Reimplemented from QmitkFunctionalityComponentContainer.

Definition at line 168 of file QmitkThresholdComponent.cpp.

References m_DataStorage.

Referenced by CreateQtPartControl().

{
  m_DataStorage = dataStorage;
}
void QmitkThresholdComponent::SetSelectorVisibility ( bool  visibility ) [virtual]

Method to set the Image Selector visible or invisible.

Reimplemented from QmitkFunctionalityComponentContainer.

Definition at line 64 of file QmitkThresholdComponent.cpp.

{
  if(m_ThresholdComponentGUI)
  {
    //m_ImageContent->setShown(visibility);
    m_ImageContent->setShown(true);
  }
}
void QmitkThresholdComponent::ShowImageContent ( bool  show = true ) [slot]

Slot method that will be called if the CheckBox at the TreeNodeSelector-Group-Box was toggled to show the TreeNodeSelector or not.

*************** SHOW IMAGE CONTENT **************/

Definition at line 363 of file QmitkThresholdComponent.cpp.

References QmitkFunctionalityComponentContainer::m_ShowSelector.

Referenced by CreateConnections().

{
  //m_ImageContent->setShown( m_ThresholdSelectDataGroupBox->isChecked());
  m_ImageContent->setShown( true);

  if(m_ShowSelector)
  {
    //m_ImageContent->setShown( m_ThresholdSelectDataGroupBox->isChecked());
    m_ImageContent->setShown( true);
  }
  else
  {
    //m_ThresholdSelectDataGroupBox->setShown(m_ShowSelector);
    m_ThresholdSelectDataGroupBox->setShown(true);
  }
}
void QmitkThresholdComponent::ShowThreshold ( bool  show = true ) [slot]

Slot method that will be called if the CheckBox at the Threshold-Group-Box was toggled to show the threshold image or not.

*************** SHOW THRESHOLD **************/

Definition at line 381 of file QmitkThresholdComponent.cpp.

References mitk::RenderingManager::GetInstance(), QmitkFunctionalityComponentContainer::m_Active, m_ThresholdImageNode, and mitk::BoolProperty::New().

Referenced by Activated(), DataObjectSelected(), DataStorageChanged(), Deactivated(), and ImageSelected().

{
  if(m_ThresholdImageNode)
  {
    if(m_Active == true)
    {
      m_ThresholdImageNode->SetProperty("visible", mitk::BoolProperty::New(( m_ThresholdFinder->isChecked())) );
    }
    else
    {
      if( m_DeleateImageIfDeactivatedCheckBox->isChecked())
      {
        m_ThresholdImageNode->SetProperty("visible", mitk::BoolProperty::New((false)) );
      }
    }
    mitk::RenderingManager::GetInstance()->RequestUpdateAll();
  }
}
void QmitkThresholdComponent::ShowThresholdFinderContent ( bool  show = true ) [slot]

Slot method that will be called if the CheckBox at the Threshold-Group-Box was toggled to show the threshold image or not.

************ SHOW THRESHOLD FINDER CONTENT ***********/

Definition at line 345 of file QmitkThresholdComponent.cpp.

References QmitkFunctionalityComponentContainer::m_ShowSelector.

Referenced by CreateConnections().

{
  // m_ShowThresholdGroupBox->setShown( m_ThresholdFinder->isChecked());
  // m_ContainerContent->setShown( m_ThresholdSelectDataGroupBox->isChecked());
  m_ContainerContent->setShown( m_ThresholdFinder->isChecked());


  if(m_ShowSelector)
  {
    //m_ThresholdSelectDataGroupBox->setShown( m_ThresholdSelectDataGroupBox->isChecked());
    //m_ThresholdSelectDataGroupBox->setShown( true);
    m_ThresholdSelectDataGroupBox->setShown(m_ThresholdFinder->isChecked());
  }

  //ShowThreshold();
}
void QmitkThresholdComponent::ThresholdSliderChanged ( int  moved = 0 ) [slot]

Slot method that will be called if the Thresholdslider was moved to update the shown image and the ThresholdLineEdit.

*************** THRESHOLD VALUE CHANGED **************/

Definition at line 402 of file QmitkThresholdComponent.cpp.

References mitk::RenderingManager::GetInstance(), and m_ThresholdImageNode.

Referenced by CreateConnections().

{
  int value =  m_ThresholdInputSlider->value();
  if (m_ThresholdImageNode)
  {
    m_ThresholdImageNode->SetLevelWindow(mitk::LevelWindow(value,1));
    mitk::RenderingManager::GetInstance()->RequestUpdateAll();
  }
  m_ThresholdInputNumber->setText(QString::number(value)); 
}
void QmitkThresholdComponent::ThresholdValueChanged (  ) [slot]

Slot method that will be called if the ThresholdLineEdit was changed to update the shown image and the ThresholdSlider.

*************** THRESHOLD VALUE CHANGED **************/

Definition at line 415 of file QmitkThresholdComponent.cpp.

References mitk::RenderingManager::GetInstance(), and m_ThresholdImageNode.

Referenced by CreateConnections().

{
  int value = atoi( m_ThresholdInputNumber->text().toLocal8Bit().constData() );
  if (m_ThresholdImageNode)
  {
    m_ThresholdImageNode->SetLevelWindow(mitk::LevelWindow(value,1));
    mitk::RenderingManager::GetInstance()->RequestUpdateAll();
  }
  m_ThresholdInputSlider->setValue(value);
}

Member Data Documentation

Item on the actual selected Image in the TreeNodeSelector.

Reimplemented from QmitkFunctionalityComponentContainer.

Definition at line 141 of file QmitkThresholdComponent.h.

Referenced by CreateThresholdSegmentation(), DataStorageChanged(), GetDataStorage(), and SetDataStorage().

a reference to the node with the thresholdImage and adjusted preferences to show the threshold

Definition at line 146 of file QmitkThresholdComponent.h.

Referenced by DataObjectSelected(), ShowThreshold(), ThresholdSliderChanged(), and ThresholdValueChanged().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines