Skip to content

Commit

Permalink
Fixes #21: Shows what type of linear object is being collected in man…
Browse files Browse the repository at this point in the history
…ual segmentation mode.
  • Loading branch information
matthewsholden committed May 12, 2014
1 parent 50d8777 commit 9648131
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
32 changes: 29 additions & 3 deletions Widgets/qSlicerLORManualSegmentationWidget.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ void qSlicerLORManualSegmentationWidget
::widgetActivated()
{
Q_D(qSlicerLORManualSegmentationWidget);
this->updateWidget();
}


Expand All @@ -142,6 +143,22 @@ ::widgetDeactivated()
{
this->LORNode->StopCollecting();
}
this->updateWidget();
}


void qSlicerLORManualSegmentationWidget
::SetAndObserveCollectNode( vtkMRMLNode* newCollectNode )
{
Q_D(qSlicerLORManualSegmentationWidget);

this->widgetDeactivated();

this->Superclass::SetAndObserveCollectNode( newCollectNode );

this->qvtkConnect( this->CollectNode, vtkMRMLLinearTransformNode::TransformModifiedEvent, this, SLOT( updateWidget() ) );

this->widgetActivated();
}


Expand All @@ -158,6 +175,7 @@ ::onCollectButtonToggled()
{
this->LORNode->StopCollecting();
}
this->updateWidget();
}


Expand All @@ -172,17 +190,25 @@ ::updateWidget()
return;
}

disconnect( d->CollectButton, SIGNAL( toggled( bool ) ), this, SLOT( onCollectButtonClicked() ) );
disconnect( d->CollectButton, SIGNAL( toggled( bool ) ), this, SLOT( onCollectButtonToggled() ) );

if ( this->LORNode->GetCollectState().compare( LORConstants::UNKNOWNDOF_COLLECT_STATE ) )
if ( this->LORNode->GetCollectState().compare( LORConstants::UNKNOWNDOF_COLLECT_STATE ) == 0 )
{
d->CollectButton->setChecked( true );
std::stringstream typeString;
typeString << "Collect (";
typeString << LORConstants::DOF_TO_STRING( this->LORNode->GetActivePositionBuffer()->GetDOF( this->LORNode->GetNoiseThreshold() ) );
typeString << ")";
d->CollectButton->setText( QString::fromStdString( typeString.str() ) );
}
else
{
d->CollectButton->setChecked( false );
std::stringstream typeString;
typeString << "Collect ()";
d->CollectButton->setText( QString::fromStdString( typeString.str() ) );
}

connect( d->CollectButton, SIGNAL( toggled( bool ) ), this, SLOT( onCollectButtonClicked() ) );
connect( d->CollectButton, SIGNAL( toggled( bool ) ), this, SLOT( onCollectButtonToggled() ) );

}
2 changes: 2 additions & 0 deletions Widgets/qSlicerLORManualSegmentationWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ qSlicerLORManualSegmentationWidget : public qSlicerLORCollectControlsWidget
virtual std::string GetCollectNodeType();
virtual std::string GetCollectModeName();

virtual void SetAndObserveCollectNode( vtkMRMLNode* newCollectNode );

public slots:

virtual void widgetActivated();
Expand Down

0 comments on commit 9648131

Please sign in to comment.