X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=inline;f=vv%2FvvToolBinarize.cxx;h=0e584d1999dc4660da5c332ba2d2038d1b911509;hb=dd629343e9209aa7a536b205f390f59f00247049;hp=22b356d3e014ef7f24a08a77b6cd52b2d4fe20b7;hpb=0350f04002063f12dcf10ee765f5389590f352e7;p=clitk.git
diff --git a/vv/vvToolBinarize.cxx b/vv/vvToolBinarize.cxx
index 22b356d..0e584d1 100644
--- a/vv/vvToolBinarize.cxx
+++ b/vv/vvToolBinarize.cxx
@@ -1,39 +1,35 @@
/*=========================================================================
+ Program: vv http://www.creatis.insa-lyon.fr/rio/vv
- Program: vv
- Module: $RCSfile: vvToolBinarize.cxx,v $
- Language: C++
- Date: $Date: 2010/02/03 10:54:08 $
- Version: $Revision: 1.3 $
- Author : David Sarrut (david.sarrut@creatis.insa-lyon.fr)
+ Authors belong to:
+ - University of LYON http://www.universite-lyon.fr/
+ - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
+ - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr
- Copyright (C) 2008
- Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr
- CREATIS-LRMN http://www.creatis.insa-lyon.fr
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the copyright notices for more information.
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, version 3 of the License.
+ It is distributed under dual licence
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-
- =========================================================================*/
+ - BSD See included LICENSE.txt file
+ - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
+ ======================================================================-====*/
+// vv
#include "vvToolBinarize.h"
#include "vvSlicerManager.h"
#include "vvSlicer.h"
#include "vvToolInputSelectorWidget.h"
+// clitk
#include "clitkBinarizeImageGenericFilter.h"
-#include "vtkImageActor.h"
-#include "vtkCamera.h"
+// vtk
+#include
+#include
+#include
+#include
//------------------------------------------------------------------------------
// Create the tool and automagically (I like this word) insert it in
@@ -43,32 +39,32 @@ ADD_TOOL(vvToolBinarize);
//------------------------------------------------------------------------------
-vvToolBinarize::vvToolBinarize(QWidget * parent, Qt::WindowFlags f)
- :QDialog(parent,f), vvToolBase(), Ui::vvToolBinarize()
+void vvToolBinarize::Initialize()
{
- // Set Modality : dialog is not modal but stay always on top because
- // parent is set at construction
- setModal(false);
- setAttribute(Qt::WA_DeleteOnClose);
+ SetToolName("Binarize");
+ SetToolMenuName("Binarize");
+ SetToolIconFilename(":/common/icons/binarize.png");
+ SetToolTip("Image interactive binarization with thresholds.");
+}
+//------------------------------------------------------------------------------
- // GUI Initialization
- setupUi(this);
- // Connect signals & slots
- connect(mToolInputSelectionWidget, SIGNAL(accepted()), this, SLOT(InputIsSelected()));
- connect(mToolInputSelectionWidget, SIGNAL(rejected()), this, SLOT(close()));
- connect(buttonBox, SIGNAL(accepted()), this, SLOT(apply()));
- connect(buttonBox, SIGNAL(rejected()), this, SLOT(close()));
- connect(mThresholdSlider1, SIGNAL(valueChanged(double)), this, SLOT(valueChangedT1(double)));
- connect(mThresholdSlider2, SIGNAL(valueChanged(double)), this, SLOT(valueChangedT2(double)));
+//------------------------------------------------------------------------------
+vvToolBinarize::vvToolBinarize(vvMainWindowBase * parent, Qt::WindowFlags f)
+ :vvToolWidgetBase(parent,f),
+ vvToolBase(parent),
+ Ui::vvToolBinarize()
+{
+ DD("Const binarize");
+ // GUI Initialization
+ Ui_vvToolBinarize::setupUi(mToolWidget);
+ mInteractiveDisplayIsEnabled = mCheckBoxInteractiveDisplay->isChecked();
+ // Connect signals & slots
connect(mRadioButtonLowerThan, SIGNAL(toggled(bool)), this, SLOT(enableLowerThan(bool)));
-
- // VTK objects
- mClipper = vtkImageClip::New();
- mSquares1 = vtkMarchingSquares::New();
- mSquaresMapper1 = vtkPolyDataMapper::New();
- mSquaresActor1 = vtkActor::New();
+ connect(mCheckBoxUseFG, SIGNAL(toggled(bool)), this, SLOT(useFGBGtoggled(bool)));
+ connect(mCheckBoxUseBG, SIGNAL(toggled(bool)), this, SLOT(useFGBGtoggled(bool)));
+ connect(mCheckBoxInteractiveDisplay, SIGNAL(toggled(bool)), this, SLOT(InteractiveDisplayToggled(bool)));
// Initialize some widget
mThresholdSlider1->SetText("");
@@ -76,201 +72,224 @@ vvToolBinarize::vvToolBinarize(QWidget * parent, Qt::WindowFlags f)
mFGSlider->SetText("Foreground value");
mBGSlider->SetText("Background value");
- // Disable main widget while input image is not selected
- toolMainWidget->setEnabled(false);
+ // Main filter
+ mFilter = new clitk::BinarizeImageGenericFilter;
+
+ // Set how many inputs are needed for this tool
+ AddInputSelector("Select one image", mFilter);
+}
+//------------------------------------------------------------------------------
- // Main filter
- mFilter = new clitk::BinarizeImageGenericFilter; //DS PUT IN BASECLASS ?
- // Initialize the input selection (mFilter should be create before !)
- InitializeListOfInputImages(mToolInputSelectionWidget, mFilter);
+//------------------------------------------------------------------------------
+vvToolBinarize::~vvToolBinarize()
+{
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
-vvToolBinarize::~vvToolBinarize() {
+void vvToolBinarize::InteractiveDisplayToggled(bool b)
+{
+ mInteractiveDisplayIsEnabled = b;
+ if (!mInteractiveDisplayIsEnabled) {
+ RemoveVTKObjects();
+ } else {
+ for(unsigned int i=0; iShowActors();
+ if (mRadioButtonLowerThan->isChecked())
+ mImageContourLower[i]->ShowActors();
+ }
+ if (mCurrentSlicerManager)
+ mCurrentSlicerManager->Render();
+ }
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
-void vvToolBinarize::enableLowerThan(bool b) {
+void vvToolBinarize::RemoveVTKObjects()
+{
+ for(unsigned int i=0; iHideActors();
+ mImageContourLower[i]->HideActors();
+ }
+ if (mCurrentSlicerManager)
+ mCurrentSlicerManager->Render();
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+bool vvToolBinarize::close()
+{
+ // RemoveVTKObjects();
+ return vvToolWidgetBase::close();
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolBinarize::closeEvent(QCloseEvent *event) {
+ RemoveVTKObjects();
+ event->accept();
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolBinarize::reject()
+{
+ // DD("vvToolBinarize::reject");
+ RemoveVTKObjects();
+ return vvToolWidgetBase::reject();
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+void vvToolBinarize::enableLowerThan(bool b)
+{
if (!b) {
mThresholdSlider1->resetMaximum();
- }
- else {
+ for(unsigned int i=0; iHideActors();
+ }
+ mCurrentSlicerManager->Render();
+ } else {
valueChangedT1(mThresholdSlider1->GetValue());
+ valueChangedT2(mThresholdSlider2->GetValue());
+ for(unsigned int i=0; iShowActors();
+ }
+ mCurrentSlicerManager->Render();
}
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
-void vvToolBinarize::InputIsSelected() {
+void vvToolBinarize::useFGBGtoggled(bool)
+{
+ if (!mCheckBoxUseBG->isChecked() && !mCheckBoxUseFG->isChecked())
+ mCheckBoxUseBG->toggle();
+}
+//------------------------------------------------------------------------------
+
- // Common
- int index = mToolInputSelectionWidget->GetSelectedInputIndex();
- mCurrentSliceManager = mSlicerManagersCompatible[index];
- mCurrentImage = mCurrentSliceManager->GetImage();
- toolMainWidget->setEnabled(true);
+//------------------------------------------------------------------------------
+// void vvToolBinarize::InputIsSelected(std::vector & m) {
+// DD("vvToolBinarize::InputIsSelected vector in binarize");
+// DD(m.size());
+// }
+void vvToolBinarize::InputIsSelected(vvSlicerManager * m)
+{
+ mCurrentSlicerManager = m;
// Specific for this gui
+ mThresholdSlider1->SetValue(0);
+ mThresholdSlider2->SetValue(0);
mThresholdSlider1->SetImage(mCurrentImage);
mThresholdSlider2->SetImage(mCurrentImage);
mFGSlider->SetImage(mCurrentImage);
mBGSlider->SetImage(mCurrentImage);
+ // DD(mCurrentSlicerManager->GetFileName().c_str());
+ // mFGSlider->SetMaximum(mCurrentImage->GetFirstVTKImageData()->GetScalarTypeMax());
+ // mFGSlider->SetMinimum(mCurrentImage->GetFirstVTKImageData()->GetScalarTypeMin());
+ // mBGSlider->SetMaximum(mCurrentImage->GetFirstVTKImageData()->GetScalarTypeMax());
+ // mBGSlider->SetMinimum(mCurrentImage->GetFirstVTKImageData()->GetScalarTypeMin());
+
+ // Output is uchar ...
+ mFGSlider->SetMaximum(255);
+ mFGSlider->SetMinimum(0);
+ mBGSlider->SetMaximum(255);
+ mBGSlider->SetMinimum(0);
+
mFGSlider->SetValue(1);
mBGSlider->SetValue(0);
- DD(mCurrentSliceManager->GetFileName().c_str());
-
- DD("VTK");
- DD(mCurrentSliceManager->NumberOfSlicers());
- // mClipper->SetInput(mCurrentSliceManager->GetSlicer(0)->GetInput());
- DD(mCurrentImage->GetFirstVTKImageData());
- DD(mClipper);
- DD(mCurrentSliceManager->GetSlicer(0));
- mClipper->SetInput(mCurrentImage->GetFirstVTKImageData());
-
- mSquares1->SetInput(mClipper->GetOutput());
- mSquaresMapper1->SetInput(mSquares1->GetOutput());
- mSquaresActor1->SetMapper(mSquaresMapper1);
- mSquaresActor1->GetProperty()->SetColor(1.0,0,0);
- mSquaresActor1->SetPickable(0);
- mCurrentSliceManager->GetSlicer(0)->GetRenderer()->AddActor(mSquaresActor1);
- mSquares1->Update();
-
-
- DD("VTK end");
-
- // connect(mCurrentSliceManager,SIGNAL(UpdateTSlice(int,int)),this,SLOT(UpdateSlice(int, int)));
- connect(mCurrentSliceManager,SIGNAL(UpdateSlice(int,int)),this,SLOT(UpdateSlice(int, int)));
- //connect(mCurrentSliceManager,SIGNAL(UpdateSliceRange(int,int,int,int,int)),this,SLOT(UpdateSlice(int, int)));
- // connect(mCurrentSliceManager,SIGNAL(LandmarkAdded()),this,SLOT(InsertSeed()));
-
-}
-//------------------------------------------------------------------------------
+ mFGSlider->SetSingleStep(1);
+ mBGSlider->SetSingleStep(1);
+
+ // VTK objects for interactive display
+ for(int i=0; iNumberOfSlicers(); i++) {
+ mImageContour.push_back(new vvImageContour);
+ mImageContour[i]->SetSlicer(mCurrentSlicerManager->GetSlicer(i));
+ mImageContour[i]->SetColor(1.0, 0.0, 0.0);
+ mImageContourLower.push_back(new vvImageContour);
+ mImageContourLower[i]->SetSlicer(mCurrentSlicerManager->GetSlicer(i));
+ mImageContourLower[i]->SetColor(0.0, 0.0, 1.0);
+ }
+ valueChangedT1(mThresholdSlider1->GetValue());
+ connect(mThresholdSlider1, SIGNAL(valueChanged(double)), this, SLOT(valueChangedT1(double)));
+ connect(mThresholdSlider2, SIGNAL(valueChanged(double)), this, SLOT(valueChangedT2(double)));
-//------------------------------------------------------------------------------
-void vvToolBinarize::UpdateSlice(int slicer,int slices) {
-
- // A METTRE SUR TOUT LES SLICES ! PAS QUE 0
+ connect(mCurrentSlicerManager,SIGNAL(UpdateSlice(int,int)),this,SLOT(UpdateSlice(int, int)));
+ connect(mCurrentSlicerManager,SIGNAL(UpdateTSlice(int,int)),this,SLOT(UpdateSlice(int, int)));
- // !! signal update slice pas tjs quand move slicer ???
+ // connect(mCurrentSlicerManager, SIGNAL(LeftButtonReleaseSignal(int)), SLOT(LeftButtonReleaseEvent(int)));
+}
+//------------------------------------------------------------------------------
- int slice = mCurrentSliceManager->GetSlicer(0)->GetSlice();
- int tslice = mCurrentSliceManager->GetSlicer(0)->GetTSlice();
- mClipper->SetInput(mCurrentSliceManager->GetSlicer(0)->GetInput());
- int* extent = mCurrentSliceManager->GetSlicer(0)->GetImageActor()->GetDisplayExtent();
- mClipper->SetOutputWholeExtent(extent[0],extent[1],extent[2],extent[3],extent[4],extent[5]);
- int i;
- for (i = 0; i < 6;i = i+2)
- {
- if (extent[i] == extent[i+1])
- {
- break;
- }
- }
+//------------------------------------------------------------------------------
+// void vvToolBinarize::LeftButtonReleaseEvent(int slicer) {
+// DD("LeftButtonReleaseEvent");
+// for(int i=0; iNumberOfSlicers(); i++) {
+// if (i == slicer);
+// mCurrentSlicerManager->GetSlicer(i)->GetRenderWindow()->Render();
+// }
+// }
+//------------------------------------------------------------------------------
- switch (i)
- {
- case 0:
- if (mCurrentSliceManager->GetSlicer(0)->GetRenderer()->GetActiveCamera()->GetPosition()[0] > slice)
- {
- mSquaresActor1->SetPosition(1,0,0);
- // mSquaresActor2->SetPosition(1,0,0);
- }
- else
- {
- mSquaresActor1->SetPosition(-1,0,0);
- // mSquaresActor2->SetPosition(-1,0,0);
- }
- break;
- case 2:
- if (mCurrentSliceManager->GetSlicer(0)->GetRenderer()->GetActiveCamera()->GetPosition()[1] > slice)
- {
- mSquaresActor1->SetPosition(0,1,0);
- // mSquaresActor2->SetPosition(0,1,0);
- }
- else
- {
- mSquaresActor1->SetPosition(0,-1,0);
- // mSquaresActor2->SetPosition(0,-1,0);
- }
- break;
- case 4:
- if (mCurrentSliceManager->GetSlicer(0)->GetRenderer()->GetActiveCamera()->GetPosition()[2] > slice)
- {
- mSquaresActor1->SetPosition(0,0,1);
- // mSquaresActor2->SetPosition(0,0,1);
- }
- else
- {
- mSquaresActor1->SetPosition(0,0,-1);
- // mSquaresActor2->SetPosition(0,0,-1);
- }
- break;
- }
- mSquares1->Update();
- // mSquares2->Update();
- mCurrentSliceManager->Render();
+//------------------------------------------------------------------------------
+void vvToolBinarize::UpdateSlice(int slicer,int slices)
+{
+ if (!mInteractiveDisplayIsEnabled) return;
+ if (!mCurrentSlicerManager) close();
+ mImageContour[slicer]->Update(mThresholdSlider1->GetValue());
+ if (mRadioButtonLowerThan->isChecked())
+ mImageContourLower[slicer]->Update(mThresholdSlider2->GetValue());
}
//------------------------------------------------------------------------------
+
//------------------------------------------------------------------------------
-void vvToolBinarize::GetArgsInfoFromGUI() {
+void vvToolBinarize::GetArgsInfoFromGUI()
+{
/* //KEEP THIS FOR READING GGO FROM FILE
- int argc=1;
- std::string a = "toto";
- char * const* argv = new char*;
- //a.c_str();
- struct cmdline_parser_params p;
- p.check_required = 0;
- int good = cmdline_parser_ext(argc, argv, &args_info, &p);
- DD(good);
+ int argc=1;
+ std::string a = "toto";
+ char * const* argv = new char*;
+ //a.c_str();
+ struct cmdline_parser_params p;
+ p.check_required = 0;
+ int good = cmdline_parser_ext(argc, argv, &args_info, &p);
+ DD(good);
*/
+ mArgsInfo.imagetypes_flag = 0;
mArgsInfo.upper_given = 0;
mArgsInfo.lower_given = 0;
bool inverseBGandFG = false;
- if (mRadioButtonGreaterThan->isChecked()) { // Greater Than (and Lower Than)
- mArgsInfo.lower_given = 1;
- mArgsInfo.lower_arg = mThresholdSlider1->GetValue();
- DD(mArgsInfo.lower_arg);
- if (mRadioButtonLowerThan->isChecked()) {
- mArgsInfo.upper_given = 1;
- mArgsInfo.upper_arg = mThresholdSlider2->GetValue();
- if (mArgsInfo.upper_argisChecked()) {
- mArgsInfo.lower_given = 1;
- mArgsInfo.upper_given = 1;
- mArgsInfo.lower_arg = mThresholdSlider1->GetValue();
- mArgsInfo.upper_arg = mThresholdSlider1->GetValue();
- }
- else {
- mArgsInfo.lower_given = 1;
- mArgsInfo.upper_given = 1;
- mArgsInfo.lower_arg = mThresholdSlider1->GetValue();
- mArgsInfo.upper_arg = mThresholdSlider1->GetValue();
- inverseBGandFG = true;
+ mArgsInfo.lower_given = 1;
+ mArgsInfo.lower_arg = mThresholdSlider1->GetValue();
+ // DD(mArgsInfo.lower_arg);
+ if (mRadioButtonLowerThan->isChecked()) {
+ mArgsInfo.upper_given = 1;
+ mArgsInfo.upper_arg = mThresholdSlider2->GetValue();
+ if (mArgsInfo.upper_argGetValue();
mArgsInfo.bg_arg = mBGSlider->GetValue();
- DD(inverseBGandFG);
if (inverseBGandFG) {
mArgsInfo.fg_arg = mFGSlider->GetValue();
mArgsInfo.bg_arg = mBGSlider->GetValue();
@@ -278,18 +297,17 @@ void vvToolBinarize::GetArgsInfoFromGUI() {
mArgsInfo.fg_given = 1;
mArgsInfo.bg_given = 1;
- mArgsInfo.useBG_flag = mCheckBoxUseBG->isChecked();
- mArgsInfo.useFG_flag = mCheckBoxUseFG->isChecked();
-
- DD(mArgsInfo.useBG_flag);
- DD(mArgsInfo.useFG_flag);
+ if (mCheckBoxUseBG->isChecked()) {
+ if (mCheckBoxUseFG->isChecked()) mArgsInfo.mode_arg = (char*)"both";
+ else mArgsInfo.mode_arg = (char*)"BG";
+ } else mArgsInfo.mode_arg = (char*)"FG";
- mArgsInfo.verbose_flag = true;
+ mArgsInfo.verbose_flag = false;
// Required (even if not used)
mArgsInfo.input_given = 0;
mArgsInfo.output_given = 0;
-
+
mArgsInfo.input_arg = new char;
mArgsInfo.output_arg = new char;
}
@@ -297,106 +315,58 @@ void vvToolBinarize::GetArgsInfoFromGUI() {
//------------------------------------------------------------------------------
-void vvToolBinarize::apply() {
- DD("Apply");
-
+void vvToolBinarize::apply()
+{
+ if (!mCurrentSlicerManager) close();
+ QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
GetArgsInfoFromGUI();
- DD(mArgsInfo.lower_arg);
- // cmdline_parser2(argc, argv, &args_info, 1, 1, 0);
- // if (args_info.config_given)
- // cmdline_parser_configfile ("toto.config", &args_info, 0, 0, 1);
- // else cmdline_parser(argc, argv, &args_info);
-
// Main filter
- clitk::BinarizeImageGenericFilter::Pointer filter =
- clitk::BinarizeImageGenericFilter::New();
- filter->SetArgsInfo(mArgsInfo);
+ clitk::BinarizeImageGenericFilter::Pointer filter =
+ clitk::BinarizeImageGenericFilter::New();
filter->SetInputVVImage(mCurrentImage);
+ filter->SetArgsInfo(mArgsInfo);
+ filter->EnableReadOnDisk(false);
filter->Update();
- // Output ???
+ // Output
vvImage::Pointer output = filter->GetOutputVVImage();
- DD(output->GetScalarTypeAsString());
- CREATOR(vvToolBinarize)->mMainWindow->AddImage(output,"toto.mhd");
+ std::ostringstream osstream;
+ osstream << "Binarized_" << mCurrentSlicerManager->GetSlicer(0)->GetFileName() << ".mhd";
+ AddImage(output,osstream.str());
+ QApplication::restoreOverrideCursor();
close();
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
-void vvToolBinarize::valueChangedT2(double v) {
- if (mRadioButtonLowerThan->isChecked()) mThresholdSlider1->SetMaximum(v);
+void vvToolBinarize::valueChangedT2(double v)
+{
+ // DD("valueChangedT2");
+ if (mRadioButtonLowerThan->isChecked()) {
+ mThresholdSlider1->SetMaximum(v);
+ if (!mInteractiveDisplayIsEnabled) return;
+ for(int i=0;iNumberOfSlicers(); i++) {
+ mImageContourLower[i]->Update(v);
+ }
+ mCurrentSlicerManager->Render();
+ }
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
-void vvToolBinarize::valueChangedT1(double v) {
+void vvToolBinarize::valueChangedT1(double v)
+{
+ // DD("valueChangedT1");
+ if (!mCurrentSlicerManager) close();
mThresholdSlider2->SetMinimum(v);
- DD(v);
- int m1 = (int)lrint(v);
- DD(m1);
- int* extent = mCurrentSliceManager->GetSlicer(0)->GetImageActor()->GetDisplayExtent();
- mClipper->SetOutputWholeExtent(extent[0],extent[1],extent[2],extent[3],extent[4],extent[5]);
-
-
-int slice = mCurrentSliceManager->GetSlicer(0)->GetSlice();
-
- int i;
-for (i = 0; i < 6;i = i+2)
- {
- if (extent[i] == extent[i+1])
- {
- break;
- }
- }
-
- switch (i)
- {
- case 0:
- if (mCurrentSliceManager->GetSlicer(0)->GetRenderer()->GetActiveCamera()->GetPosition()[0] > slice)
- {
- mSquaresActor1->SetPosition(1,0,0);
- // mSquaresActor2->SetPosition(1,0,0);
- }
- else
- {
- mSquaresActor1->SetPosition(-1,0,0);
- // mSquaresActor2->SetPosition(-1,0,0);
- }
- break;
- case 2:
- if (mCurrentSliceManager->GetSlicer(0)->GetRenderer()->GetActiveCamera()->GetPosition()[1] > slice)
- {
- mSquaresActor1->SetPosition(0,1,0);
- // mSquaresActor2->SetPosition(0,1,0);
- }
- else
- {
- mSquaresActor1->SetPosition(0,-1,0);
- // mSquaresActor2->SetPosition(0,-1,0);
- }
- break;
- case 4:
- if (mCurrentSliceManager->GetSlicer(0)->GetRenderer()->GetActiveCamera()->GetPosition()[2] > slice)
- {
- mSquaresActor1->SetPosition(0,0,1);
- // mSquaresActor2->SetPosition(0,0,1);
- }
- else
- {
- mSquaresActor1->SetPosition(0,0,-1);
- // mSquaresActor2->SetPosition(0,0,-1);
- }
- break;
- }
-
-
-
-
- mSquares1->SetValue(0,m1);
- mSquares1->Update();
- mCurrentSliceManager->Render();
+ // int m1 = (int)lrint(v);
+ if (!mInteractiveDisplayIsEnabled) return;
+ for(int i=0;iNumberOfSlicers(); i++) {
+ mImageContour[i]->Update(v);
+ }
+ mCurrentSlicerManager->Render();
}
//------------------------------------------------------------------------------