00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "QmitkThresholdComponent.h"
00018 #include "ui_QmitkThresholdComponentControls.h"
00019
00020
00021 #include <QmitkDataStorageComboBox.h>
00022 #include <mitkDataStorage.h>
00023
00024 #include "mitkRenderingManager.h"
00025 #include "mitkProperties.h"
00026 #include "mitkDataNodeFactory.h"
00027 #include "mitkImageTimeSelector.h"
00028 #include "mitkLevelWindowProperty.h"
00029
00030 #include <mitkNodePredicateDataType.h>
00031 #include <mitkNodePredicateProperty.h>
00032
00033 #include <qlineedit.h>
00034 #include <qslider.h>
00035 #include <qgroupbox.h>
00036 #include <qcheckbox.h>
00037 #include <QIntValidator>
00038
00039 #include <mitkImageAccessByItk.h>
00040
00041 #include <itkImageConstIteratorWithIndex.h>
00042
00043
00044
00045 QmitkThresholdComponent::QmitkThresholdComponent(QObject * parent, const char * parentName, bool updateSelector, bool showSelector, QmitkStdMultiWidget * )
00046 : QmitkFunctionalityComponentContainer(parent, parentName, updateSelector, showSelector),
00047 m_ThresholdImageNode(NULL),
00048 m_ThresholdComponentGUI(NULL),
00049 m_ThresholdNodeExisting(false)
00050 {
00051 SetAvailability(true);
00052
00053 SetComponentName("ThresholdFinder");
00054 }
00055
00056
00057 QmitkThresholdComponent::~QmitkThresholdComponent()
00058 {
00059
00060 }
00061
00062
00063
00064 void QmitkThresholdComponent::SetSelectorVisibility(bool )
00065 {
00066 if(m_ThresholdComponentGUI)
00067 {
00068
00069 m_ImageContent->setShown(true);
00070 }
00071 }
00072
00073
00074 QGroupBox* QmitkThresholdComponent::GetImageContent()
00075 {
00076 return (QGroupBox*) m_ImageContent;
00077 }
00078
00079
00080
00081 QmitkDataStorageComboBox* QmitkThresholdComponent::GetTreeNodeSelector()
00082 {
00083 return m_TreeNodeSelector;
00084 }
00085
00086
00087 void QmitkThresholdComponent::CreateConnections()
00088 {
00089 if ( m_ThresholdComponentGUI )
00090 {
00091 connect( (QObject*)(m_TreeNodeSelector), SIGNAL(OnSelectionChanged (const mitk::DataNode *)), (QObject*) this, SLOT(ImageSelected(const mitk::DataNode *)));
00092 connect( (QObject*)(m_ThresholdFinder), SIGNAL(toggled(bool)), (QObject*) this, SLOT(ShowThresholdFinderContent(bool)));
00093 connect( (QObject*)(m_ThresholdSelectDataGroupBox), SIGNAL(toggled(bool)), (QObject*) this, SLOT(ShowImageContent(bool)));
00094
00095 connect( (QObject*)(m_ThresholdInputSlider), SIGNAL(sliderMoved(int)), (QObject*) this, SLOT(ThresholdSliderChanged(int)));
00096 connect( (QObject*)(m_ThresholdInputNumber), SIGNAL(returnPressed()), (QObject*) this, SLOT(ThresholdValueChanged()));
00097
00098
00099
00100 connect( (QObject*)(m_ThresholdFinder), SIGNAL(toggled(bool)), (QObject*) this, SLOT(SetContentContainerVisibility(bool)));
00101 connect( (QObject*)(m_CreateSegmentationButton), SIGNAL(released()), (QObject*) this, SLOT(CreateThresholdSegmentation()));
00102 }
00103 }
00104
00105
00106 void QmitkThresholdComponent::DataStorageChanged(mitk::DataStorage::Pointer ds)
00107 {
00108 if(!ds)
00109 return;
00110 m_DataStorage = ds;
00111 m_TreeNodeSelector->SetDataStorage(ds);
00112
00113 if(m_ThresholdComponentGUI != NULL)
00114 {
00115 for(unsigned int i = 0; i < m_AddedChildList.size(); i++)
00116 {
00117 QmitkBaseFunctionalityComponent* functionalityComponent = dynamic_cast<QmitkBaseFunctionalityComponent*>(m_AddedChildList[i]);
00118 if (functionalityComponent != NULL)
00119 functionalityComponent->DataStorageChanged(ds);
00120 }
00121 }
00122 if(!ds)
00123 return;
00124
00125 DataObjectSelected();
00126 SetSliderRange();
00127 ShowThreshold();
00128 }
00129
00130
00131 void QmitkThresholdComponent::ImageSelected(const mitk::DataNode* item)
00132 {
00133 if(m_ThresholdComponentGUI != NULL)
00134 {
00135 mitk::DataNode::Pointer selectedItem = const_cast< mitk::DataNode*>(item);
00136 m_TreeNodeSelector->SetSelectedNode(selectedItem);
00137 for(unsigned int i = 0; i < m_AddedChildList.size(); i++)
00138 {
00139 QmitkBaseFunctionalityComponent* functionalityComponent = dynamic_cast<QmitkBaseFunctionalityComponent*>(m_AddedChildList[i]);
00140 if (functionalityComponent != NULL)
00141 functionalityComponent->ImageSelected(item);
00142 }
00143 }
00144 DataObjectSelected();
00145 SetSliderRange();
00146 ShowThreshold();
00147 }
00148
00149
00150 void QmitkThresholdComponent::DataObjectSelected()
00151 {
00152 if(m_Active)
00153 {
00154 if(m_ThresholdNodeExisting)
00155 {
00156 m_ThresholdImageNode->SetData(m_TreeNodeSelector->GetSelectedNode()->GetData());
00157 }
00158 else
00159 {
00160 CreateThresholdImageNode();
00161 m_ThresholdImageNode->SetData(m_TreeNodeSelector->GetSelectedNode()->GetData());
00162 }
00163 ShowThreshold();
00164 }
00165 }
00166
00168 void QmitkThresholdComponent::SetDataStorage(mitk::DataStorage::Pointer dataStorage)
00169 {
00170 m_DataStorage = dataStorage;
00171 }
00172
00174 mitk::DataStorage::Pointer QmitkThresholdComponent::GetDataStorage()
00175 {
00176 return m_DataStorage;
00177 }
00178
00179
00180 void QmitkThresholdComponent::CreateQtPartControl(QWidget * , mitk::DataStorage::Pointer dataStorage)
00181 {
00182 m_GUI = new QWidget;
00183 m_ThresholdComponentGUI = new Ui::QmitkThresholdComponentControls;
00184 m_ThresholdComponentGUI->setupUi(m_GUI);
00185
00186
00187
00188
00189
00190 m_ThresholdFinder = new QGroupBox("2. Find Threshold", m_GUI);
00191 m_ThresholdSelectDataGroupBox = new QGroupBox("Show Image Selector", m_ThresholdFinder);
00192 m_TreeNodeSelector = new QmitkDataStorageComboBox(m_ThresholdSelectDataGroupBox);
00193 m_ImageContent = new QGroupBox("m_ImageContent", m_ThresholdSelectDataGroupBox);
00194 m_ContainerContent = new QGroupBox(m_ImageContent);
00195 m_ShowThresholdGroupBox = new QGroupBox("m_ShowThresholdGroupBox", m_ContainerContent);
00196 m_ThresholdInputNumber = new QLineEdit(m_ShowThresholdGroupBox);
00197 m_ThresholdInputSlider = new QSlider(m_ShowThresholdGroupBox);
00198 m_ThresholdInputSlider->setOrientation(Qt::Horizontal);
00199 m_ThresholdValueContent = new QGroupBox("m_ThresholdValueContent", m_ShowThresholdGroupBox);
00200 m_CreateSegmentationButton = new QPushButton("Create Segmentation", m_ThresholdValueContent);
00201 m_DeleateImageIfDeactivatedCheckBox = new QCheckBox("Deleate Threshold Image if \nComponent is deactivated", m_ThresholdValueContent);
00202
00203 m_ThresholdFinder->setCheckable(true);
00204 m_ThresholdFinder->setChecked(true);
00205
00206 m_ThresholdSelectDataGroupBox->setCheckable(true);
00207 m_ThresholdSelectDataGroupBox->setChecked(true);
00208
00209 m_ThresholdInputNumber->setFixedSize(40, 20);
00210 QIntValidator* intValid = new QIntValidator(-32000, 5000, m_ThresholdInputNumber);
00211 m_ThresholdInputNumber->setValidator(intValid);
00212 m_ThresholdInputNumber->setText("0");
00213
00214 m_ThresholdValueContent->setMaximumHeight(90);
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231 QVBoxLayout* guiLayout = new QVBoxLayout(m_GUI);
00232 m_GUI->setLayout(guiLayout);
00233 guiLayout->addWidget(m_ThresholdFinder);
00234
00235 QVBoxLayout* thresholdFinderLayout = new QVBoxLayout(m_ThresholdFinder);
00236 thresholdFinderLayout->setContentsMargins(0,9,0,9);
00237 m_ThresholdFinder->setLayout(thresholdFinderLayout);
00238 thresholdFinderLayout->addWidget(m_ThresholdSelectDataGroupBox);
00239 thresholdFinderLayout->addWidget(m_ImageContent);
00240
00241 QVBoxLayout* thresholdSelectDataGroupBoxLayout = new QVBoxLayout(m_ThresholdSelectDataGroupBox);
00242 thresholdSelectDataGroupBoxLayout->setContentsMargins(0,9,0,9);
00243 m_ThresholdSelectDataGroupBox->setLayout(thresholdSelectDataGroupBoxLayout);
00244 thresholdSelectDataGroupBoxLayout->addWidget(m_TreeNodeSelector);
00245
00246
00247 QVBoxLayout* imageContentLayout = new QVBoxLayout(m_ImageContent);
00248 imageContentLayout->setContentsMargins(0,9,0,9);
00249 m_ImageContent->setLayout(imageContentLayout);
00250 imageContentLayout->addWidget(m_ContainerContent);
00251
00252 QVBoxLayout* containerContentLayout = new QVBoxLayout(m_ContainerContent);
00253 containerContentLayout->setContentsMargins(0,9,0,9);
00254 m_ContainerContent->setLayout(containerContentLayout);
00255 containerContentLayout->addWidget(m_ShowThresholdGroupBox);
00256
00257 QVBoxLayout* showThresholdGroupBoxLayout = new QVBoxLayout(m_ShowThresholdGroupBox);
00258 showThresholdGroupBoxLayout->setContentsMargins(0,9,0,9);
00259 m_ShowThresholdGroupBox->setLayout(showThresholdGroupBoxLayout);
00260 QHBoxLayout* thresholdInputLayout = new QHBoxLayout(m_ShowThresholdGroupBox);
00261 thresholdInputLayout->addWidget(m_ThresholdInputNumber);
00262 thresholdInputLayout->addWidget(m_ThresholdInputSlider);
00263 showThresholdGroupBoxLayout->addLayout(thresholdInputLayout);
00264 showThresholdGroupBoxLayout->addWidget(m_ThresholdValueContent);
00265
00266 QVBoxLayout* thresholdValueContentLayout = new QVBoxLayout(m_ThresholdValueContent);
00267 thresholdValueContentLayout->setContentsMargins(0,9,0,9);
00268 m_ThresholdValueContent->setLayout(thresholdValueContentLayout);
00269 thresholdValueContentLayout->addWidget(m_DeleateImageIfDeactivatedCheckBox);
00270 thresholdValueContentLayout->addWidget(m_CreateSegmentationButton);
00271
00272 this->CreateConnections();
00273 SetDataStorage(dataStorage);
00274
00275 m_TreeNodeSelector->SetDataStorage(dataStorage);
00276 m_TreeNodeSelector->SetPredicate(mitk::NodePredicateDataType::New("Image"));
00277
00278 if(m_ShowSelector)
00279 {
00280 m_ImageContent->setShown( m_ThresholdSelectDataGroupBox->isChecked());
00281
00282 }
00283 else
00284 {
00285 m_ThresholdSelectDataGroupBox->setShown(m_ShowSelector);
00286
00287 }
00288 }
00289
00290
00291 QGroupBox * QmitkThresholdComponent::GetContentContainer()
00292 {
00293 return m_ContainerContent;
00294 }
00295
00296
00297 QGroupBox * QmitkThresholdComponent::GetMainCheckBoxContainer()
00298 {
00299 return m_ThresholdFinder;
00300 }
00301
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315 void QmitkThresholdComponent::Activated()
00316 {
00317 QmitkBaseFunctionalityComponent::Activated();
00318 m_Active = true;
00319 for(unsigned int i = 0; i < m_AddedChildList.size(); i++)
00320 {
00321 m_AddedChildList[i]->Activated();
00322 }
00323 CreateThresholdImageNode();
00324 ShowThreshold();
00325 SetSliderRange();
00326 }
00327
00328
00329 void QmitkThresholdComponent::Deactivated()
00330 {
00331 QmitkBaseFunctionalityComponent::Deactivated();
00332 m_Active = false;
00333 for(unsigned int i = 0; i < m_AddedChildList.size(); i++)
00334 {
00335 m_AddedChildList[i]->Deactivated();
00336 }
00337 ShowThreshold();
00338 if( m_DeleateImageIfDeactivatedCheckBox->isChecked())
00339 {
00340 DeleteThresholdNode();
00341 }
00342 }
00343
00345 void QmitkThresholdComponent::ShowThresholdFinderContent(bool)
00346 {
00347
00348
00349 m_ContainerContent->setShown( m_ThresholdFinder->isChecked());
00350
00351
00352 if(m_ShowSelector)
00353 {
00354
00355
00356 m_ThresholdSelectDataGroupBox->setShown(m_ThresholdFinder->isChecked());
00357 }
00358
00359
00360 }
00361
00363 void QmitkThresholdComponent::ShowImageContent(bool)
00364 {
00365
00366 m_ImageContent->setShown( true);
00367
00368 if(m_ShowSelector)
00369 {
00370
00371 m_ImageContent->setShown( true);
00372 }
00373 else
00374 {
00375
00376 m_ThresholdSelectDataGroupBox->setShown(true);
00377 }
00378 }
00379
00381 void QmitkThresholdComponent::ShowThreshold(bool)
00382 {
00383 if(m_ThresholdImageNode)
00384 {
00385 if(m_Active == true)
00386 {
00387 m_ThresholdImageNode->SetProperty("visible", mitk::BoolProperty::New(( m_ThresholdFinder->isChecked())) );
00388 }
00389 else
00390 {
00391 if( m_DeleateImageIfDeactivatedCheckBox->isChecked())
00392 {
00393 m_ThresholdImageNode->SetProperty("visible", mitk::BoolProperty::New((false)) );
00394 }
00395 }
00396 mitk::RenderingManager::GetInstance()->RequestUpdateAll();
00397 }
00398 }
00399
00401
00402 void QmitkThresholdComponent::ThresholdSliderChanged(int)
00403 {
00404 int value = m_ThresholdInputSlider->value();
00405 if (m_ThresholdImageNode)
00406 {
00407 m_ThresholdImageNode->SetLevelWindow(mitk::LevelWindow(value,1));
00408 mitk::RenderingManager::GetInstance()->RequestUpdateAll();
00409 }
00410 m_ThresholdInputNumber->setText(QString::number(value));
00411 }
00412
00414
00415 void QmitkThresholdComponent::ThresholdValueChanged( )
00416 {
00417 int value = atoi( m_ThresholdInputNumber->text().toLocal8Bit().constData() );
00418 if (m_ThresholdImageNode)
00419 {
00420 m_ThresholdImageNode->SetLevelWindow(mitk::LevelWindow(value,1));
00421 mitk::RenderingManager::GetInstance()->RequestUpdateAll();
00422 }
00423 m_ThresholdInputSlider->setValue(value);
00424 }
00425
00426
00428 void QmitkThresholdComponent::SetSliderRange()
00429 {
00430 if(m_Active)
00431 {
00432 if( m_ThresholdFinder->isChecked()==true)
00433 {
00434 if(!m_TreeNodeSelector->GetSelectedNode())
00435 return;
00436 if(!m_TreeNodeSelector->GetSelectedNode()->GetData())
00437 return;
00438 mitk::Image* currentImage = dynamic_cast<mitk::Image*>(m_TreeNodeSelector->GetSelectedNode()->GetData());
00439 if(currentImage)
00440 {
00441 int min = (int) currentImage->GetScalarValueMin();
00442 int max = (int) currentImage->GetScalarValueMaxNoRecompute();
00443
00444 if(min < -32000)
00445 {
00446 min = (int) currentImage->GetScalarValue2ndMin();
00447 max = (int) currentImage->GetScalarValue2ndMaxNoRecompute();
00448 }
00449
00450 QIntValidator* intValid = new QIntValidator(min-150, max+150, m_ThresholdInputNumber);
00451 m_ThresholdInputNumber->setValidator(intValid);
00452 m_ThresholdInputNumber->setText("1");
00453
00454 m_ThresholdInputSlider->setMinimum(min-150);
00455 m_ThresholdInputSlider->setMaximum(max+150);
00456 m_ThresholdInputSlider->setRange(min-150, max+150);
00457 m_ThresholdInputSlider->setPageStep(1);
00458 m_ThresholdInputSlider->setValue(1);
00459
00460 m_GUI->repaint();
00461
00462
00463
00464
00465 }
00466 }
00467 }
00468 }
00469
00471 void QmitkThresholdComponent::DeleteThresholdNode()
00472 {
00473 if(m_ThresholdImageNode)
00474 {
00475
00476 mitk::DataNode::Pointer foundNode = m_DataStorage->GetNamedNode("Thresholdview image");
00477 foundNode->Delete();
00478
00479
00480 m_ThresholdNodeExisting = false;
00481 return;
00482 }
00483 }
00485 void QmitkThresholdComponent::CreateThresholdImageNode()
00486 {
00487 if(m_Active)
00488 {
00489 if( m_ThresholdNodeExisting)
00490 return;
00491 if(!m_TreeNodeSelector)
00492 return;
00493 if(!m_TreeNodeSelector->GetSelectedNode())
00494 return;
00495 m_ThresholdImageNode = mitk::DataNode::New();
00496 mitk::StringProperty::Pointer nameProp = mitk::StringProperty::New("Thresholdview image" );
00497 m_ThresholdImageNode->SetProperty( "name", nameProp );
00498 mitk::BoolProperty::Pointer componentThresholdImageProp = mitk::BoolProperty::New(true);
00499 m_ThresholdImageNode->SetProperty( "isComponentThresholdImage", componentThresholdImageProp );
00500 m_ThresholdImageNode->SetData(m_TreeNodeSelector->GetSelectedNode()->GetData());
00501 m_ThresholdImageNode->SetColor(0.0,1.0,0.0);
00502 m_ThresholdImageNode->SetOpacity(.25);
00503 int layer = 0;
00504 m_ThresholdImageNode->GetIntProperty("layer", layer);
00505 m_ThresholdImageNode->SetIntProperty("layer", layer+1);
00506 m_ThresholdImageNode->SetLevelWindow(mitk::LevelWindow(atoi( m_ThresholdInputNumber->text().toLocal8Bit().constData()),1));
00507 m_ThresholdNodeExisting = true;
00508 m_DataStorage->Add(m_ThresholdImageNode);
00509
00510 }
00511 }
00512
00513
00514 void QmitkThresholdComponent::CreateThresholdSegmentation()
00515 {
00516 mitk::Image::Pointer original = dynamic_cast<mitk::Image*>(m_TreeNodeSelector->GetSelectedNode()->GetData());
00517
00518 if (!original) return;
00519
00520
00521 mitk::PixelType pixelType( typeid(DefaultSegmentationDataType) );
00522 mitk::Image::Pointer segmentation = mitk::Image::New();
00523
00524
00525 segmentation->Initialize( pixelType, original->GetDimension(), original->GetDimensions() );
00526
00527 unsigned int byteSize = sizeof(DefaultSegmentationDataType);
00528 for (unsigned int dim = 0; dim < segmentation->GetDimension(); ++dim)
00529 {
00530 byteSize *= segmentation->GetDimension(dim);
00531 }
00532 memset( segmentation->GetData(), 0, byteSize );
00533
00534 if (original->GetTimeSlicedGeometry() )
00535 {
00536 mitk::AffineGeometryFrame3D::Pointer originalGeometryAGF = original->GetTimeSlicedGeometry()->Clone();
00537 mitk::TimeSlicedGeometry::Pointer originalGeometry = dynamic_cast<mitk::TimeSlicedGeometry*>( originalGeometryAGF.GetPointer() );
00538 segmentation->SetGeometry( originalGeometry );
00539 }
00540 else
00541 {
00542 MITK_INFO<<"Original image does not have a 'Time sliced geometry'! Cannot create a segmentation.";
00543 return ;
00544 }
00545
00546 mitk::DataNode::Pointer emptySegmentationNode = CreateSegmentationNode( segmentation);
00547
00548 if (emptySegmentationNode)
00549 {
00550
00551 for (unsigned int timeStep = 0; timeStep < original->GetTimeSteps(); ++timeStep)
00552 {
00553 try
00554 {
00555 mitk::ImageTimeSelector::Pointer timeSelector = mitk::ImageTimeSelector::New();
00556 timeSelector->SetInput( original );
00557 timeSelector->SetTimeNr( timeStep );
00558 timeSelector->UpdateLargestPossibleRegion();
00559 mitk::Image::Pointer image3D = timeSelector->GetOutput();
00560
00561 AccessFixedDimensionByItk_2( image3D, ITKThresholding, 3, dynamic_cast<mitk::Image*>(emptySegmentationNode->GetData()), timeStep );
00562 }
00563 catch(...)
00564 {
00565 MITK_INFO<<"Error accessing single time steps of the original image. Cannot create segmentation.";
00566 }
00567 }
00568
00569 mitk::DataNode::Pointer originalNode = m_TreeNodeSelector->GetSelectedNode();
00570 m_DataStorage->Add( emptySegmentationNode, originalNode );
00571
00572 }
00573 }
00574
00575 mitk::DataNode::Pointer QmitkThresholdComponent::CreateSegmentationNode( mitk::Image* image)
00576 {
00577
00578 if (!image) return NULL;
00579
00580
00581 mitk::DataNode::Pointer segmentationNode = mitk::DataNode::New();
00582 segmentationNode->SetData( image );
00583
00584
00585 segmentationNode->SetProperty( "name", mitk::StringProperty::New( "TH segmentation from ThresholdFinder" ) );
00586
00587
00588 segmentationNode->SetProperty( "binary", mitk::BoolProperty::New(true) );
00589 segmentationNode->SetProperty( "color", mitk::ColorProperty::New(0.0, 1.0, 0.0) );
00590 segmentationNode->SetProperty( "texture interpolation", mitk::BoolProperty::New(false) );
00591 segmentationNode->SetProperty( "layer", mitk::IntProperty::New(10) );
00592 segmentationNode->SetProperty( "levelwindow", mitk::LevelWindowProperty::New( mitk::LevelWindow(0.5, 1) ) );
00593 segmentationNode->SetProperty( "opacity", mitk::FloatProperty::New(0.3) );
00594 segmentationNode->SetProperty( "segmentation", mitk::BoolProperty::New(true) );
00595 segmentationNode->SetProperty( "showVolume", mitk::BoolProperty::New( false ) );
00596
00597 return segmentationNode;
00598 }
00599
00600 template <typename TPixel, unsigned int VImageDimension>
00601 void QmitkThresholdComponent::ITKThresholding( itk::Image<TPixel, VImageDimension>* originalImage, mitk::Image* segmentation, unsigned int timeStep )
00602 {
00603 mitk::ImageTimeSelector::Pointer timeSelector = mitk::ImageTimeSelector::New();
00604 timeSelector->SetInput( segmentation );
00605 timeSelector->SetTimeNr( timeStep );
00606 timeSelector->UpdateLargestPossibleRegion();
00607 mitk::Image::Pointer segmentation3D = timeSelector->GetOutput();
00608
00609 typedef itk::Image< DefaultSegmentationDataType, 3> SegmentationType;
00610 SegmentationType::Pointer itkSegmentation;
00611 CastToItkImage( segmentation3D, itkSegmentation );
00612
00613
00614 typedef itk::ImageRegionConstIterator< itk::Image<TPixel, VImageDimension> > InputIteratorType;
00615 typedef itk::ImageRegionIterator< SegmentationType > SegmentationIteratorType;
00616
00617 InputIteratorType inputIterator( originalImage, originalImage->GetLargestPossibleRegion() );
00618 SegmentationIteratorType outputIterator( itkSegmentation, itkSegmentation->GetLargestPossibleRegion() );
00619
00620 inputIterator.GoToBegin();
00621 outputIterator.GoToBegin();
00622
00623 while (!outputIterator.IsAtEnd())
00624 {
00625 if ( (signed)inputIterator.Get() >= atoi( m_ThresholdInputNumber->text().toLocal8Bit().constData()) )
00626 {
00627 outputIterator.Set( 1 );
00628 }
00629 else
00630 {
00631 outputIterator.Set( 0 );
00632 }
00633
00634 ++inputIterator;
00635 ++outputIterator;
00636 }
00637 }