#define VVIMAGE_CXX
#include "vvImage.h"
#include "clitkCommon.h"
-
+#include <vtkTransform.h>
#include <vtkImageData.h>
#include <vtkImageReslice.h>
-
#include <cassert>
//--------------------------------------------------------------------
vvImage::vvImage() {
- Init();
+ Init();
}
//--------------------------------------------------------------------
void vvImage::Init() {
mTimeSpacing = 1;
mTimeOrigin = 0;
+
if (CLITK_EXPERIMENTAL)
{
mVtkImageReslice = vtkSmartPointer<vtkImageReslice>::New();
+ transform = vtkSmartPointer<vtkTransform>::New();
mVtkImageReslice->SetInterpolationModeToLinear();
mVtkImageReslice->AutoCropOutputOn();
+ mVtkImageReslice->SetBackgroundColor(-1000,-1000,-1000,1);
+ mVtkImageReslice->SetResliceTransform(transform);
}
}
//--------------------------------------------------------------------
-
//--------------------------------------------------------------------
vvImage::~vvImage() {
Reset();
}
//--------------------------------------------------------------------
-
//--------------------------------------------------------------------
void vvImage::Reset() {
if (CLITK_EXPERIMENTAL)
}
//--------------------------------------------------------------------
-
//--------------------------------------------------------------------
int vvImage::GetNumberOfSpatialDimensions() {
- int dim=GetNumberOfDimensions();
- if (IsTimeSequence())
- return dim-1;
- else
- return dim;
+ int dim=GetNumberOfDimensions();
+ if (IsTimeSequence())
+ return dim-1;
+ else
+ return dim;
}
//--------------------------------------------------------------------
-
-
+//
//--------------------------------------------------------------------
int vvImage::GetNumberOfDimensions() const {
- if (mVtkImages.size())
+ if (mVtkImages.size())
{
- int dimension = 2;
- int extent[6];
- mVtkImages[0]->GetWholeExtent(extent);
- if (extent[5] - extent[4] >= 1)
- dimension++;
- if (mVtkImages.size() > 1)
- dimension++;
- return dimension;
+ int dimension = 2;
+ int extent[6];
+ mVtkImages[0]->GetWholeExtent(extent);
+ if (extent[5] - extent[4] >= 1)
+ dimension++;
+ if (mVtkImages.size() > 1)
+ dimension++;
+ return dimension;
}
- return 0;
+ return 0;
}
-//--------------------------------------------------------------------
-
-
//--------------------------------------------------------------------
void vvImage::GetScalarRange(double* range)
{
- assert(mVtkImages.size());
- double * temp = mVtkImages[0]->GetScalarRange();
- range[0]=temp[0];range[1]=temp[1];
- for (unsigned int i=1;i<mVtkImages.size();i++)
+ assert(mVtkImages.size());
+ double * temp = mVtkImages[0]->GetScalarRange();
+ range[0]=temp[0];range[1]=temp[1];
+ for (unsigned int i=1;i<mVtkImages.size();i++)
{
- temp = mVtkImages[i]->GetScalarRange();
- if (temp[0] < range[0]) range[0]=temp[0];
- if (temp[1] > range[1]) range[1]=temp[1];
+ temp = mVtkImages[i]->GetScalarRange();
+ if (temp[0] < range[0]) range[0]=temp[0];
+ if (temp[1] > range[1]) range[1]=temp[1];
}
}
-//--------------------------------------------------------------------
-
//--------------------------------------------------------------------
std::string vvImage::GetScalarTypeAsString() {
- // WARNING VTK pixel type different from ITK Pixel type
- std::string vtktype = mVtkImages[0]->GetScalarTypeAsString();
- if (vtktype == "unsigned char") return "unsigned_char";
- if (vtktype == "unsigned short") return "unsigned_short";
- if (vtktype == "unsigned int") return "unsigned_int";
- return vtktype;
+ return mVtkImages[0]->GetScalarTypeAsString();
}
//--------------------------------------------------------------------
-
//--------------------------------------------------------------------
int vvImage::GetNumberOfScalarComponents() {
- return mVtkImages[0]->GetNumberOfScalarComponents();
+ return mVtkImages[0]->GetNumberOfScalarComponents();
}
//--------------------------------------------------------------------
-
//--------------------------------------------------------------------
int vvImage::GetScalarSize() {
- return mVtkImages[0]->GetScalarSize();
+ return mVtkImages[0]->GetScalarSize();
}
//--------------------------------------------------------------------
-
//--------------------------------------------------------------------
std::vector<double> vvImage::GetSpacing() {
- std::vector<double> spacing;
- int dim = this->GetNumberOfDimensions();
- for (int i = 0; i < dim; i++)
+ std::vector<double> spacing;
+ int dim = this->GetNumberOfDimensions();
+ for (int i = 0; i < dim; i++)
{
+ if (i == 3)
+ spacing.push_back(1);
+ else
+ spacing.push_back(mVtkImages[0]->GetSpacing()[i]);
if (i == 3)
spacing.push_back(mTimeSpacing);
else
spacing.push_back(mVtkImages[0]->GetSpacing()[i]);
}
- return spacing;
+ return spacing;
}
//--------------------------------------------------------------------
-
//--------------------------------------------------------------------
std::vector<double> vvImage::GetOrigin() const {
- std::vector<double> origin;
- int dim = this->GetNumberOfDimensions();
- for (int i = 0; i < dim; i++)
+ std::vector<double> origin;
+ int dim = this->GetNumberOfDimensions();
+ for (int i = 0; i < dim; i++)
{
+ if (i == 3)
+ origin.push_back(0);
+ else
+ origin.push_back(mVtkImages[0]->GetOrigin()[i]);
if (i == 3)
origin.push_back(mTimeOrigin);
else
origin.push_back(mVtkImages[0]->GetOrigin()[i]);
}
- return origin;
+ return origin;
}
//--------------------------------------------------------------------
-
//--------------------------------------------------------------------
std::vector<int> vvImage::GetSize() {
- std::vector<int> size0;
- int dim = this->GetNumberOfDimensions();
- for (int i = 0; i < dim; i++)
+ std::vector<int> size0;
+ int dim = this->GetNumberOfDimensions();
+ for (int i = 0; i < dim; i++)
{
- if (i == 3)
- size0.push_back(mVtkImages.size());
- else
- size0.push_back(mVtkImages[0]->GetDimensions()[i]);
+ if (i == 3)
+ size0.push_back(mVtkImages.size());
+ else
+ size0.push_back(mVtkImages[0]->GetDimensions()[i]);
}
- return size0;
+ return size0;
}
//--------------------------------------------------------------------
-
//--------------------------------------------------------------------
unsigned long vvImage::GetActualMemorySize() {
- unsigned long size = 0;
- for (unsigned int i = 0; i < mVtkImages.size(); i++) {
- size += mVtkImages[i]->GetActualMemorySize();
- }
- return size;
+ unsigned long size = 0;
+ for (unsigned int i = 0; i < mVtkImages.size(); i++) {
+ size += mVtkImages[i]->GetActualMemorySize();
+ }
+ return size;
}
//--------------------------------------------------------------------
}
//--------------------------------------------------------------------
-
//--------------------------------------------------------------------
bool vvImage::IsScalarTypeInteger(int t) {
if ((t == VTK_BIT) ||
return false;
}
}
+
+//--------------------------------------------------------------------
+
+//--------------------------------------------------------------------
+
+void vvImage::SetVTKImageReslice(vtkImageReslice* reslice) {
+ mVtkImageReslice=reslice;
+
+}
+//--------------------------------------------------------------------
+
+//--------------------------------------------------------------------
+vtkAbstractTransform * vvImage::GetTransform()
+{
+ return mVtkImageReslice->GetResliceTransform();
+}
//--------------------------------------------------------------------
+//-------------------------------------------------------------------
+void vvImage::SetRotateX(int xvalue)
+{
+ transform->PostMultiply();
+ transform->Translate(-origin[0],-origin[1],-origin[2]);
+ transform->RotateX(xvalue);
+ transform->Translate(origin[0],origin[1],origin[2]);
+ mVtkImageReslice->Update();
+}
+
+//--------------------------------------------------------------------
+
+//-------------------------------------------------------------------
+void vvImage::SetRotateY(int yvalue)
+{
+ transform->PostMultiply();
+ transform->Translate(-origin[0],-origin[1],-origin[2]);
+ transform->RotateY(yvalue);
+ transform->Translate(origin[0],origin[1],origin[2]);
+ mVtkImageReslice->Update();
+}
+//--------------------------------------------------------------------
+
+//-------------------------------------------------------------------
+void vvImage::SetRotateZ(int zvalue)
+{
+ transform->PostMultiply();
+ transform->Translate(-origin[0],-origin[1],-origin[2]);
+ transform->RotateZ(zvalue);
+ transform->Translate(origin[0],origin[1],origin[2]);
+ mVtkImageReslice->Update();
+}
+//--------------------------------------------------------------------
+
+//-------------------------------------------------------------------
+void vvImage::SetTranslationX(int xvalue)
+{
+ transform->Translate(xvalue,0,0);
+ mVtkImageReslice->Update();
+}
+//--------------------------------------------------------------------
+
+//-------------------------------------------------------------------
+
+void vvImage::SetTranslationY(int yvalue)
+{
+ transform->Translate(0,yvalue,0);
+ mVtkImageReslice->Update();
+}
+//--------------------------------------------------------------------
+
+//-------------------------------------------------------------------
+void vvImage::SetTranslationZ(int zvalue)
+{
+ transform->Translate(0,0,zvalue);
+ mVtkImageReslice->Update();
+}
+//-------------------------------------------------------------------
+
+//-------------------------------------------------------------------
+void vvImage::SetOrigin(double value[3])
+{
+ origin=new double[mVtkImageReslice->GetOutputDimensionality()];
+ origin[0]=value[0];
+ origin[1]=value[1];
+ origin[2]=value[2];
+}
//--------------------------------------------------------------------
void vvImage::SetTransform(vtkAbstractTransform *transform)
class vtkImageData;
class vtkImageReslice;
+class vtkTransform;
+class vtkImageReslice;
class vtkAbstractTransform;
class vvImage : public itk::LightObject {
bool IsTimeSequence();
bool IsScalarTypeInteger();
bool IsScalarTypeInteger(int t);
+ vtkAbstractTransform * GetTransform();
+ void SetTransform(vtkAbstractTransform *transform);
+ vtkImageReslice* GetVTKImageReslice();
+ void SetVTKImageReslice(vtkImageReslice *reslice);
+
+ void SetRotateX(int xvalue);
+ void SetRotateY(int yvalue);
+ void SetRotateZ(int zvalue);
+
+ void SetTranslationX(int xvalue);
+ void SetTranslationY(int yvalue);
+ void SetTranslationZ(int zvalue);
+ void SetOrigin(double value[3]);
+ private:
void SetTimeSpacing(double s) { mTimeSpacing = s; }
void SetTimeOrigin(double o) { mTimeOrigin = o; }
- void SetTransform(vtkAbstractTransform *transform);
-private:
+ private:
vvImage();
~vvImage();
std::vector<vtkImageData*> mVtkImages;
+ vtkSmartPointer<vtkImageReslice> mVtkImageReslice;
+ vtkSmartPointer<vtkTransform> transform;
double mTimeOrigin;
double mTimeSpacing;
- vtkSmartPointer<vtkImageReslice> mVtkImageReslice;
+ double * origin;
};
#endif
SET(clitkFilters_SRC
clitkGuerreroVentilationGenericFilter.cxx
- clitkImageArithm_ggo.c
- clitkImageArithmGenericFilter.cxx
+ #clitkBinarizeImage_ggo.c
+ #clitkImageArithmGenericFilter.cxx
clitkImageConvertGenericFilter.cxx
clitkImageFillRegionGenericFilter.cxx
clitkImageResampleGenericFilter.cxx
clitkSplitImageGenericFilter.cxx
clitkVFResampleGenericFilter.cxx
+ clitkBinarizeImageGenericFilter.cxx
+ clitkImageArithmGenericFilter.cxx
+ clitkMedianImageGenericFilter.cxx
+ # clitkMedianImageFilter_ggo.c
# clitkBinarizeImageGenericFilter.cxx
clitkBinarizeImage_ggo.c
# clitkMedianImageGenericFilter.cxx
clitkMedianImageFilter_ggo.c
clitkUnsharpMask_ggo.c
clitkFooImage_ggo.c
+ clitkImageArithm_ggo.c
)
ADD_LIBRARY(clitkFilters STATIC ${clitkFilters_SRC})
#include "itkBinaryThresholdImageFilter.h"
#include "itkMaskImageFilter.h"
#include "itkMaskNegatedImageFilter.h"
+
#include <clitkCommon.h>
// #include <tiff.h>
// DD(mArgsInfo.bg_given);
// DD(mArgsInfo.mode_arg);
-// <<<<<<< clitkBinarizeImageGenericFilter.txx
// DD(mArgsInfo.useFG_flag);
// DD(mArgsInfo.useBG_flag);
-#ifndef clitkMedianImageGenericFilter_txx
+ #ifndef clitkMedianImageGenericFilter_txx
#define clitkMedianImageGenericFilter_txx
/* =================================================
TARGET_LINK_LIBRARIES(clitkGuerreroVentilation clitkCommon ITKIO ITKBasicFilters
clitkFilters)
-ADD_EXECUTABLE(clitkImageArithm clitkImageArithm.cxx)
+ADD_EXECUTABLE(clitkImageArithm clitkImageArithm.cxx clitkImageArithm_ggo.c )
TARGET_LINK_LIBRARIES(clitkImageArithm clitkCommon ITKIO ITKStatistics clitkFilters)
ADD_EXECUTABLE(clitkUnsharpMask clitkUnsharpMask.cxx)
ADD_EXECUTABLE(clitkFooImage clitkFooImage.cxx)
TARGET_LINK_LIBRARIES(clitkFooImage clitkCommon ITKIO clitkFilters)
-ADD_EXECUTABLE(clitkBinarizeImage clitkBinarizeImage.cxx)
+ADD_EXECUTABLE(clitkBinarizeImage clitkBinarizeImage.cxx clitkBinarizeImage_ggo.c)
TARGET_LINK_LIBRARIES(clitkBinarizeImage clitkCommon ITKIO clitkFilters)
-ADD_EXECUTABLE(clitkMedianImageFilter clitkMedianImageFilter.cxx)
+ADD_EXECUTABLE(clitkMedianImageFilter clitkMedianImageFilter.cxx clitkMedianImageFilter_ggo.c)
TARGET_LINK_LIBRARIES(clitkMedianImageFilter clitkCommon ITKIO clitkFilters ITKBasicFilters)
vvToolCreatorBase.cxx
vvToolWidgetBase.cxx
vvToolMedianFilter.cxx
+ vvToolRigidReg.cxx
# vvToolFoo.cxx
# vvToolFooWithWidgetBase.cxx
vvToolCropImage.cxx
# vvToolFoo.h
# vvToolFooWithWidgetBase.h
vvToolMedianFilter.h
+ vvToolRigidReg.h
vvToolBinarize.h
vvToolSimpleInputSelectorWidget.h
vvToolInputSelectorWidget.h
qt_ui/vvToolInputSelectorWidget.ui
qt_ui/vvToolWidgetBase.ui
qt_ui/vvToolMedianFilter.ui
+ qt_ui/vvToolRigidReg.ui
# qt_ui/vvToolFoo.ui
qt_ui/vvToolCropImage.ui
qt_ui/vvToolBinarize.ui
<rect>
<x>0</x>
<y>0</y>
- <width>735</width>
- <height>290</height>
+ <width>400</width>
+ <height>300</height>
</rect>
</property>
<property name="windowTitle">
- <string>Mean Filter</string>
+ <string>Form</string>
</property>
- <layout class="QVBoxLayout" name="verticalLayout_3">
+ <layout class="QVBoxLayout" name="verticalLayout_5">
<item>
- <layout class="QHBoxLayout" name="horizontalLayout_9">
+ <layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label">
<property name="text">
</widget>
</item>
<item>
- <widget class="QLineEdit" name="lineEdit"/>
- </item>
- <item>
- <layout class="QGridLayout" name="gridLayout_12"/>
+ <widget class="QSpinBox" name="spinBox"/>
</item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
</widget>
</item>
<item>
- <widget class="QSlider" name="horizontalSlider_2">
+ <widget class="QSlider" name="horizontalSlider_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
- <widget class="QLineEdit" name="lineEdit_2"/>
- </item>
- <item>
- <layout class="QVBoxLayout" name="verticalLayout_7"/>
+ <widget class="QSpinBox" name="spinBox_3"/>
</item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
</widget>
</item>
<item>
- <widget class="QSlider" name="horizontalSlider_3">
+ <widget class="QSlider" name="horizontalSlider_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
- <widget class="QLineEdit" name="lineEdit_3"/>
+ <widget class="QSpinBox" name="spinBox_2"/>
</item>
</layout>
</item>
Q_INIT_RESOURCE(vvIcons);
//QPixmap pixmap(":/splashscreen.PNG");
QSplashScreen *splash = new QSplashScreen(QPixmap(QString::fromUtf8(":/new/prefix1/splashscreen.PNG")));
- /*splash->showMessage("VV 1.0 developped by Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr and CREATIS-LRMN http://www.creatis.insa-lyon.fr",(Qt::AlignRight | Qt::AlignBottom));*/
+ /*splash->showMessage("VV 1.0 developped by Léon Bérard c`ancer center http://oncora1.lyon.fnclcc.fr and CREATIS-LRMN http://www.creatis.insa-lyon.fr",(Qt::AlignRight | Qt::AlignBottom));*/
// splash->show();
QTimer::singleShot(2000, splash, SLOT(close()));
while (!splash->isHidden())
<file>icons/player_play.png</file>
<file>icons/player_pause.png</file>
<file>icons/ducky.png</file>
+ <file>icons/register.png</file>
<file>icons/exit.png</file>
<file>icons/rotateright.png</file>
<file>icons/adjustsize.png</file>
msgBox.addButton(tr("Cancel"), QMessageBox::RejectRole);
if (msgBox.exec() == QMessageBox::AcceptRole)
{
- this->close();
+ this->close();
}
}
else
//------------------------------------------------------------------------------
void vvMainWindow::AddOverlayImage(int index, QString file) {
+
mInputPathName = itksys::SystemTools::GetFilenamePath(file.toStdString()).c_str();
itk::ImageIOBase::Pointer reader = itk::ImageIOFactory::CreateImageIO(
file.toStdString().c_str(), itk::ImageIOFactory::ReadMode);
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
vvProgressDialog progress("Opening " + file.toStdString());
qApp->processEvents();
-
+
std::string filename = itksys::SystemTools::GetFilenameWithoutExtension(file.toStdString()).c_str();
if (mSlicerManagers[index]->SetOverlay(file.toStdString(),dimension, component))
{
{
item->setData(j,Qt::CheckStateRole,DataTree->topLevelItem(index)->data(j,Qt::CheckStateRole));
mSlicerManagers[index]->GetSlicer(j-1)->SetActorVisibility("overlay",0,
- DataTree->topLevelItem(index)->data(j,Qt::CheckStateRole).toInt());
+ DataTree->topLevelItem(index)->data(j,Qt::CheckStateRole).toInt());
}
//Create the buttons for reload and close
#include <vtkCutter.h>
#include <vtkAssignAttribute.h>
#include <vtkImageAccumulate.h>
+#include <vtkImageReslice.h>
vtkCxxRevisionMacro(vvSlicer, "DummyRevision");
vtkStandardNewMacro(vvSlicer);
this->WindowLevel->Delete();
this->WindowLevel = vvImageMapToWLColors::New();
this->InstallPipeline();
+
}
//------------------------------------------------------------------------------
//----------------------------------------------------------------------------
+
+
+
+
+
class vtkCutter;
class vtkAssignAttribute;
class vtkScalarBarActor;
-
+class vtkTransform;
+class vtkImageReslice;
class vvSlicer: public vtkImageViewer2
{
vtkImageMapToWindowLevelColors* GetFusionMapper() ;
vtkImageActor* GetFusionActor() ;
vtkActor* GetVFActor() ;
- vtkCornerAnnotation* GetAnnotation() ;
-
+ vtkCornerAnnotation* GetAnnotation();
+
void SetFusion(vvImage::Pointer inputFusion);
vvImage::Pointer GetFusion() {
return mFusion;
vtkSmartPointer<vtkActor> mLandActor;
vtkSmartPointer<vtkBox> mClipBox;
vtkSmartPointer<vtkScalarBarActor> legend;
-
std::vector<vvMeshActor*> mSurfaceCutActors;
int mCurrentTSlice;
-/*=========================================================================
+ /*=========================================================================
Program: vv http://www.creatis.insa-lyon.fr/rio/vv
Authors belong to:
void vvSlicerManager::VerticalSliderHasChanged(int slicer, int slice) {
emit AVerticalSliderHasChanged(slicer, slice);
}
+
//----------------------------------------------------------------------------
#include <vtkAssemblyPath.h>
#include <vtkCornerAnnotation.h>
#include <vtkRenderWindow.h>
-
+#include <vvImage.h>
+#include <vtkImageReslice.h>
#include "vvSlicer.h"
#include "vvInteractorStyleNavigator.h"
+#include "vtkTransform.h"
#include <cmath>
if (VisibleInWindow>-1)
renderer=this->SM->GetSlicer(VisibleInWindow)->GetRenderer();
newLandmark = false;
+
+
if (event == vtkCommand::StartPickEvent && VisibleInWindow == -1)
{
this->SM->UpdateSliceRange(VisibleInWindow);
this->SM->UpdateInfoOnCursorPosition(VisibleInWindow);
}
+
}
//All type of mouse events
private:
+
int FindSlicerNumber(vtkRenderWindow* renwin);
double InitialWindow;
Program: vv
Module: $RCSfile: vvToolMedianFilter.cxx,v $
Language: C++
- Date: $Date: 2010/04/09 09:53:27 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2010/04/26 18:21:55 $
+ Version: $Revision: 1.2 $
Author : Bharath Navalpakkam (Bharath.Navalpakkam@creatis.insa-lyon.fr)
Copyright (C) 2010
:vvToolWidgetBase(parent,f),
vvToolBase<vvToolMedianFilter>(parent),
Ui::vvToolMedianFilter()
- {
+ {
// Setup the UI
vvToolMedianFilter::~vvToolMedianFilter() {
}
//------------------------------------------------------------------------------
-
-
-
void vvToolMedianFilter::Initialize() {
SetToolName("MedianFilter");
SetToolMenuName("MedianFilter");
- SetToolIconFilename(":/new/prefix1/icons/ducky.png");
+ SetToolIconFilename(":common/icons/ducky.png");
SetToolTip("Make 'MedianFilter' on an image.");
}
//------------------------------------------------------------------------------
void vvToolMedianFilter::apply() {
GetArgsInfoFromGUI();
-
if (!mCurrentSlicerManager) close();
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
// Main filter
clitk::MedianImageGenericFilter<args_info_clitkMedianImageFilter>::Pointer filter =
clitk::MedianImageGenericFilter<args_info_clitkMedianImageFilter>::New();
-
-
filter->SetInputVVImage(mCurrentImage);
- filter->SetArgsInfo(mArgsInfo);
-
- filter->EnableReadOnDisk(false);
- filter->Update();
-
-
+ filter->SetArgsInfo(mArgsInfo);
+ filter->EnableReadOnDisk(false);
+ filter->Update();
// Output
vvImage::Pointer output = filter->GetOutputVVImage();
std::ostringstream osstream;
AddImage(output,osstream.str());
QApplication::restoreOverrideCursor();
close();
-
-
}
-
//------------------------------------------------------------------------------
-
void vvToolMedianFilter::GetArgsInfoFromGUI() {
-
/* //KEEP THIS FOR READING GGO FROM FILE
int argc=1;
std::string a = "toto";
int good = cmdline_parser_ext(argc, argv, &args_info, &p);
DD(good);
*/
- mArgsInfo.radius_given=0;
- mArgsInfo.verbose_flag = false;
+ mArgsInfo.radius_given=0;
+ mArgsInfo.verbose_flag = false;
// mArgsInfo.radius_arg = new int[3];
-
// Required (even if not used)
mArgsInfo.input_given = 0;
mArgsInfo.output_given = 0;
-
mArgsInfo.input_arg=new char;
mArgsInfo.output_arg = new char;
-
-
- mArgsInfo.config_given=0;
- mArgsInfo.verbose_given=0;
-
-
- // mArgsInfo.radius_arg[0]=1;
- // mArgsInfo.radius_arg[1]=1;
- // mArgsInfo.radius_arg[2]=1;
-
+ mArgsInfo.config_given=0;
+ mArgsInfo.verbose_given=0;
}
//------------------------------------------------------------------------------
void vvToolMedianFilter::InputIsSelected(vvSlicerManager *m){
mCurrentSlicerManager =m;
// Specific for this gui
-
- mArgsInfo.radius_arg = new int[3];
- connect(horizontalSlider, SIGNAL(valueChanged(int)), this, SLOT(UpdatevalueH1()));
- connect(horizontalSlider_2, SIGNAL(valueChanged(int)), this, SLOT(UpdatevalueH2()));
- connect(horizontalSlider_3, SIGNAL(valueChanged(int)), this, SLOT(UpdatevalueH3()));
-
-
-
+ mArgsInfo.radius_arg = new int[3];
+ int checkdimensions=mCurrentSlicerManager->GetDimension();
+ if(checkdimensions<3)
+ {
+ horizontalSlider_3->hide();
+ spinBox_3->hide();
+ mArgsInfo.radius_arg[2]=0;
+ connect(horizontalSlider, SIGNAL(valueChanged(int)), this, SLOT(UpdateH1slider()));
+ connect(horizontalSlider_2, SIGNAL(valueChanged(int)), this, SLOT(UpdateH2slider()));
+ }
+ else
+ {
+ horizontalSlider->show();
+ horizontalSlider_2->show();
+ horizontalSlider_3->show();
+ connect(horizontalSlider, SIGNAL(valueChanged(int)), this, SLOT(UpdateH1slider()));
+ connect(horizontalSlider_2, SIGNAL(valueChanged(int)), this, SLOT(UpdateH2slider()));
+ connect(horizontalSlider_3, SIGNAL(valueChanged(int)), this, SLOT(UpdateH3slider()));
+ }
}
- //-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
-void vvToolMedianFilter::UpdatevalueH1()
+void vvToolMedianFilter::UpdateH1slider()
{
+
mArgsInfo.radius_arg[0]=horizontalSlider->value();
- QString string1 = QString::number(mArgsInfo.radius_arg[0]);
- lineEdit->setText(string1);
+ spinBox->setValue(mArgsInfo.radius_arg[0]);
}
-void vvToolMedianFilter::UpdatevalueH2()
+void vvToolMedianFilter::UpdateH2slider()
{
- mArgsInfo.radius_arg[1]=horizontalSlider_2->value();
- QString string2 = QString::number(mArgsInfo.radius_arg[1]);
- lineEdit_2->setText(string2);
+ mArgsInfo.radius_arg[1]=horizontalSlider_2->value();
+ spinBox_2->setValue(mArgsInfo.radius_arg[1]);
}
-void vvToolMedianFilter::UpdatevalueH3()
+void vvToolMedianFilter::UpdateH3slider()
{
mArgsInfo.radius_arg[2]=horizontalSlider_3->value();
- QString string3 = QString::number(mArgsInfo.radius_arg[2]);
- lineEdit_3->setText(string3);
-
+ spinBox_3->setValue(mArgsInfo.radius_arg[2]);
}
Program: vv
Module: $RCSfile: vvToolMedianFilter.h,v $
Language: C++
- Date: $Date: 2010/04/09 09:53:50 $
- Version: $Revision: 1.1 $
+ Date: $Date: 2010/04/26 18:21:55 $
+ Version: $Revision: 1.2 $
Author : Bharath Navalpakkam (Bharath.Navalpakkam@creatis.insa-lyon.fr)
Copyright (C) 2010
#include <QtDesigner/QDesignerExportWidget>
#include "vvToolBase.h"
- #include "QDialog"
+ #include "QWidget"
#include "vvToolWidgetBase.h"
#include "ui_vvToolMedianFilter.h"
#include "clitkMedianImageFilter_ggo.h"
public slots:
- void UpdatevalueH1();
- void UpdatevalueH2();
- void UpdatevalueH3();
-
-
-
-
-
+ void UpdateH1slider();
+ void UpdateH2slider();
+ void UpdateH3slider();
protected:
Ui::vvToolMedianFilter ui;