- CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
======================================================================-====*/
-/* =================================================
- * @file clitkBinarizeImageGenericFilter.txx
- * @author Jef Vandemeulebroucke <jef@creatis.insa-lyon.fr>
- * @date 29 June 2009
- *
- * @brief Binarize an image
- *
- ===================================================*/
-
// clitk
#include "clitkBinarizeImage_ggo.h"
#include "clitkBinarizeImageGenericFilter.h"
return;
}
if (KeyPress == "Up") {
- DD("------------ up");
+ // DD("------------ up");
this->SM->GetSlicer(VisibleInWindow)->SetSlice(this->SM->GetSlicer(VisibleInWindow)->GetSlice()+1);
- DD("------------ after set slice");
+ //DD("------------ after set slice");
this->SM->UpdateInfoOnCursorPosition(VisibleInWindow);
- DD("------------ after UpdateInfoOnCursorPosition");
+ //DD("------------ after UpdateInfoOnCursorPosition");
this->SM->UpdateSlice(VisibleInWindow);
- DD("------------ after updateslice");
+ //DD("------------ after updateslice");
}
if (KeyPress == "Down") {
this->SM->GetSlicer(VisibleInWindow)->SetSlice(this->SM->GetSlicer(VisibleInWindow)->GetSlice()-1);
- CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
======================================================================-====*/
-
#ifndef VVTOOLBASE_CXX
#define VVTOOLBASE_CXX
#include "vvToolBase.h"
-// //------------------------------------------------------------------------------
-// void vvToolBaseBase::initializeListOfInputImages() {
-
-// }
-
-
-
#endif
static void SetToolTip(QString n) { vvToolCreator<ToolType>::GetInstance()->mToolTip = n; }
static void SetToolExperimental(bool exp) { vvToolCreator<ToolType>::GetInstance()->mExperimental = exp; }
- void AddImage(vvImage::Pointer image,std::string filename) {
- CREATOR(ToolType)->GetMainWindow()->AddImage(image,filename);
+ static QIcon GetToolIcon() { return QIcon(vvToolCreator<ToolType>::GetInstance()->mToolIconFilename); }
+ static QString & GetToolName() { return vvToolCreator<ToolType>::GetInstance()->mToolName; }
+
+ vvSlicerManager * AddImage(vvImage::Pointer image,std::string filename) {
+ return CREATOR(ToolType)->GetMainWindow()->AddImage(image,filename);
}
void setSender(QObject *s) { mSender = s; }
- 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"
+// vtk
#include <vtkImageActor.h>
#include <vtkCamera.h>
#include <vtkImageClip.h>
vvToolBase<vvToolBinarize>(parent),
Ui::vvToolBinarize()
{
+ DD("Const binarize");
// GUI Initialization
Ui_vvToolBinarize::setupUi(mToolWidget);
mInteractiveDisplayIsEnabled = mCheckBoxInteractiveDisplay->isChecked();
//------------------------------------------------------------------------------
bool vvToolBinarize::close()
{
- RemoveVTKObjects();
+ // RemoveVTKObjects();
return vvToolWidgetBase::close();
}
//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+void vvToolBinarize::closeEvent(QCloseEvent *event) {
+ RemoveVTKObjects();
+ event->accept();
+}
+//------------------------------------------------------------------------------
+
+
//------------------------------------------------------------------------------
void vvToolBinarize::reject()
{
======================================================================-====*/
#ifndef VVTOOLBINARIZE_H
#define VVTOOLBINARIZE_H
+
#include <QtDesigner/QDesignerExportWidget>
#include "vvToolBase.h"
#include "vvToolWidgetBase.h"
#include "vvImageContour.h"
#include "ui_vvToolBinarize.h"
+
#include "clitkBinarizeImage_ggo.h"
//------------------------------------------------------------------------------
protected:
void RemoveVTKObjects();
+ virtual void closeEvent(QCloseEvent *event);
Ui::vvToolBinarize ui;
args_info_clitkBinarizeImage mArgsInfo;
std::vector<vvImageContour*> mImageContour;
// Get information on the current image
mMainWindow->UpdateCurrentSlicer();
// Create the tool
- ToolType * tool = new ToolType(mMainWindow);
+ ToolType * tool = new ToolType(mMainWindow, Qt::Dialog);
tool->setSender(mSender);
// Put it in the list of open tools
mListOfTool.push_back(tool);
//------------------------------------------------------------------------------
-bool vvToolCropImage::close()
+void vvToolCropImage::closeEvent(QCloseEvent *event)
{
for(int i=0; i<mExtentSize; i++) mReducedExtent[i] = mInitialExtent[i];
UpdateExtent();
+ event->accept();
+}
+//------------------------------------------------------------------------------
+
+
+//------------------------------------------------------------------------------
+bool vvToolCropImage::close()
+{
+ // for(int i=0; i<mExtentSize; i++) mReducedExtent[i] = mInitialExtent[i];
+// UpdateExtent();
return vvToolWidgetBase::close();
}
//------------------------------------------------------------------------------
int * mInitialExtent;
int mExtentSize;
void UpdateExtent();
+ virtual void closeEvent(QCloseEvent *event);
}; // end class vvToolCropImage
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolInputSelectorWidget::Initialize()
{
+ // setWindowModality(Qt::WindowModal);
for(unsigned int i=0; i<mListOfSimpleInputWidget.size(); i++)
mListOfSimpleInputWidget[i]->Initialize();
}
//------------------------------------------------------------------------------
void vvToolInputSelectorWidget::accept()
{
+ // setWindowModality(Qt::NonModal);
// DD("vvToolInputSelectorWidget::accept");
//DD(mNumberOfAcceptedInputs);
mNumberOfAcceptedInputs++;
QWidget::setEnabled(b);
mInputSelectionButtonBox->setEnabled(b);
mInputSequenceBox->setEnabled(b);
+
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void vvToolSimpleInputSelectorWidget::changeInput(int index)
{
+ // DD(index);
if (index<0) return;
+ if (index>=(int)mSlicerManagerList.size()) return;
mCurrentIndex = index;
vvImage * mCurrentImage = mSlicerManagerList[index]->GetImage();
+ if (mCurrentImage == NULL) return;
+ // DD("la");
unsigned int d = mCurrentImage->GetNumberOfDimensions();
+ // DD(d);
QString size;
QString spacing;
for(unsigned int i=0; i<d-1; i++) {
}
size.append(QString("%1").arg(mCurrentImage->GetSize()[d-1]));
spacing.append(QString("%1").arg(mCurrentImage->GetSpacing()[d-1]));
- mLabelInputInfo->setText(QString("Image: %1D %2 %3 %4")
+ mLabelInputInfo->setText(QString("%1D %2\n%3\n%4")
.arg(d)
.arg(mCurrentImage->GetScalarTypeAsString().c_str())
.arg(size)
.arg(spacing));
+ // DD("fin");
}
//------------------------------------------------------------------------------