]> Creatis software - clitk.git/commitdiff
Added Manual Registration Tool with updated Median Filter tool
authorbharath <bharath>
Mon, 26 Apr 2010 18:21:49 +0000 (18:21 +0000)
committerbharath <bharath>
Mon, 26 Apr 2010 18:21:49 +0000 (18:21 +0000)
18 files changed:
common/vvImage.cxx
common/vvImage.h
filters/CMakeLists.txt
filters/clitkBinarizeImageGenericFilter.txx
filters/clitkMedianImageGenericFilter.txx
tools/CMakeLists.txt
vv/CMakeLists.txt
vv/qt_ui/vvToolMedianFilter.ui
vv/vv.cxx
vv/vvIcons.qrc
vv/vvMainWindow.cxx
vv/vvSlicer.cxx
vv/vvSlicer.h
vv/vvSlicerManager.cxx
vv/vvSlicerManagerCommand.cxx
vv/vvSlicerManagerCommand.h
vv/vvToolMedianFilter.cxx
vv/vvToolMedianFilter.h

index cb73874aa2a3d815a158a62eca498f5f6380c6e8..2a47a99d6463989ff9157009aa6057f87f509b0a 100644 (file)
 #define VVIMAGE_CXX
 #include "vvImage.h"
 #include "clitkCommon.h"
-
+#include <vtkTransform.h>
 #include <vtkImageData.h>
 #include <vtkImageReslice.h>
-
 #include <cassert>
 
 //--------------------------------------------------------------------
 vvImage::vvImage() {
-    Init();
+  Init();
 }
 //--------------------------------------------------------------------
 
@@ -36,23 +35,25 @@ vvImage::vvImage() {
 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)
@@ -91,133 +92,123 @@ void vvImage::AddImage(vtkImageData* image) {
 }
 //--------------------------------------------------------------------
 
-
 //--------------------------------------------------------------------
 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;
 }
 //--------------------------------------------------------------------
 
@@ -251,7 +242,6 @@ bool vvImage::IsScalarTypeInteger() {
 }
 //--------------------------------------------------------------------
 
