diff --git a/Modules/Segmentation/Algorithms/mitkOtsuSegmentationFilter.cpp b/Modules/Segmentation/Algorithms/mitkOtsuSegmentationFilter.cpp index 7cdc595db3..6198487307 100644 --- a/Modules/Segmentation/Algorithms/mitkOtsuSegmentationFilter.cpp +++ b/Modules/Segmentation/Algorithms/mitkOtsuSegmentationFilter.cpp @@ -1,74 +1,78 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "mitkOtsuSegmentationFilter.h" #include "mitkImageCast.h" #include "mitkImageAccessByItk.h" #include "itkOtsuMultipleThresholdsImageFilter.h" struct paramContainer { - paramContainer( unsigned int numThresholds, mitk::Image::Pointer image ) - : m_NumberOfThresholds(numThresholds), m_Image(image) + paramContainer( unsigned int numThresholds, bool useValley, unsigned int numBins, mitk::Image::Pointer image ) + : m_NumberOfThresholds(numThresholds), m_ValleyEmphasis(useValley), m_NumberOfBins(numBins), m_Image(image) { } unsigned int m_NumberOfThresholds; + bool m_ValleyEmphasis; + unsigned int m_NumberOfBins; mitk::Image::Pointer m_Image; }; template void AccessItkOtsuFilter(itk::Image* itkImage, paramContainer params) { typedef itk::Image itkInputImageType; typedef itk::Image< mitk::OtsuSegmentationFilter::OutputPixelType, 3 > itkOutputImageType; typedef itk::OtsuMultipleThresholdsImageFilter< itkInputImageType, itkOutputImageType > OtsuFilterType; typename OtsuFilterType::Pointer filter = OtsuFilterType::New(); - filter->SetNumberOfThresholds(params.m_NumberOfThresholds); + filter->SetNumberOfThresholds( params.m_NumberOfThresholds ); filter->SetInput( itkImage ); + filter->SetValleyEmphasis( params.m_ValleyEmphasis ); + filter->SetNumberOfHistogramBins ( params.m_NumberOfBins ); try { filter->Update(); } catch( ... ) { mitkThrow() << "itkOtsuFilter error."; } mitk::CastToMitkImage(filter->GetOutput(), params.m_Image); return; } namespace mitk { OtsuSegmentationFilter::OtsuSegmentationFilter() -: m_NumberOfThresholds(2) + : m_NumberOfThresholds(2), m_ValleyEmphasis(false), m_NumberOfBins(128) { } OtsuSegmentationFilter::~OtsuSegmentationFilter() { } void OtsuSegmentationFilter::GenerateData() { mitk::Image::ConstPointer mitkImage = GetInput(); - AccessByItk_n( mitkImage, AccessItkOtsuFilter, (paramContainer( m_NumberOfThresholds, this->GetOutput()) ) ); + AccessByItk_n( mitkImage, AccessItkOtsuFilter, (paramContainer( m_NumberOfThresholds, m_ValleyEmphasis, m_NumberOfBins, this->GetOutput()) ) ); } } diff --git a/Modules/Segmentation/Algorithms/mitkOtsuSegmentationFilter.h b/Modules/Segmentation/Algorithms/mitkOtsuSegmentationFilter.h index 6ce647a15b..9d357ab5a1 100644 --- a/Modules/Segmentation/Algorithms/mitkOtsuSegmentationFilter.h +++ b/Modules/Segmentation/Algorithms/mitkOtsuSegmentationFilter.h @@ -1,75 +1,93 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkOtsuSegmentationFilter_h_Included #define mitkOtsuSegmentationFilter_h_Included //#include "MitkSBExports.h" #include "mitkImageToImageFilter.h" #include "mitkImage.h" #include "mitkITKImageImport.h" #include "itkImage.h" #include namespace mitk { /** \brief A filter that performs a multiple threshold otsu image segmentation. This class being an mitk::ImageToImageFilter performs a multiple threshold otsu image segmentation based on the image histogram. Internally, the itk::OtsuMultipleThresholdsImageFilter is used. $Author: somebody$ */ class MitkSegmentation_EXPORT OtsuSegmentationFilter : public ImageToImageFilter { public: typedef unsigned char OutputPixelType; typedef itk::Image< OutputPixelType, 3 > itkOutputImageType; typedef mitk::ITKImageImport ImageConverterType; mitkClassMacro(OtsuSegmentationFilter,ImageToImageFilter); itkFactorylessNewMacro(Self) itkCloneMacro(Self) itkGetMacro(NumberOfThresholds, unsigned int); - void SetNumberOfThresholds(unsigned int number) + + void SetNumberOfThresholds( unsigned int number ) { if (number < 1) { MITK_WARN << "Tried to set an invalid number of thresholds in the OtsuSegmentationFilter."; return; } m_NumberOfThresholds = number; } + void SetValleyEmphasis( bool useValley ) + { + m_ValleyEmphasis = useValley; + } + + void SetNumberOfBins( unsigned int number ) + { + if (number < 1) + { + MITK_WARN << "Tried to set an invalid number of bins in the OtsuSegmentationFilter."; + return; + } + m_NumberOfBins = number; + } + protected: OtsuSegmentationFilter(); virtual ~OtsuSegmentationFilter(); virtual void GenerateData(); //virtual void GenerateOutputInformation(); private: unsigned int m_NumberOfThresholds; + bool m_ValleyEmphasis; + unsigned int m_NumberOfBins; };//class }//namespace #endif diff --git a/Modules/Segmentation/Interactions/mitkOtsuTool3D.cpp b/Modules/Segmentation/Interactions/mitkOtsuTool3D.cpp index 1d45a171ee..6efc9fbc45 100644 --- a/Modules/Segmentation/Interactions/mitkOtsuTool3D.cpp +++ b/Modules/Segmentation/Interactions/mitkOtsuTool3D.cpp @@ -1,227 +1,229 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ // MITK #include "mitkOtsuTool3D.h" #include "mitkToolManager.h" #include "mitkRenderingManager.h" #include #include #include #include #include #include #include "mitkOtsuSegmentationFilter.h" // ITK #include #include #include "mitkRegionGrow3DTool.xpm" // us #include #include #include #include namespace mitk { MITK_TOOL_MACRO(MitkSegmentation_EXPORT, OtsuTool3D, "Otsu Segmentation"); } mitk::OtsuTool3D::OtsuTool3D() { } mitk::OtsuTool3D::~OtsuTool3D() { } void mitk::OtsuTool3D::Activated() { if (m_ToolManager) { m_OriginalImage = dynamic_cast(m_ToolManager->GetReferenceData(0)->GetData()); m_BinaryPreviewNode = mitk::DataNode::New(); m_BinaryPreviewNode->SetName("Binary_Preview"); m_BinaryPreviewNode->SetProperty( "color", ColorProperty::New(0.0, 1.0, 0.0) ); m_BinaryPreviewNode->SetProperty( "opacity", FloatProperty::New(0.3) ); //m_BinaryPreviewNode->SetBoolProperty("helper object", true); //m_BinaryPreviewNode->SetProperty("binary", mitk::BoolProperty::New(true)); m_ToolManager->GetDataStorage()->Add( this->m_BinaryPreviewNode ); m_MultiLabelResultNode = mitk::DataNode::New(); m_MultiLabelResultNode->SetName("Otsu_Preview"); //m_MultiLabelResultNode->SetBoolProperty("helper object", true); m_MultiLabelResultNode->SetVisibility(true); m_MaskedImagePreviewNode = mitk::DataNode::New(); m_MaskedImagePreviewNode->SetName("Volume_Preview"); //m_MultiLabelResultNode->SetBoolProperty("helper object", true); m_MaskedImagePreviewNode->SetVisibility(false); m_ToolManager->GetDataStorage()->Add( this->m_MultiLabelResultNode ); } } void mitk::OtsuTool3D::Deactivated() { m_ToolManager->GetDataStorage()->Remove( this->m_MultiLabelResultNode ); m_MultiLabelResultNode = NULL; m_ToolManager->GetDataStorage()->Remove( this->m_BinaryPreviewNode ); m_BinaryPreviewNode = NULL; m_ToolManager->GetDataStorage()->Remove( this->m_MaskedImagePreviewNode); m_MaskedImagePreviewNode = NULL; } const char** mitk::OtsuTool3D::GetXPM() const { return NULL; } us::ModuleResource mitk::OtsuTool3D::GetIconResource() const { us::Module* module = us::GetModuleContext()->GetModule(); us::ModuleResource resource = module->GetResource("Otsu_48x48.png"); return resource; } -void mitk::OtsuTool3D::RunSegmentation(int regions) +void mitk::OtsuTool3D::RunSegmentation(int regions, bool useValley, int numberOfBins) { //this->m_OtsuSegmentationDialog->setCursor(Qt::WaitCursor); int numberOfThresholds = regions - 1; unsigned int timestep = mitk::RenderingManager::GetInstance()->GetTimeNavigationController()->GetTime()->GetPos(); mitk::Image::Pointer image3D = Get3DImage(m_OriginalImage, timestep); mitk::OtsuSegmentationFilter::Pointer otsuFilter = mitk::OtsuSegmentationFilter::New(); otsuFilter->SetNumberOfThresholds( numberOfThresholds ); + otsuFilter->SetValleyEmphasis( useValley ); + otsuFilter->SetNumberOfBins( numberOfBins ); otsuFilter->SetInput( image3D ); try { otsuFilter->Update(); } catch( ... ) { mitkThrow() << "itkOtsuFilter error (image dimension must be in {2, 3} and image must not be RGB)"; } m_ToolManager->GetDataStorage()->Remove( this->m_MultiLabelResultNode ); m_MultiLabelResultNode = NULL; m_MultiLabelResultNode = mitk::DataNode::New(); m_MultiLabelResultNode->SetName("Otsu_Preview"); m_MultiLabelResultNode->SetVisibility(true); m_ToolManager->GetDataStorage()->Add( this->m_MultiLabelResultNode ); m_MultiLabelResultNode->SetOpacity(1.0); this->m_MultiLabelResultNode->SetData( otsuFilter->GetOutput() ); m_MultiLabelResultNode->SetProperty("binary", mitk::BoolProperty::New(false)); mitk::RenderingModeProperty::Pointer renderingMode = mitk::RenderingModeProperty::New(); renderingMode->SetValue( mitk::RenderingModeProperty::LOOKUPTABLE_LEVELWINDOW_COLOR ); m_MultiLabelResultNode->SetProperty("Image Rendering.Mode", renderingMode); mitk::LookupTable::Pointer lut = mitk::LookupTable::New(); mitk::LookupTableProperty::Pointer prop = mitk::LookupTableProperty::New(lut); vtkSmartPointer lookupTable = vtkSmartPointer::New(); lookupTable->SetHueRange(1.0, 0.0); lookupTable->SetSaturationRange(1.0, 1.0); lookupTable->SetValueRange(1.0, 1.0); lookupTable->SetTableRange(-1.0, 1.0); lookupTable->Build(); lut->SetVtkLookupTable(lookupTable); prop->SetLookupTable(lut); m_MultiLabelResultNode->SetProperty("LookupTable",prop); mitk::LevelWindowProperty::Pointer levWinProp = mitk::LevelWindowProperty::New(); mitk::LevelWindow levelwindow; levelwindow.SetRangeMinMax(0, numberOfThresholds + 1); levWinProp->SetLevelWindow( levelwindow ); m_MultiLabelResultNode->SetProperty( "levelwindow", levWinProp ); //m_BinaryPreviewNode->SetVisibility(false); // m_MultiLabelResultNode->SetVisibility(true); //this->m_OtsuSegmentationDialog->setCursor(Qt::ArrowCursor); mitk::RenderingManager::GetInstance()->RequestUpdateAll(); } void mitk::OtsuTool3D::ConfirmSegmentation() { GetTargetSegmentationNode()->SetData(dynamic_cast(m_BinaryPreviewNode->GetData())); m_ToolManager->ActivateTool(-1); } void mitk::OtsuTool3D::UpdateBinaryPreview(int regionID) { m_MultiLabelResultNode->SetVisibility(false); //pixel with regionID -> binary image const unsigned short dim = 3; typedef unsigned char PixelType; typedef itk::Image< PixelType, dim > InputImageType; typedef itk::Image< PixelType, dim > OutputImageType; typedef itk::BinaryThresholdImageFilter< InputImageType, OutputImageType > FilterType; FilterType::Pointer filter = FilterType::New(); InputImageType::Pointer itkImage; mitk::Image::Pointer multiLabelSegmentation = dynamic_cast(m_MultiLabelResultNode->GetData()); mitk::CastToItkImage(multiLabelSegmentation, itkImage); filter->SetInput(itkImage); filter->SetLowerThreshold(regionID); filter->SetUpperThreshold(regionID); filter->SetInsideValue(1); filter->SetOutsideValue(0); filter->Update(); mitk::Image::Pointer binarySegmentation; mitk::CastToMitkImage( filter->GetOutput(), binarySegmentation); m_BinaryPreviewNode->SetData(binarySegmentation); m_BinaryPreviewNode->SetVisibility(true); m_BinaryPreviewNode->SetProperty("outline binary", mitk::BoolProperty::New(false)); mitk::RenderingManager::GetInstance()->RequestUpdateAll(); } const char* mitk::OtsuTool3D::GetName() const { return "Otsu"; } void mitk::OtsuTool3D::UpdateVolumePreview(bool volumeRendering) { if (volumeRendering) { m_MaskedImagePreviewNode->SetBoolProperty("volumerendering", true); m_MaskedImagePreviewNode->SetBoolProperty("volumerendering.uselod", true); } else { m_MaskedImagePreviewNode->SetBoolProperty("volumerendering", false); } mitk::RenderingManager::GetInstance()->RequestUpdateAll(); } void mitk::OtsuTool3D::ShowMultiLabelResultNode(bool show) { m_MultiLabelResultNode->SetVisibility(show); m_BinaryPreviewNode->SetVisibility(!show); mitk::RenderingManager::GetInstance()->RequestUpdateAll(); } diff --git a/Modules/Segmentation/Interactions/mitkOtsuTool3D.h b/Modules/Segmentation/Interactions/mitkOtsuTool3D.h index ab71b0cd90..4cb64de4f1 100644 --- a/Modules/Segmentation/Interactions/mitkOtsuTool3D.h +++ b/Modules/Segmentation/Interactions/mitkOtsuTool3D.h @@ -1,62 +1,62 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef MITKOTSUTOOL3D_H #define MITKOTSUTOOL3D_H #include #include "mitkAutoSegmentationTool.h" namespace us { class ModuleResource; } namespace mitk{ class MitkSegmentation_EXPORT OtsuTool3D : public AutoSegmentationTool { public: mitkClassMacro(OtsuTool3D, AutoSegmentationTool); itkFactorylessNewMacro(Self) itkCloneMacro(Self) virtual const char* GetName() const; virtual const char** GetXPM() const; us::ModuleResource GetIconResource() const; virtual void Activated(); virtual void Deactivated(); - void RunSegmentation( int regions); + void RunSegmentation( int regions, bool useValley, int numberOfBins); void ConfirmSegmentation(); void UpdateBinaryPreview(int regionID); void UpdateVolumePreview(bool volumeRendering); void ShowMultiLabelResultNode(bool); protected: OtsuTool3D(); virtual ~OtsuTool3D(); mitk::Image::Pointer m_OriginalImage; //holds the user selected binary segmentation mitk::DataNode::Pointer m_BinaryPreviewNode; //holds the multilabel result as a preview image mitk::DataNode::Pointer m_MultiLabelResultNode; //holds the user selected binary segmentation masked original image mitk::DataNode::Pointer m_MaskedImagePreviewNode; };//class }//namespace #endif diff --git a/Modules/SegmentationUI/Qmitk/QmitkOtsuTool3DGUI.cpp b/Modules/SegmentationUI/Qmitk/QmitkOtsuTool3DGUI.cpp index 6bb13e242b..6694822d43 100644 --- a/Modules/SegmentationUI/Qmitk/QmitkOtsuTool3DGUI.cpp +++ b/Modules/SegmentationUI/Qmitk/QmitkOtsuTool3DGUI.cpp @@ -1,156 +1,160 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "QmitkOtsuTool3DGUI.h" #include "QmitkConfirmSegmentationDialog.h" #include #include #include #include #include #include MITK_TOOL_GUI_MACRO(MitkSegmentationUI_EXPORT, QmitkOtsuTool3DGUI, "") QmitkOtsuTool3DGUI::QmitkOtsuTool3DGUI() :QmitkToolGUI(), m_NumberOfRegions(0) { m_Controls.setupUi(this); connect( m_Controls.previewButton, SIGNAL(clicked()), this, SLOT(OnSpinboxValueAccept())); connect(m_Controls.m_selectionListWidget, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(OnItemSelectionChanged(QListWidgetItem*))); connect( m_Controls.m_ConfSegButton, SIGNAL(clicked()), this, SLOT(OnSegmentationRegionAccept())); connect( this, SIGNAL(NewToolAssociated(mitk::Tool*)), this, SLOT(OnNewToolAssociated(mitk::Tool*)) ); } QmitkOtsuTool3DGUI::~QmitkOtsuTool3DGUI() { } void QmitkOtsuTool3DGUI::OnItemSelectionChanged(QListWidgetItem* item) { if (m_SelectedItem == item) { m_SelectedItem = 0; m_Controls.m_selectionListWidget->clearSelection(); m_Controls.m_ConfSegButton->setEnabled( false ); m_OtsuTool3DTool->ShowMultiLabelResultNode(true); return; } m_SelectedItem = item; if (m_OtsuTool3DTool.IsNotNull()) { // TODO update preview of region m_OtsuTool3DTool->UpdateBinaryPreview(m_SelectedItem->text().toInt()); if ( !m_Controls.m_selectionListWidget->selectedItems().empty() ) { m_Controls.m_ConfSegButton->setEnabled( true ); } else { m_Controls.m_ConfSegButton->setEnabled( false ); } } } void QmitkOtsuTool3DGUI::OnNewToolAssociated(mitk::Tool* tool) { m_OtsuTool3DTool = dynamic_cast( tool ); } void QmitkOtsuTool3DGUI::OnSegmentationRegionAccept() { QmitkConfirmSegmentationDialog dialog; QString segName = QString::fromStdString(m_OtsuTool3DTool->GetCurrentSegmentationName()); dialog.SetSegmentationName(segName); int result = dialog.exec(); switch(result) { case QmitkConfirmSegmentationDialog::CREATE_NEW_SEGMENTATION: m_OtsuTool3DTool->SetOverwriteExistingSegmentation(false); break; case QmitkConfirmSegmentationDialog::OVERWRITE_SEGMENTATION: m_OtsuTool3DTool->SetOverwriteExistingSegmentation(true); break; case QmitkConfirmSegmentationDialog::CANCEL_SEGMENTATION: return; } if (m_OtsuTool3DTool.IsNotNull() && m_Controls.m_selectionListWidget->currentItem() != NULL) { m_OtsuTool3DTool->ConfirmSegmentation(); } } void QmitkOtsuTool3DGUI::OnSpinboxValueAccept() { - if( m_NumberOfRegions == m_Controls.m_Spinbox->value() ) + if( m_NumberOfRegions == m_Controls.m_Spinbox->value() && + m_UseValleyEmphasis == m_Controls.m_ValleyCheckbox->isChecked() && + m_NumberOfBins == m_Controls.m_BinsSpinBox->value() ) return; if (m_OtsuTool3DTool.IsNotNull()) { try { m_NumberOfRegions = m_Controls.m_Spinbox->value(); + m_UseValleyEmphasis = m_Controls.m_ValleyCheckbox->isChecked(); + m_NumberOfBins = m_Controls.m_BinsSpinBox->value(); int proceed; QMessageBox* messageBox = new QMessageBox(QMessageBox::Question, NULL, "The otsu segmentation computation may take several minutes depending on the number of Regions you selected. Proceed anyway?", QMessageBox::Ok | QMessageBox::Cancel); if (m_NumberOfRegions >= 5) { proceed = messageBox->exec(); if (proceed != QMessageBox::Ok) return; } this->setCursor(Qt::WaitCursor); - m_OtsuTool3DTool->RunSegmentation( m_NumberOfRegions ); + m_OtsuTool3DTool->RunSegmentation( m_NumberOfRegions, m_UseValleyEmphasis, m_NumberOfBins ); this->setCursor(Qt::ArrowCursor); } catch( ... ) { this->setCursor(Qt::ArrowCursor); QMessageBox* messageBox = new QMessageBox(QMessageBox::Critical, NULL, "itkOtsuFilter error: image dimension must be in {2, 3} and no RGB images can be handled."); messageBox->exec(); delete messageBox; return; } //insert regions into widget QString itemName; QListWidgetItem* item; m_Controls.m_selectionListWidget->clear(); for(int i=0; ivalue(); ++i) { itemName = QString::number(i); item = new QListWidgetItem(itemName); m_Controls.m_selectionListWidget->addItem(item); } //deactivate 'confirm segmentation'-button m_Controls.m_ConfSegButton->setEnabled(false); } } void QmitkOtsuTool3DGUI::OnVolumePreviewChecked(int state) { if (state == 1) { } } diff --git a/Modules/SegmentationUI/Qmitk/QmitkOtsuTool3DGUI.h b/Modules/SegmentationUI/Qmitk/QmitkOtsuTool3DGUI.h index f2860a1577..3a59bcdd30 100644 --- a/Modules/SegmentationUI/Qmitk/QmitkOtsuTool3DGUI.h +++ b/Modules/SegmentationUI/Qmitk/QmitkOtsuTool3DGUI.h @@ -1,78 +1,82 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QmitkOtsuTool3DGUI_h_Included #define QmitkOtsuTool3DGUI_h_Included #include "QmitkToolGUI.h" #include #include "mitkOtsuTool3D.h" #include #include #include "ui_QmitkOtsuToolWidgetControls.h" class QSpinBox; class QLabel; /** \ingroup org_mitk_gui_qt_interactivesegmentation_internal \brief GUI for mitk::. \sa mitk:: This GUI shows ... Last contributor: $Author$ */ class MitkSegmentationUI_EXPORT QmitkOtsuTool3DGUI : public QmitkToolGUI { Q_OBJECT public: mitkClassMacro(QmitkOtsuTool3DGUI, QmitkToolGUI); itkFactorylessNewMacro(Self) itkCloneMacro(Self) signals: public slots: protected slots: void OnNewToolAssociated(mitk::Tool*); void OnSpinboxValueAccept(); void OnSegmentationRegionAccept(); void OnItemSelectionChanged(QListWidgetItem *item); void OnVolumePreviewChecked(int); protected: QmitkOtsuTool3DGUI(); virtual ~QmitkOtsuTool3DGUI(); mitk::OtsuTool3D::Pointer m_OtsuTool3DTool; Ui_QmitkOtsuToolWidgetControls m_Controls; int m_NumberOfRegions; + bool m_UseValleyEmphasis; + + int m_NumberOfBins; + QListWidgetItem* m_SelectedItem; }; #endif diff --git a/Modules/SegmentationUI/Qmitk/QmitkOtsuToolWidgetControls.ui b/Modules/SegmentationUI/Qmitk/QmitkOtsuToolWidgetControls.ui index ea8bff06a2..2662dd4336 100644 --- a/Modules/SegmentationUI/Qmitk/QmitkOtsuToolWidgetControls.ui +++ b/Modules/SegmentationUI/Qmitk/QmitkOtsuToolWidgetControls.ui @@ -1,157 +1,192 @@ QmitkOtsuToolWidgetControls 0 0 192 - 205 + 239 0 0 100 0 100000 100000 QmitkOtsuToolWidget Move to adjust the segmentation QLayout::SetDefaultConstraint 0 QLayout::SetNoConstraint 0 0 Number of Regions: 0 0 40 16777215 2 32 + + + + + + Use Valley Emphasis + + + + + + + + + + + Number of Histogram Bins: + + + + + + + 2 + + + 2048 + + + 128 + + + + + 0 0 10000000 100 0 QAbstractItemView::SingleSelection QListView::Adjust 0 0 100000 16777215 Preview false 0 0 100000 16777215 Confirm Segmentation