-
 //--------------------------------------------------------------------
 bool vvImage::IsScalarTypeInteger(int t) {
   if ((t == VTK_BIT) ||
@@ -269,8 +259,91 @@ bool vvImage::IsScalarTypeInteger(int t) {
     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)
index a0ab108b95e16a323f691b88ef87cd33ec5ef22f..106189f2310aea4b142d22d474efa2bac5243557 100644 (file)
@@ -25,6 +25,8 @@
 
 class vtkImageData;
 class vtkImageReslice;
+class vtkTransform;
+class vtkImageReslice;
 class vtkAbstractTransform;
 
 class vvImage : public itk::LightObject {
@@ -55,18 +57,33 @@ public :
   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
index e6258cecd79de57d9488b4d6f5bd5782134c9b0d..3c024ad8cff77f68dbcca548a72c1dc50505f8dd 100644 (file)
@@ -6,19 +6,24 @@ INCLUDE(../cmake/common.cmake)
 
 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})
index a35a7304c802c4e5e63b2e6418af4a74afdbcf5f..cdf09619d4ee30dc4d8de2af4cbc57ab65fa9ed8 100644 (file)
@@ -23,6 +23,7 @@
 #include "itkBinaryThresholdImageFilter.h"
 #include "itkMaskImageFilter.h"
 #include "itkMaskNegatedImageFilter.h"
+
 #include <clitkCommon.h>
 // #include <tiff.h>
 
@@ -100,7 +101,6 @@ namespace clitk
     // DD(mArgsInfo.bg_given);
     // DD(mArgsInfo.mode_arg);
 
-// <<<<<<< clitkBinarizeImageGenericFilter.txx
 //     DD(mArgsInfo.useFG_flag);
 //     DD(mArgsInfo.useBG_flag);
 
index 94842b3c3124c9414f554790b251f45a85fde7ea..292997b9136119302c06a21678a3b6b1063c9523 100644 (file)
@@ -1,4 +1,4 @@
-#ifndef clitkMedianImageGenericFilter_txx
+ #ifndef clitkMedianImageGenericFilter_txx
 #define clitkMedianImageGenericFilter_txx
 
 /* =================================================
index becacb255090aa6f3cc1fb7171882198b9509776..6acef2c94aacfff680821efa86011108739fd4fc 100644 (file)
@@ -69,7 +69,7 @@ ADD_EXECUTABLE(clitkGuerreroVentilation clitkGuerreroVentilation.cxx
 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)
@@ -78,8 +78,8 @@ TARGET_LINK_LIBRARIES(clitkUnsharpMask clitkCommon ITKIO clitkFilters)
 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)
index 1094b6cda6b8084f6ceb5136c221910973f72d66..6c7f8fe2205baa40097fbce84d68bfc77c355070 100644 (file)
@@ -103,6 +103,7 @@ SET(vv_SRCS
   vvToolCreatorBase.cxx
   vvToolWidgetBase.cxx
   vvToolMedianFilter.cxx
+  vvToolRigidReg.cxx
 #  vvToolFoo.cxx
 #  vvToolFooWithWidgetBase.cxx
   vvToolCropImage.cxx
@@ -141,6 +142,7 @@ QT4_WRAP_CPP(vv_SRCS
 #  vvToolFoo.h
 #  vvToolFooWithWidgetBase.h
   vvToolMedianFilter.h
+  vvToolRigidReg.h
   vvToolBinarize.h
   vvToolSimpleInputSelectorWidget.h
   vvToolInputSelectorWidget.h
@@ -174,6 +176,7 @@ QT4_WRAP_UI(vv_UI_CXX
   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
index fe31b04a41450920996bd3d7a9e70f7bf21de7cc..f82a6465991df2e9cd6db6b5da127932fdbf5751 100644 (file)
@@ -6,16 +6,16 @@
    <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>
index 73e7792c8f2eb6bfdc44885889562e23bc883f2c..7d4097219def136d98eab79d950c87489a98871f 100644 (file)
--- a/vv/vv.cxx
+++ b/vv/vv.cxx
@@ -41,7 +41,7 @@ int main( int argc, char** argv )
     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())
index 9f7c8956f17c30a2d4edb3f6d6759ce784d5e802..b3c230f74ceedfa3dbdd999b77b2b89f692af2c7 100644 (file)
@@ -28,6 +28,7 @@
     <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>
index abf38e98fe2d55f4533cef82e3c58a7922948ad9..a35922f342a414613cf16e48a9c8abae17c422cc 100644 (file)
@@ -1545,7 +1545,7 @@ void vvMainWindow::CloseImage(QTreeWidgetItem* item, int column) {
       msgBox.addButton(tr("Cancel"), QMessageBox::RejectRole);
       if (msgBox.exec() == QMessageBox::AcceptRole)
         {
-          this->close();
+         this->close();
         }
     }
   else
@@ -1904,6 +1904,7 @@ void vvMainWindow::SelectOverlayImage() {
 
 //------------------------------------------------------------------------------
 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);
@@ -1914,7 +1915,7 @@ void vvMainWindow::AddOverlayImage(int index, QString file) {
   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))
     {
@@ -1929,7 +1930,7 @@ void vvMainWindow::AddOverlayImage(int index, QString file) {
         {
           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
index af609a74842f95a3d61f943bd636fd21d0c60e73..256981fba78528394cb9f21b67828f7efefc94f8 100644 (file)
@@ -64,6 +64,7 @@
 #include <vtkCutter.h>
 #include <vtkAssignAttribute.h>
 #include <vtkImageAccumulate.h>
+#include <vtkImageReslice.h>
 
 vtkCxxRevisionMacro(vvSlicer, "DummyRevision");
 vtkStandardNewMacro(vvSlicer);
@@ -140,6 +141,7 @@ vvSlicer::vvSlicer()
   this->WindowLevel->Delete();
   this->WindowLevel = vvImageMapToWLColors::New();
   this->InstallPipeline();
+  
 }
 //------------------------------------------------------------------------------
 
@@ -1414,3 +1416,8 @@ void vvSlicer::PrintSelf(ostream& os, vtkIndent indent)
 //----------------------------------------------------------------------------
 
 
+   
+   
+
+
+
index 4315dd8b35ff640a23eec53df309cb7f506c3af9..3a05a16d1df13b8c6bf3ec74521cdabd0ed0e0db 100644 (file)
@@ -46,7 +46,8 @@ class vtkCursor3D;
 class vtkCutter;
 class vtkAssignAttribute;
 class vtkScalarBarActor;
-
+class vtkTransform;
+class vtkImageReslice;
 
 class vvSlicer: public vtkImageViewer2
 {
@@ -70,8 +71,8 @@ public:
     vtkImageMapToWindowLevelColors* GetFusionMapper() ;
     vtkImageActor* GetFusionActor() ;
     vtkActor* GetVFActor() ;
-    vtkCornerAnnotation* GetAnnotation() ;
-
+    vtkCornerAnnotation* GetAnnotation();
+    
     void SetFusion(vvImage::Pointer inputFusion);
     vvImage::Pointer GetFusion() {
         return mFusion;
@@ -197,7 +198,6 @@ protected:
     vtkSmartPointer<vtkActor> mLandActor;
     vtkSmartPointer<vtkBox> mClipBox;
     vtkSmartPointer<vtkScalarBarActor> legend;
-
     std::vector<vvMeshActor*> mSurfaceCutActors;
 
     int mCurrentTSlice;
index b14bfde693bcf18a05756413f3c8e98d5f10e1e5..344fa73b7e8008e709fbde8beea1cb06056b61c5 100644 (file)
@@ -1,4 +1,4 @@
-/*=========================================================================
+  /*=========================================================================
   Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
 
   Authors belong to: 
@@ -1265,4 +1265,5 @@ void vvSlicerManager::NextImage(int slicer)
 void vvSlicerManager::VerticalSliderHasChanged(int slicer, int slice) {
   emit AVerticalSliderHasChanged(slicer, slice);
 }
+    
 //----------------------------------------------------------------------------
index 0415c9e8934fe6b98fe6848b37e8ef01445c2776..5b35bdd826e9eb94797518a8fcd5f565a9e949bb 100644 (file)
 #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>
 
@@ -80,6 +82,8 @@ void vvSlicerManagerCommand::Execute(vtkObject *caller,
         if (VisibleInWindow>-1)
             renderer=this->SM->GetSlicer(VisibleInWindow)->GetRenderer();
         newLandmark = false;
+       
+
 
         if (event == vtkCommand::StartPickEvent && VisibleInWindow == -1)
         {
@@ -283,6 +287,7 @@ void vvSlicerManagerCommand::Execute(vtkObject *caller,
                     this->SM->UpdateSliceRange(VisibleInWindow);
                     this->SM->UpdateInfoOnCursorPosition(VisibleInWindow);
                 }
+                
             }
 
             //All type of mouse events
index 12aedcc5e659f9db94d70d2f46eb7d2b62b7b90c..7a5b49292d70b15de41988a10cb6b207339fa63d 100644 (file)
@@ -54,6 +54,7 @@ protected :
 
 private:
 
+  
     int FindSlicerNumber(vtkRenderWindow* renwin);
 
     double InitialWindow;
index 0d698557a9a0c88e2b420bf37ea5ebd516aecad4..c4f8029bb57fd14f5368b568f8b710ea08c55ee5 100644 (file)
@@ -3,8 +3,8 @@
       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
@@ -42,7 +42,7 @@
       :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]);
 }
index c569a19011eb33da8f3eff1e80329fa46f828944..c4f8629ae77de98e1e7d3fffa7504e94ea330d09 100644 (file)
@@ -3,8 +3,8 @@
     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
@@ -30,7 +30,7 @@
 
   #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;