]> Creatis software - clitk.git/commitdiff
Merge branch 'master' of tux.creatis.insa-lyon.fr:clitk
authorVivien Delmon <vivien.delmon@creatis.insa-lyon.fr>
Wed, 31 Oct 2012 10:11:10 +0000 (11:11 +0100)
committerVivien Delmon <vivien.delmon@creatis.insa-lyon.fr>
Wed, 31 Oct 2012 10:11:10 +0000 (11:11 +0100)
22 files changed:
common/CMakeLists.txt
common/clitkIO.cxx
itk/clitkInvertVFFilter.txx
itk/itkFlexibleBinaryFunctorImageFilter.txx
vv/CMakeLists.txt
vv/vvClipPolyData.cxx [new file with mode: 0644]
vv/vvClipPolyData.h [new file with mode: 0644]
vv/vvImageMapToWLColors.cxx [deleted file]
vv/vvImageMapToWLColors.h [deleted file]
vv/vvLandmarks.cxx
vv/vvLandmarks.h
vv/vvMainWindow.cxx
vv/vvSaveState.cxx
vv/vvSlicer.cxx
vv/vvSlicer.h
vv/vvSlicerManager.cxx
vv/vvThreadedFilter.cxx [deleted file]
vv/vvThreadedFilter.h [deleted file]
vv/vvToolExtractLung.cxx [deleted file]
vv/vvToolExtractLung.h [deleted file]
vv/vvToolExtractPatient.cxx [deleted file]
vv/vvToolExtractPatient.h [deleted file]

index 91f53e5f5dcabe35d3f3011ab3175dfa1a429429..76c19e6802bac93807ac73e3230f93118a6b7b0c 100644 (file)
@@ -39,6 +39,8 @@ IF(CLITK_PRIVATE_FEATURES)
     ${PROJECT_SOURCE_DIR}/private_features/clitkUsfImageIOFactory.cxx
     ${PROJECT_SOURCE_DIR}/private_features/clitkUSVoxImageIO.cxx
     ${PROJECT_SOURCE_DIR}/private_features/clitkUSVoxImageIOFactory.cxx
+    ${PROJECT_SOURCE_DIR}/private_features/clitkSvlImageIO.cxx
+    ${PROJECT_SOURCE_DIR}/private_features/clitkSvlImageIOFactory.cxx
     )
 ENDIF(CLITK_PRIVATE_FEATURES)
 
index cfa8e86ff994fa59492f9d95064a2cf7cc9c4a98..79aa9584cd8489de6645040901c41ddedf9d2d7e 100644 (file)
@@ -37,6 +37,7 @@
 #if CLITK_PRIVATE_FEATURES
   #include "clitkUsfImageIOFactory.h"
   #include "clitkUSVoxImageIOFactory.h"
+  #include "clitkSvlImageIOFactory.h"
 #endif
 
 //--------------------------------------------------------------------
@@ -46,6 +47,7 @@ void clitk::RegisterClitkFactories()
 #if CLITK_PRIVATE_FEATURES
   clitk::UsfImageIOFactory::RegisterOneFactory();
   clitk::USVoxImageIOFactory::RegisterOneFactory();
+  clitk::SvlImageIOFactory::RegisterOneFactory();
 #endif
   clitk::GateAsciiImageIOFactory::RegisterOneFactory();
   clitk::DicomRTDoseIOFactory::RegisterOneFactory();
index b74958fb597a83dc9b3f559936973b340ee6874d..34500a3897e058db1247afc3f1a174526cb5862e 100644 (file)
@@ -123,7 +123,7 @@ void HelperClass1<InputImageType, OutputImageType>::ThreadedGenerateData(const O
 void HelperClass1<InputImageType, OutputImageType>::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, int threadId )
 #endif
 {
-  //std::cout << "HelperClass1::ThreadedGenerateData - IN" << std::endl;
+//   std::cout << "HelperClass1::ThreadedGenerateData - IN " << threadId << std::endl;
   //Get pointer to the input
   typename InputImageType::ConstPointer inputPtr = this->GetInput();
 
@@ -145,6 +145,8 @@ void HelperClass1<InputImageType, OutputImageType>::ThreadedGenerateData(const O
   typedef typename OutputImageType::PixelType DisplacementType;
   DisplacementType displacement;
   inputIt.GoToBegin();
+  
+  typename OutputImageType::SizeType size = outputPtr->GetLargestPossibleRegion().GetSize();
 
   //define some temp variables
   signed long baseIndex[ImageDimension];
@@ -197,10 +199,12 @@ void HelperClass1<InputImageType, OutputImageType>::ThreadedGenerateData(const O
             overlap *= 1.0 - distance[dim];
           }
           upper >>= 1;
+          
+          if (neighIndex[dim] >= size[dim])
+            neighIndex[dim] = size[dim] - 1;
         }
 
 
-
         //Set neighbor value only if overlap is not zero
         if( (overlap>0.0)) // &&
           //                   (static_cast<unsigned int>(neighIndex[0])<size[0]) &&
@@ -243,7 +247,7 @@ void HelperClass1<InputImageType, OutputImageType>::ThreadedGenerateData(const O
     ++inputIt;
   }
 
-  //std::cout << "HelperClass1::ThreadedGenerateData - OUT" << std::endl;
+//   std::cout << "HelperClass1::ThreadedGenerateData - OUT " << threadId << std::endl;
 }
 
 
@@ -328,7 +332,7 @@ template<class InputImageType, class OutputImageType > void HelperClass2<InputIm
 template<class InputImageType, class OutputImageType > void HelperClass2<InputImageType, OutputImageType>::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, int threadId )
 #endif
 {
-  //std::cout << "HelperClass2::ThreadedGenerateData - IN" << std::endl;
+//   std::cout << "HelperClass2::ThreadedGenerateData - IN " << threadId << std::endl;
   
   //Get pointer to the input
   typename InputImageType::ConstPointer inputPtr = this->GetInput();
@@ -380,7 +384,7 @@ template<class InputImageType, class OutputImageType > void HelperClass2<InputIm
 
   }//end while
   
-  //std::cout << "HelperClass2::ThreadedGenerateData - OUT" << std::endl;
+//   std::cout << "HelperClass2::ThreadedGenerateData - OUT " << threadId << std::endl;
   
 }//end member
 
@@ -410,7 +414,7 @@ InvertVFFilter<InputImageType, OutputImageType>::InvertVFFilter()
 //Update
 template <class InputImageType, class OutputImageType> void InvertVFFilter<InputImageType, OutputImageType>::GenerateData()
 {
-  //std::cout << "InvertVFFilter::GenerateData - IN" << std::endl;
+  // std::cout << "InvertVFFilter::GenerateData - IN" << std::endl;
 
   //Get the properties of the input
   typename InputImageType::ConstPointer inputPtr=this->GetInput();
@@ -472,6 +476,7 @@ template <class InputImageType, class OutputImageType> void InvertVFFilter<Input
   typename HelperClass2Type::Pointer helper2=HelperClass2Type::New();
 
   //Set temporary output as input
+  if(m_NumberOfThreadsIsGiven)helper2->SetNumberOfThreads(m_NumberOfThreads);
   helper2->SetInput(temp);
   helper2->SetWeights(weights);
   helper2->SetEdgePaddingValue(m_EdgePaddingValue);
@@ -482,6 +487,8 @@ template <class InputImageType, class OutputImageType> void InvertVFFilter<Input
 
   //Set the output
   this->SetNthOutput(0, helper2->GetOutput());
+  
+  //std::cout << "InvertVFFilter::GenerateData - OUT" << std::endl;
 }
 
 
index f8c7a753a1eeb0572975c7bb85ae493112b598ad..d8258ccf7859bc352ab8517cf5b2efe29a1f521d 100644 (file)
@@ -123,7 +123,7 @@ FlexibleBinaryFunctorImageFilter<TInputImage1, TInputImage2, TOutputImage, TFunc
   typename Input2ImageType::PointType point2;
 
   ImageRegionConstIterator<TInputImage1> inputIt1(inputPtr1, outputRegionForThread);
-  ImageRegionConstIterator<TInputImage2> inputIt2(inputPtr2, outputRegionForThread);
+  ImageRegionConstIterator<TInputImage2> inputIt2(inputPtr2, region2);
 
   ImageRegionIterator<TOutputImage> outputIt(outputPtr, outputRegionForThread);
 
@@ -139,11 +139,12 @@ FlexibleBinaryFunctorImageFilter<TInputImage1, TInputImage2, TOutputImage, TFunc
   outputIt.GoToBegin();
 
   while( !inputIt1.IsAtEnd() ) {
-    
-    if (region2.IsInside(index2))
+    if (region2.IsInside(index2)) {
       outputIt.Set( m_Functor( inputIt1.Get(), inputIt2.Get() ) );
-    else
+    }
+    else {
       outputIt.Set(inputIt1.Get());
+    }
     
     ++inputIt1;
     index1 = inputIt1.GetIndex();
index b77a52c27474b90f8f6aded9b421865d5009c42b..331751b2644a64310efbc92a2aa7a5a9acdd6a05 100644 (file)
@@ -79,6 +79,7 @@ SET(vv_SRCS
   vvSlicer.cxx
   vvLandmarks.cxx
   vvLandmarksGlyph.cxx
+  vvClipPolyData.cxx
   vvGlyphSource.cxx
   vvGlyph2D.cxx
   vvSlicerManager.cxx
@@ -89,8 +90,6 @@ SET(vv_SRCS
   vvMeshActor.cxx
   vvMeshReader.cxx
   vvMidPosition.cxx
-  vvImageMapToWLColors.cxx
-  vvThreadedFilter.cxx
   vvImageContour.cxx
   vvBinaryImageOverlayActor.cxx
   vvStructureSetActor.cxx
@@ -114,7 +113,6 @@ QT4_WRAP_CPP(vv_SRCS
   vvHelpDialog.h  
   vvQDicomSeriesSelector.h 
   vvSlicerManager.h
-  vvThreadedFilter.h
   vvStructureSetActor.h
   vvROIActor.h
   vvToolCreatorBase.h
diff --git a/vv/vvClipPolyData.cxx b/vv/vvClipPolyData.cxx
new file mode 100644 (file)
index 0000000..91f391b
--- /dev/null
@@ -0,0 +1,80 @@
+#include "vvClipPolyData.h"
+
+#include "vtkObjectFactory.h"
+#include "vtkStreamingDemandDrivenPipeline.h"
+#include "vtkInformationVector.h"
+#include "vtkInformation.h"
+#include "vtkDataObject.h"
+#include "vtkSmartPointer.h"
+#include "vtkImplicitFunction.h"
+#include "vtkStringArray.h"
+#include "vtkPointData.h"
+
+
+vtkStandardNewMacro(vvClipPolyData);
+
+vvClipPolyData::vvClipPolyData()
+{
+  this->SetNumberOfInputPorts(1);
+  this->SetNumberOfOutputPorts(1);
+}
+
+vvClipPolyData::~vvClipPolyData()
+{
+
+}
+
+int vvClipPolyData::RequestData(vtkInformation *vtkNotUsed(request),
+                                            vtkInformationVector **inputVector,
+                                            vtkInformationVector *outputVector)
+{
+    // get the info objects
+    vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
+    vtkInformation *outInfo = outputVector->GetInformationObject(0);
+    // get the input and ouptut
+    vtkPolyData *input = vtkPolyData::SafeDownCast(
+                            inInfo->Get(vtkDataObject::DATA_OBJECT()));
+    vtkStringArray* inputLabels = vtkStringArray::SafeDownCast(input->GetPointData()->GetAbstractArray("labels"));
+    vtkPolyData *output = vtkPolyData::SafeDownCast(
+                           outInfo->Get(vtkDataObject::DATA_OBJECT()));
+    //
+    vtkImplicitFunction* currentImpliciteFunction = this->GetClipFunction();
+    int insideOutValue = this->GetInsideOut();
+    //if insideOutValue=0; we want to retrieve ouside points
+    //if insideOutValue=1; we want to retrieve inside points
+    vtkSmartPointer<vtkPoints> outputPoints = vtkSmartPointer<vtkPoints>::New();
+    vtkSmartPointer<vtkStringArray> outputStrings = vtkSmartPointer<vtkStringArray>::New();
+    outputStrings->SetName("labels");
+    for(vtkIdType i=0;i<input->GetNumberOfPoints();i++) {
+       //
+       double* currentPoint = input->GetPoint(i);
+       double currentIFvalue = currentImpliciteFunction->FunctionValue(currentPoint);
+       //if currentIFvalue>0, current point is outside the clip
+       if (currentIFvalue>0 && insideOutValue==0) {
+           outputPoints->InsertNextPoint(currentPoint);
+           vtkStdString label = inputLabels->GetValue(i);
+           outputStrings->InsertNextValue(label);
+       }
+       //currentIFvalue<=0, current point is inside the clip
+       else if (currentIFvalue<=0 && insideOutValue==1) {
+           outputPoints->InsertNextPoint(currentPoint);
+           vtkStdString label = inputLabels->GetValue(i);
+           outputStrings->InsertNextValue(label);
+       }
+       else {
+           //vtkErrorMacro("vvClipPolyData - NOT IMPLEMENTED");
+       }
+    }
+    //
+    output->ShallowCopy(input);
+    output->SetPoints(outputPoints);
+    output->GetPointData()->AddArray(outputStrings);
+    return 1;
+}
+
+//----------------------------------------------------------------------------
+
+void vvClipPolyData::PrintSelf(ostream& os, vtkIndent indent)
+{
+    this->Superclass::PrintSelf(os,indent);
+}
diff --git a/vv/vvClipPolyData.h b/vv/vvClipPolyData.h
new file mode 100644 (file)
index 0000000..5bd3f86
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef VVCLIPPOLYDATA_H
+#define VVCLIPPOLYDATA_H
+
+#include "vtkClipPolyData.h"
+
+class vvClipPolyData : public vtkClipPolyData
+{
+public:
+  vtkTypeMacro(vvClipPolyData,vtkClipPolyData);
+  void PrintSelf(ostream& os, vtkIndent indent);
+
+  static vvClipPolyData *New();
+
+protected:
+  vvClipPolyData();
+  ~vvClipPolyData();
+
+  int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
+
+private:
+  vvClipPolyData(const vvClipPolyData&);  // Not implemented.
+  void operator=(const vvClipPolyData&);  // Not implemented.
+};
+
+#endif // VVCLIPPOLYDATA_H
diff --git a/vv/vvImageMapToWLColors.cxx b/vv/vvImageMapToWLColors.cxx
deleted file mode 100644 (file)
index a553583..0000000
+++ /dev/null
@@ -1,270 +0,0 @@
-/*=========================================================================
-  Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
-
-  Authors belong to:
-  - University of LYON              http://www.universite-lyon.fr/
-  - Léon Bérard cancer center       http://www.centreleonberard.fr
-  - CREATIS CNRS laboratory         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.
-
-  It is distributed under dual licence
-
-  - BSD        See included LICENSE.txt file
-  - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-===========================================================================**/
-#include "vvImageMapToWLColors.h"
-#include "clitkCommon.h"
-#include "vtkDataArray.h"
-#include "vtkImageData.h"
-#include "vtkInformation.h"
-#include "vtkInformationVector.h"
-#include "vtkObjectFactory.h"
-#include "vtkScalarsToColors.h"
-#include "vtkPointData.h"
-#include <vtkObjectFactory.h>
-
-vtkStandardNewMacro(vvImageMapToWLColors);
-
-vvImageMapToWLColors::vvImageMapToWLColors() :
-  wl_mode(false)
-{}
-
-template <class T>
-void vtkImageMapToWindowLevelClamps ( vtkImageData *data, double w,
-                                      double l, T& lower, T& upper,
-                                      unsigned char &lower_val,
-                                      unsigned char &upper_val)
-{
-  double f_lower, f_upper, f_lower_val, f_upper_val;
-  double adjustedLower, adjustedUpper;
-  double range[2];
-
-  data->GetPointData()->GetScalars()->GetDataTypeRange( range );
-
-  f_lower = l - fabs(w) / 2.0;
-  f_upper = f_lower + fabs(w);
-
-  // Set the correct lower value
-  if ( f_lower <= range[1]) {
-    if (f_lower >= range[0]) {
-      lower = static_cast<T>(f_lower);
-      adjustedLower = f_lower;
-    } else {
-      lower = static_cast<T>(range[0]);
-      adjustedLower = range[0];
-    }
-  } else {
-    lower = static_cast<T>(range[1]);
-    adjustedLower = range[1];
-  }
-
-  // Set the correct upper value
-  if ( f_upper >= range[0]) {
-    if (f_upper <= range[1]) {
-      upper = static_cast<T>(f_upper);
-      adjustedUpper = f_upper;
-    } else {
-      upper = static_cast<T>(range[1]);
-      adjustedUpper = range[1];
-    }
-  } else {
-    upper = static_cast<T>(range[0]);
-    adjustedUpper = range [0];
-  }
-
-  // now compute the lower and upper values
-  if (w >= 0) {
-    f_lower_val = 255.0*(adjustedLower - f_lower)/w;
-    f_upper_val = 255.0*(adjustedUpper - f_lower)/w;
-  } else {
-    f_lower_val = 255.0 + 255.0*(adjustedLower - f_lower)/w;
-    f_upper_val = 255.0 + 255.0*(adjustedUpper - f_lower)/w;
-  }
-
-  if (f_upper_val > 255) {
-    upper_val = 255;
-  } else if (f_upper_val < 0) {
-    upper_val = 0;
-  } else {
-    upper_val = static_cast<unsigned char>(f_upper_val);
-  }
-
-  if (f_lower_val > 255) {
-    lower_val = 255;
-  } else if (f_lower_val < 0) {
-    lower_val = 0;
-  } else {
-    lower_val = static_cast<unsigned char>(f_lower_val);
-  }
-}
-
-template <class T>
-void vvImageMapToWindowLevelColorsExecute(
-  vtkImageMapToWindowLevelColors *self,
-  vtkImageData *inData, T *inPtr,
-  vtkImageData *outData,
-  unsigned char *outPtr,
-  int outExt[6], int id, bool wl_mode)
-{
-  int idxX, idxY, idxZ;
-  int extX, extY, extZ;
-  vtkIdType inIncX, inIncY, inIncZ;
-  vtkIdType outIncX, outIncY, outIncZ;
-  unsigned long count = 0;
-  unsigned long target;
-  int dataType = inData->GetScalarType();
-  int numberOfComponents,numberOfOutputComponents,outputFormat;
-  int rowLength;
-  vtkScalarsToColors *lookupTable = self->GetLookupTable();
-  unsigned char *outPtr1;
-  T *inPtr1;
-  unsigned char *optr;
-  T    *iptr;
-  double shift =  self->GetWindow() / 2.0 - self->GetLevel();
-  double scale = 255.0 / self->GetWindow();
-
-  T   lower, upper;
-  unsigned char lower_val, upper_val, result_val;
-  vtkImageMapToWindowLevelClamps( inData, self->GetWindow(),
-                                  self->GetLevel(),
-                                  lower, upper, lower_val, upper_val );
-
-  // find the region to loop over
-  extX = outExt[1] - outExt[0] + 1;
-  extY = outExt[3] - outExt[2] + 1;
-  extZ = outExt[5] - outExt[4] + 1;
-
-  target = static_cast<unsigned long>(extZ*extY/50.0);
-  target++;
-
-  // Get increments to march through data
-  inData->GetContinuousIncrements(outExt, inIncX, inIncY, inIncZ);
-
-  outData->GetContinuousIncrements(outExt, outIncX, outIncY, outIncZ);
-  numberOfComponents = inData->GetNumberOfScalarComponents();
-  numberOfOutputComponents = outData->GetNumberOfScalarComponents();
-  outputFormat = self->GetOutputFormat();
-
-  rowLength = extX*numberOfComponents;
-
-  // Loop through output pixels
-  outPtr1 = outPtr;
-  inPtr1 = inPtr;
-  for (idxZ = 0; idxZ < extZ; idxZ++) {
-    for (idxY = 0; !self->AbortExecute && idxY < extY; idxY++) {
-      if (!id) {
-        if (!(count%target)) {
-          self->UpdateProgress(count/(50.0*target));
-        }
-        count++;
-      }
-
-      iptr = inPtr1;
-      optr = outPtr1;
-
-      if ( lookupTable ) {
-        lookupTable->MapScalarsThroughTable2(
-          inPtr1,
-          static_cast<unsigned char *>(outPtr1),
-          dataType,extX,numberOfComponents,
-          outputFormat);
-        if (wl_mode) {
-          unsigned short ushort_val;
-          for (idxX = 0; idxX < extX; idxX++) {
-            if (*iptr <= lower) {
-              ushort_val = lower_val;
-            } else if (*iptr >= upper) {
-              ushort_val = upper_val;
-            } else {
-              ushort_val = static_cast<unsigned char>((*iptr + shift)*scale);
-            }
-            *optr = static_cast<unsigned char>((*optr * ushort_val) >> 8);
-            switch (outputFormat) {
-            case VTK_RGBA:
-              *(optr+1) = static_cast<unsigned char>(
-                            (*(optr+1) * ushort_val) >> 8);
-              *(optr+2) = static_cast<unsigned char>(
-                            (*(optr+2) * ushort_val) >> 8);
-              *(optr+3) = 255;
-              break;
-            case VTK_RGB:
-              *(optr+1) = static_cast<unsigned char>(
-                            (*(optr+1) * ushort_val) >> 8);
-              *(optr+2) = static_cast<unsigned char>(
-                            (*(optr+2) * ushort_val) >> 8);
-              break;
-            case VTK_LUMINANCE_ALPHA:
-              *(optr+1) = 255;
-              break;
-            }
-            iptr += numberOfComponents;
-            optr += numberOfOutputComponents;
-          }
-        }
-      } else {
-        for (idxX = 0; idxX < extX; idxX++) {
-          if (*iptr <= lower) {
-            result_val = lower_val;
-          } else if (*iptr >= upper) {
-            result_val = upper_val;
-          } else {
-            result_val = static_cast<unsigned char>((*iptr + shift)*scale);
-          }
-          *optr = result_val;
-          switch (outputFormat) {
-          case VTK_RGBA:
-            *(optr+1) = result_val;
-            *(optr+2) = result_val;
-            *(optr+3) = 255;
-            break;
-          case VTK_RGB:
-            *(optr+1) = result_val;
-            *(optr+2) = result_val;
-            break;
-          case VTK_LUMINANCE_ALPHA:
-            *(optr+1) = 255;
-            break;
-          }
-          iptr += numberOfComponents;
-          optr += numberOfOutputComponents;
-        }
-      }
-      outPtr1 += outIncY + extX*numberOfOutputComponents;
-      inPtr1 += inIncY + rowLength;
-    }
-    outPtr1 += outIncZ;
-    inPtr1 += inIncZ;
-  }
-}
-
-
-void vvImageMapToWLColors::ThreadedRequestData(
-  vtkInformation *vtkNotUsed(request),
-  vtkInformationVector **vtkNotUsed(inputVector),
-  vtkInformationVector *vtkNotUsed(outputVector),
-  vtkImageData ***inData,
-  vtkImageData **outData,
-  int outExt[6], int id)
-{
-  void *inPtr = inData[0][0]->GetScalarPointerForExtent(outExt);
-  void *outPtr = outData[0]->GetScalarPointerForExtent(outExt);
-
-  switch (inData[0][0]->GetScalarType()) {
-    vtkTemplateMacro(
-      vvImageMapToWindowLevelColorsExecute(this,
-                                           inData[0][0],
-                                           static_cast<VTK_TT *>(inPtr),
-                                           outData[0],
-                                           static_cast<unsigned char *>(outPtr),
-                                           outExt,
-                                           id,wl_mode));
-  default:
-    vtkErrorMacro(<< "Execute: Unknown ScalarType");
-    return;
-  }
-}
-
-
diff --git a/vv/vvImageMapToWLColors.h b/vv/vvImageMapToWLColors.h
deleted file mode 100644 (file)
index 7b63e2b..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*=========================================================================
-  Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
-
-  Authors belong to: 
-  - University of LYON              http://www.universite-lyon.fr/
-  - Léon Bérard cancer center       http://www.centreleonberard.fr
-  - CREATIS CNRS laboratory         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.
-
-  It is distributed under dual licence
-
-  - BSD        See included LICENSE.txt file
-  - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-===========================================================================**/
-#ifndef vvImageMapToWLColors_h
-#define vvImageMapToWLColors_h
-#include <vtkImageMapToWindowLevelColors.h>
-
-//This is mostly a copy of the vtk parent class, but with the option
-//not to use the W/L when a LUT is set
-
-class vvImageMapToWLColors : public vtkImageMapToWindowLevelColors
-{
-public:
-    static vvImageMapToWLColors * New();
-    vvImageMapToWLColors();
-    void SetWindowLevelMode(bool wl) {wl_mode=wl;}
-    void ThreadedRequestData(vtkInformation *request,
-            vtkInformationVector **inputVector,
-            vtkInformationVector *outputVector,
-            vtkImageData ***inData, vtkImageData **outData,
-            int extent[6], int id);
-
-protected:
-    bool wl_mode;
-
-};
-
-#endif
index 682398f49deca17954a5dc95ed25a8364a17c699..0bab2f4305a8434023ffaa9751fdaf236f5f3fda 100644 (file)
@@ -41,6 +41,8 @@ vvLandmarks::vvLandmarks(int size)
   }
   mPolyData = vtkPolyData::New();
   mIds = vtkFloatArray::New();
+  mLabels = vtkStringArray::New();
+  mLabels->SetName("labels");
 }
 //--------------------------------------------------------------------
 
@@ -58,6 +60,8 @@ vvLandmarks::~vvLandmarks()
     mIds->Delete();
   if (mPolyData)
     mPolyData->Delete();
+  if (mLabels)
+    mLabels->Delete();
 }
 //--------------------------------------------------------------------
 
@@ -66,14 +70,21 @@ vvLandmarks::~vvLandmarks()
 void vvLandmarks::AddLandmark(float x,float y,float z,float t,double value)
 {
   vvLandmark point;
+  vtkIdType idPoint;
   point.coordinates[0] = x;
   point.coordinates[1] = y;
   point.coordinates[2] = z;
   point.coordinates[3] = t;
   point.pixel_value=value;
   mLandmarks.push_back(point);
-  mPoints[int(t)]->InsertNextPoint(x,y,z);
-  
+
+  idPoint = mPoints[int(t)]->InsertNextPoint(x,y,z);
+  std::string str_vtkIdType;       // string which will contain the result
+  std::ostringstream convert;      // stream used for the conversion
+  convert << idPoint;                  // insert the textual representation of 'idPoint' in the characters in the stream
+  str_vtkIdType = convert.str();    // set 'str_vtkIdType' to the contents of the stream
+  mLabels->InsertNextValue(str_vtkIdType.c_str());
+
   std::stringstream numberVal;
   numberVal << (mLandmarks.size()-1);
   /*
@@ -96,10 +107,12 @@ void vvLandmarks::RemoveLastLandmark()
 {
   mPoints[mLandmarks.back().coordinates[3]]->SetNumberOfPoints(
                                                                mPoints[mLandmarks.back().coordinates[3]]->GetNumberOfPoints()-1);
-  mPolyData->Modified();
   //  mText.pop_back();
   mLandmarks.pop_back();
   mIds->RemoveLastTuple();
+  mLabels->SetNumberOfValues(mLabels->GetNumberOfValues()-1);
+  mLabels->Modified();
+  mPolyData->Modified();
 }
 //--------------------------------------------------------------------
 
@@ -112,9 +125,17 @@ void vvLandmarks::RemoveLandmark(int index)
   // pologyons linking the points
   int npoints = mPoints[mLandmarks[index].coordinates[3]]->GetNumberOfPoints();
   int t = mLandmarks[index].coordinates[3];
-  for (int i = index; i < npoints - 1; i++)
+  for (int i = index; i < npoints - 1; i++) {
     mPoints[t]->InsertPoint(i, mPoints[t]->GetPoint(i+1));
+       std::string str_i;                   // string which will contain the result
+       std::ostringstream convert;      // stream used for the conversion
+       convert << i;                        // insert the textual representation of 'i' in the characters in the stream
+       str_i = convert.str();           // set 'str_i' to the contents of the stream
+       mLabels->SetValue(i,str_i.c_str());
+    }
   mPoints[t]->SetNumberOfPoints(npoints-1);
+  mLabels->SetNumberOfValues(npoints-1);
+  mLabels->Modified();
   mPolyData->Modified();
 
   mLandmarks.erase(mLandmarks.begin() + index);
@@ -165,6 +186,7 @@ void vvLandmarks::LoadFile(std::string filename)
   }
   mFilename = filename;
   mLandmarks.clear();
+  vtkIdType idPoint;
   char line[255];
   for (unsigned int i = 0; i < mPoints.size(); i++)
     mPoints[i]->SetNumberOfPoints(0);
@@ -246,8 +268,13 @@ void vvLandmarks::LoadFile(std::string filename)
       //      DD(point.comments);
       mLandmarks.push_back(point);
       mIds->InsertNextTuple1(0.55);
-      mPoints[int(point.coordinates[3])]->InsertNextPoint(
+     idPoint = mPoints[int(point.coordinates[3])]->InsertNextPoint(
                                                           point.coordinates[0],point.coordinates[1],point.coordinates[2]);
+     std::string str_vtkIdType;            // string which will contain the result
+     std::ostringstream convert;       // stream used for the conversion
+     convert << idPoint;                   // insert the textual representation of 'idPoint' in the characters in the stream
+     str_vtkIdType = convert.str(); // set 'str_vtkIdType' to the contents of the stream
+     mLabels->InsertNextValue(str_vtkIdType.c_str());
     }
   }
   SetTime(0);
@@ -301,6 +328,7 @@ void vvLandmarks::SetTime(int time)
   if (time >= 0 && time <= ((int)mPoints.size() -1)) {
     mPolyData->SetPoints(mPoints[time]);
     mPolyData->GetPointData()->SetScalars(mIds);
+    mPolyData->GetPointData()->AddArray(mLabels);
     mPolyData->Modified();
     mPolyData->Update();
   }
index 6bfe82e4469e22241599fcd13f821429c2a5dbd2..8f9471729d92462a0145f78e4ee95c92b0aca3c4 100644 (file)
@@ -24,6 +24,7 @@
 #include "vtkPolyData.h"
 #include "vtkPoints.h"
 #include "vvLandmarksGlyph.h"
+#include "vtkStringArray.h"
 
 //typedef
 struct vvLandmark {
@@ -67,6 +68,7 @@ private:
     std::vector<vtkPoints*> mPoints;
     vtkFloatArray* mIds;
     //std::vector<vvLandmarksGlyph*> mText;
+    vtkStringArray* mLabels;
     std::string mFilename;
     int mFormatVersion;
 };
index ef623d9fe21d6090db82e61faef60f50b1525f7d..5cf7c9810cbeb46e7cc83f67773edc59be3f205a 100644 (file)
 #define COLUMN_IMAGE_NAME 7
 
 #if CLITK_PRIVATE_FEATURES
-  #define EXTENSIONS "Images ( *.bmp *.png *.jpeg *.jpg *.tif *.mhd *.mha *.hdr *.vox *.his *.xdr *.SCAN *.nii *.nrrd *.nhdr *.usf)"
+  #define EXTENSIONS "Images ( *.bmp *.png *.jpeg *.jpg *.tif *.mhd *.mha *.hdr *.vox *.his *.xdr *.SCAN *.nii *.nrrd *.nhdr *.refscan *.usf *.svl)"
 #else
-  #define EXTENSIONS "Images ( *.bmp *.png *.jpeg *.jpg *.tif *.mhd *.mha *.hdr *.vox *.his *.xdr *.SCAN *.nii *.nrrd *.nhdr)"
+  #define EXTENSIONS "Images ( *.bmp *.png *.jpeg *.jpg *.tif *.mhd *.mha *.hdr *.vox *.his *.xdr *.SCAN *.nii *.nrrd *.nhdr *.refscan)"
 #endif
 
 /*Data Tree values
@@ -3070,6 +3070,12 @@ void vvMainWindow::ShowLastImage()
 //------------------------------------------------------------------------------
 void vvMainWindow::UpdateRenderWindows()
 {
+  for (unsigned int i = 0; i < mSlicerManagers.size(); i++) {
+    mSlicerManagers[i]->GetSlicer(0)->UpdateLandmarks();
+    mSlicerManagers[i]->GetSlicer(1)->UpdateLandmarks();
+    mSlicerManagers[i]->GetSlicer(2)->UpdateLandmarks();
+    mSlicerManagers[i]->GetSlicer(3)->UpdateLandmarks();
+  }
   if (NOViewWidget->GetRenderWindow()) NOViewWidget->GetRenderWindow()->Render();
   if (NEViewWidget->GetRenderWindow()) NEViewWidget->GetRenderWindow()->Render();
   if (SOViewWidget->GetRenderWindow()) SOViewWidget->GetRenderWindow()->Render();
index ecf29da4b5939ff784f4b73eaa84a529ea7e8e61..894e8e4a3aefb67968e9452a67dcf3c707d8d2bd 100644 (file)
@@ -172,7 +172,7 @@ void vvSaveState::SaveLink(const vvSlicerManager* vvManager)
     std::string my_id = vvManager->GetId();
     m_XmlWriter->writeStartElement("LinkedFrom");
     m_XmlWriter->writeAttribute("Id", my_id.c_str());
-    typename LinkListType::iterator i;
+    LinkListType::iterator i;
     for (i = links.begin(); i != links.end(); i++) {
       std::string link_id = *i;
       m_XmlWriter->writeTextElement("LinkedTo", link_id.c_str());
index 92463226aa392cb2bbd719dea9558e00eac8bc73..1e1245f425b787523aeb69d7e9cf87c7086c851d 100644 (file)
@@ -21,7 +21,6 @@
 #include "vvSlicerManagerCommand.h"
 #include "vvGlyphSource.h"
 #include "vvGlyph2D.h"
-#include "vvImageMapToWLColors.h"
 
 #include <vtkTextProperty.h>
 #include <vtkTextActor.h>
@@ -41,6 +40,7 @@
 #include <vtkDataArray.h>
 #include <vtkFloatArray.h>
 #include <vtkClipPolyData.h>
+#include <vtkActor2DCollection.h>
 #include <vtkGlyph3D.h>
 #include <vtkMath.h>
 #include <vtkCursor3D.h>
@@ -137,9 +137,6 @@ vvSlicer::vvSlicer()
   this->GetRenderer()->AddActor(legend);
   showFusionLegend = false;
 
-  this->WindowLevel->Delete();
-  this->WindowLevel = vvImageMapToWLColors::New();
-
   this->InstallPipeline();
 
   mLinkOverlayWindowLevel = true;
@@ -580,36 +577,40 @@ void vvSlicer::SetLandmarks(vvLandmarks* landmarks)
 
     if (!mCross)
       mCross = vtkSmartPointer<vtkCursor3D>::New();
+       if (!mClipBox)
+      mClipBox = vtkSmartPointer<vtkBox>::New();
+    if (!mLandClipper)
+      mLandClipper = vtkSmartPointer<vvClipPolyData>::New();
+    if (!mLandGlyph)
+      mLandGlyph = vtkSmartPointer<vtkGlyph3D>::New();
+    if (!mLandMapper)
+      mLandMapper = vtkSmartPointer<vtkPolyDataMapper>::New();
+    if (!mLandActor)
+      mLandActor = vtkSmartPointer<vtkActor>::New();
+
     mCross->SetFocalPoint(0.0,0.0,0.0);
     mCross->SetModelBounds(-10,10,-10,10,-10,10);
     mCross->AllOff();
     mCross->AxesOn();
 
-    if (!mLandGlyph)
-      mLandGlyph = vtkSmartPointer<vtkGlyph3D>::New();
+    mLandClipper->SetClipFunction(mClipBox);
+    mLandClipper->InsideOutOn();
+    mLandClipper->SetInput(mLandmarks->GetOutput());
+
     mLandGlyph->SetSource(mCross->GetOutput());
-    mLandGlyph->SetInput(landmarks->GetOutput());
+    mLandGlyph->SetInput(mLandClipper->GetOutput());
     //mLandGlyph->SetIndexModeToScalar();
-    mLandGlyph->SetRange(0,1);
-    mLandGlyph->ScalingOff();
+    //mLandGlyph->SetRange(0,1);
+    //mLandGlyph->ScalingOff();
 
-    mLandGlyph->SetColorModeToColorByScalar();
-
-    if (!mClipBox)
-      mClipBox = vtkSmartPointer<vtkBox>::New();
-    if (!mLandClipper)
-      mLandClipper = vtkSmartPointer<vtkClipPolyData>::New();
-    mLandClipper->InsideOutOn();
-    mLandClipper->SetInput(mLandGlyph->GetOutput());
-    mLandClipper->SetClipFunction(mClipBox);
+    //mLandGlyph->SetColorModeToColorByScalar();
+    
+    mLandGlyph->SetScaleModeToDataScalingOff();
+    mLandGlyph->SetIndexModeToOff();
 
-    if (!mLandMapper)
-      mLandMapper = vtkSmartPointer<vtkPolyDataMapper>::New();
-    mLandMapper->SetInputConnection(mLandClipper->GetOutputPort());
+    mLandMapper->SetInputConnection(mLandGlyph->GetOutputPort());
     //mLandMapper->ScalarVisibilityOff();
 
-    if (!mLandActor)
-      mLandActor = vtkSmartPointer<vtkActor>::New();
     mLandActor->SetMapper(mLandMapper);
     mLandActor->GetProperty()->SetColor(255,10,212);
     mLandActor->SetPickable(0);
@@ -908,15 +909,15 @@ void vvSlicer::UpdateDisplayExtent()
     return;
   }
   input->UpdateInformation();
+  this->SetSlice( this->GetSlice() ); //SR: make sure the update let the slice in extents
 
   // Local copy of extent
   int w_ext[6];
   int* ext = GetExtent();
   copyExtent(ext, w_ext);
   // Set slice value
-  int s = this->Slice > ext[this->SliceOrientation*2+1] ? ext[this->SliceOrientation*2 + 1] : this->Slice;
-  w_ext[ this->SliceOrientation*2   ] = s;
-  w_ext[ this->SliceOrientation*2+1 ] = s;
+  w_ext[ this->SliceOrientation*2   ] = this->Slice;
+  w_ext[ this->SliceOrientation*2+1 ] = this->Slice;
   
   // Image actor
   this->ImageActor->SetDisplayExtent(w_ext);
@@ -1448,13 +1449,38 @@ void vvSlicer::UpdateLandmarks()
 {
   vtkPolyData *pd = static_cast<vtkPolyData*>(mLandClipper->GetInput());
   if (pd->GetPoints()) {
-    mLandGlyph->SetRange(0,1);
-    mLandGlyph->Modified();
-    mLandGlyph->Update();
+    //mLandGlyph->SetRange(0,1);
+    //mLandGlyph->Modified();
+    //mLandGlyph->Update();
 
     mClipBox->Modified();
     mLandClipper->Update();
     mLandMapper->Update();
+    //Let's add the captions
+    //First remove all captions:
+    for(unsigned int i=0;i<mLandLabelActors.size();i++) {
+       this->Renderer->RemoveActor2D(mLandLabelActors[i]);
+       //allActors2D->Remove (mLandLabelActors[i]);
+    }
+    mLandLabelActors.clear();
+    //Next add the captions to the displayed points
+    for (vtkIdType id=0; id<mLandClipper->GetOutput()->GetNumberOfPoints(); id++) {
+         double *position = mLandClipper->GetOutput()->GetPoint(id);
+      vtkStdString label = static_cast<vtkStringArray*>(mLandClipper->GetOutput()->GetPointData()->GetAbstractArray("labels"))->GetValue(id);
+      vtkSmartPointer<vtkCaptionActor2D> label_actor = vtkSmartPointer<vtkCaptionActor2D>::New();
+      label_actor->SetCaption(label);
+      label_actor->SetAttachmentPoint(position);
+      label_actor->GetCaptionTextProperty()->SetColor(1,0,0);
+      label_actor->GetCaptionTextProperty()->SetOrientation(33.333333);
+      label_actor->GetCaptionTextProperty()->SetFontFamilyToTimes();
+      label_actor->GetCaptionTextProperty()->SetBold(0);
+      label_actor->GetCaptionTextProperty()->SetFontSize(6);
+      label_actor->BorderOff();
+      label_actor->LeaderOff();
+      label_actor->ThreeDimensionalLeaderOff();
+      mLandLabelActors.push_back(label_actor);
+      this->Renderer->AddActor2D(mLandLabelActors[id]);
+     }
   }
 
 }
index 9a750e14d69a6db41596d143e4d3ff30c33b9fae..a738a788b192db47fb40859f233b5e31853a8569 100644 (file)
 #include "vvImage.h"
 #include "vvMesh.h"
 #include "vvMeshActor.h"
+#include "vvClipPolyData.h"
 
 #include <vtkSmartPointer.h>
 #include <vtkImageViewer2.h>
 #include <vtkImageReslice.h>
 #include <vtkImageMapToColors.h>
+#include <vtkCaptionActor2D.h>
 
 class vtkActor;
 class vtkActor2D;
@@ -244,9 +246,10 @@ protected:
   vtkSmartPointer<vtkActor> mVFActor;
   vtkSmartPointer<vtkGlyph3D> mLandGlyph;
   vtkSmartPointer<vtkCursor3D> mCross;
-  vtkSmartPointer<vtkClipPolyData> mLandClipper;
+  vtkSmartPointer<vvClipPolyData> mLandClipper;
   vtkSmartPointer<vtkPolyDataMapper> mLandMapper;
   vtkSmartPointer<vtkActor> mLandActor;
+  std::vector<vtkSmartPointer<vtkCaptionActor2D> > mLandLabelActors;
   vtkSmartPointer<vtkBox> mClipBox;
   vtkSmartPointer<vtkScalarBarActor> legend;
   std::vector<vvMeshActor*> mSurfaceCutActors;
index 9331bf1ab78a859dcfaf96c4b092c8f4ce3f7454..015409b2debdf12cc501dd6b0226eddabf77e6a8 100644 (file)
@@ -23,7 +23,6 @@
 #include "vvInteractorStyleNavigator.h"
 #include "vvLandmarks.h"
 #include "vvMesh.h"
-#include "vvImageMapToWLColors.h"
 #include "vvBlendImageActor.h"
 
 #include <vtkImageActor.h>
@@ -1305,15 +1304,11 @@ void vvSlicerManager::SetColorMap(int colormap)
       invLUT->SetSaturationRange(1,1);
       invLUT->SetHueRange(double((mOverlayColor+180)%360)/360,double((mOverlayColor+180)%360)/360);
       invLUT->Build();
-      dynamic_cast<vvImageMapToWLColors*>(mSlicers[i]->GetWindowLevel())
-        ->SetWindowLevelMode(true);
       mSlicers[i]->GetWindowLevel()->SetLookupTable(supLUT);
       mSlicers[i]->GetOverlayMapper()->SetLookupTable(invLUT);
       invLUT->Delete();
       supLUT->Delete();
     } else if (mSlicers[i]->GetOverlay()) {
-      //dynamic_cast<vvImageMapToWLColors*>(mSlicers[i]->GetWindowLevel())
-      //->SetWindowLevelMode(false);
       mSlicers[i]->GetWindowLevel()->SetLookupTable(LUT);
     } else {
       mSlicers[i]->GetWindowLevel()->SetLookupTable(LUT);
diff --git a/vv/vvThreadedFilter.cxx b/vv/vvThreadedFilter.cxx
deleted file mode 100644 (file)
index 3504b92..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/*=========================================================================
-  Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
-
-  Authors belong to:
-  - University of LYON              http://www.universite-lyon.fr/
-  - Léon Bérard cancer center       http://www.centreleonberard.fr
-  - CREATIS CNRS laboratory         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.
-
-  It is distributed under dual licence
-
-  - BSD        See included LICENSE.txt file
-  - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-  ===========================================================================**/
-
-// vv
-#include "vvThreadedFilter.h"
-#include "vvProgressDialog.h"
-
-// Qt
-#include <QMessageBox>
-
-//------------------------------------------------------------------------------
-vvThreadedFilter::vvThreadedFilter():
-  QThread()
-{
-  m_Filter = NULL;
-}
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-vvThreadedFilter::~vvThreadedFilter()
-{
-}
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-void vvThreadedFilter::SetFilter(clitk::ImageToImageGenericFilterBase * f)
-{
-  m_Filter = f;
-}
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-void vvThreadedFilter::Update()
-{
-  assert(m_Filter != NULL);
-
-  // Show a progress bar while computing
-  vvProgressDialog progress("Computing ...",100);
-  progress.SetCancelButtonEnabled(true);
-  connect(&progress, SIGNAL(rejected()), this, SLOT(reject()));
-  this->start();
-  this->setTerminationEnabled(true);
-  std::string temp;
-  while (this->isRunning()) {
-    // try {
-    m_FilterBase = m_Filter->GetFilterBase(); // get filterbase is only set after Update
-    if (m_FilterBase != NULL) {
-      progress.SetProgress(m_FilterBase->GetCurrentStepNumber(), 
-                          m_FilterBase->GetNumberOfSteps());
-      if (temp != m_FilterBase->GetCurrentStepName()) {
-       progress.AddToText(m_FilterBase->GetCurrentStepName());
-      }
-      temp = m_FilterBase->GetCurrentStepName();
-    }
-    this->wait(200); // in miliseconds
-    qApp->processEvents();
-  }
-}
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-void vvThreadedFilter::run()
-{
-  assert(m_Filter != NULL);
-  try {
-    m_Filter->Update();
-  }
-  catch(clitk::ExceptionObject e) {
-    DD("vvThreadedFilter : exceptionobject handeled");
-    DD(e.what());
-    QApplication::restoreOverrideCursor();
-    QMessageBox::information(new QWidget, tr("Error"), e.what());  
-  }
-  DD("end RUN");
-}
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-void vvThreadedFilter::reject()
-{
-  // First, say the filter it must stop as soon as possible. We then
-  // wait that an exception occur in the main thread.
-  if (m_FilterBase != NULL) {
-    m_FilterBase->Cancel();
-  }
-}
-//------------------------------------------------------------------------------
-
-
-
-
diff --git a/vv/vvThreadedFilter.h b/vv/vvThreadedFilter.h
deleted file mode 100644 (file)
index b367d50..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*=========================================================================
-  Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
-
-  Authors belong to: 
-  - University of LYON              http://www.universite-lyon.fr/
-  - Léon Bérard cancer center       http://www.centreleonberard.fr
-  - CREATIS CNRS laboratory         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.
-
-  It is distributed under dual licence
-
-  - BSD        See included LICENSE.txt file
-  - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-===========================================================================**/
-
-#ifndef VVTHREADEDFILTER_H
-#define VVTHREADEDFILTER_H
-
-// clitk
-#include "clitkImageToImageGenericFilterBase.h"
-
-// qt
-#include <QThread>
-
-//------------------------------------------------------------------------------
-class vvThreadedFilter: public QThread
-{
-  Q_OBJECT
-    public:
-  vvThreadedFilter();
-  ~vvThreadedFilter();
-
-  // Called from the main thread, runs the reader and displays the progress bar
-  void SetFilter(clitk::ImageToImageGenericFilterBase * f);
-  void Update();
-
-public slots:
-  void reject();
-  
- signals:
-  void ThreadInterrupted();
-
-protected:
-  void run();
-  clitk::ImageToImageGenericFilterBase * m_Filter;
-  clitk::FilterBase * m_FilterBase;
-
-}; // end class vvThreadedFilter
-//------------------------------------------------------------------------------
-
-#endif
-
diff --git a/vv/vvToolExtractLung.cxx b/vv/vvToolExtractLung.cxx
deleted file mode 100644 (file)
index 59b4133..0000000
+++ /dev/null
@@ -1,259 +0,0 @@
-/*=========================================================================
-  Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
-
-  Authors belong to:
-  - University of LYON              http://www.universite-lyon.fr/
-  - Léon Bérard cancer center       http://www.centreleonberard.fr
-  - CREATIS CNRS laboratory         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.
-
-  It is distributed under dual licence
-
-  - BSD        See included LICENSE.txt file
-  - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-  ===========================================================================**/
-
-// vv
-#include "vvToolExtractLung.h"
-#include "vvToolStructureSetManager.h"
-#include "vvSlicer.h"
-#include "vvImageReader.h"
-#include "vvImageWriter.h"
-#include "vvLabelImageLoaderWidget.h"
-#include "vvThreadedFilter.h"
-
-// Qt
-#include <QMessageBox>
-
-//------------------------------------------------------------------------------
-// Create the tool and automagically (I like this word) insert it in
-// the main window menu.
-ADD_TOOL(vvToolExtractLung);
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-vvToolExtractLung::vvToolExtractLung(vvMainWindowBase * parent, Qt::WindowFlags f):
-  vvToolWidgetBase(parent,f),
-  vvToolBase<vvToolExtractLung>(parent),
-  Ui::vvToolExtractLung()
-{
-  // GUI
-  Ui_vvToolExtractLung::setupUi(mToolWidget);
-  mMaskLoaderBox->setEnabled(false);
-  mOptionsBox->setEnabled(false);
-  mPatientMaskInputWidget->SetText("Patient mask");
-  connect(mPatientMaskInputWidget, SIGNAL(accepted()), this, SLOT(PatientMaskInputIsSelected()));
-
-  // Default values
-  mArgsInfo = new ArgsInfoType;
-  cmdline_parser_clitkExtractLung_init(mArgsInfo);
-  SetGUIFromArgsInfo();
-  m_IsThreadInterrupted = false;
-
-  // Create a new ExtractLung filter
-  mFilter = new FilterType;  // used in AddInputSelector
-
-  // Add input selector
-  AddInputSelector("Select CT thorax image", mFilter);
-}
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-vvToolExtractLung::~vvToolExtractLung()
-{
-}
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-void vvToolExtractLung::Initialize() {
-  SetToolName("ExtractLung");
-  SetToolMenuName("Extract lungs");
-  SetToolIconFilename(":/common/icons/lung-overlay.png");
-  SetToolTip("Extract lung mask from thorax CT.");
-  SetToolExperimental(true);
-  //  SetToolInMenu("Segmentation");
-}
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-void vvToolExtractLung::InputIsSelected(vvSlicerManager *m)
-{
-  // Hide selector
-  HideInputSelector(); // splitter
-  mToolInputSelectionWidget->hide();
-  mCurrentSlicerManager = m;
-  mCurrentImage = m->GetImage();
-  mMaskLoaderBox->setEnabled(true);
-  mLabelInput->setText(m->GetFileName().c_str());
-}
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-void vvToolExtractLung::PatientMaskInputIsSelected()
-{
-  // Get Patient mask and BG value
-  mPatient = mPatientMaskInputWidget->GetImage();  
-  mPatientBackgroundValue = mPatientMaskInputWidget->GetBackgroundValue();
-  
-  // Check patient dimension
-  if (mPatient->GetNumberOfDimensions() != 3) {
-    QMessageBox::information(this,tr("*Error*"), "Mask image must be 3D");
-    return;
-  }
-   
-  mMaskLoaderBox->setEnabled(false);
-  mOptionsBox->setEnabled(true);
-}
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-void vvToolExtractLung::SetGUIFromArgsInfo() 
-{
-  mAirUpperThresholdSlider->SetText("Upper threshold for air");
-  mAirUpperThresholdSlider->SetMinimum(-1200);
-  mAirUpperThresholdSlider->SetMaximum(2000);
-  DD(mArgsInfo->upper_arg);
-  mAirUpperThresholdSlider->SetValue(mArgsInfo->upper_arg);
-
-  mAirLowerThresholdSlider->SetText("Lower threshold for air");
-  mAirLowerThresholdSlider->SetMinimum(-1200);
-  mAirLowerThresholdSlider->SetMaximum(2000);
-  mAirLowerThresholdSlider->SetValue(mArgsInfo->lower_arg);
-
-}
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-void vvToolExtractLung::GetArgsInfoFromGUI() 
-{
-  // mArgsInfo->patientBG_arg = mPatientMaskInputWidget->GetBackgroundValue();
-  mArgsInfo->verboseOption_flag = true; // DEBUG. TO CHANGE
-  mArgsInfo->verboseStep_flag = true; // DEBUG. TO CHANGE
-  mArgsInfo->writeStep_flag = false;
-  mArgsInfo->input_given = 0;
-  // mArgsInfo->patient_given = 0;
-  mArgsInfo->output_given = 0;
-  mArgsInfo->outputTrachea_given = 0;
-  //  mArgsInfo->remove1_given = 0;
-  
-  mArgsInfo->upper_arg = mAirUpperThresholdSlider->GetValue();
-  mArgsInfo->lower_arg = mAirLowerThresholdSlider->GetValue();
-  if (mRadioButtonLowerThan->isChecked()) mArgsInfo->lower_given = 1;
-}
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-void vvToolExtractLung::apply() 
-{
-  // Change cursor to wait
-  QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
-  
-  // Read options from GUI and put it in the ArgsInfo struct
-  GetArgsInfoFromGUI();
-  
-  // Check options
-  if (mArgsInfo->lower_given) {
-    if (mArgsInfo->lower_arg > mArgsInfo->upper_arg) {    
-      QApplication::restoreOverrideCursor(); 
-      QMessageBox::information(this,tr("Error"), "Lower threshold cannot be greater than upper threshold.");
-      return;
-    }
-  }
-
-  // Create new filter
-  if (mFilter) delete mFilter;
-  mFilter = new FilterType;  // needed when thread cancel the filter
-  // mFilter->StopOnErrorOff();
-  //  mFilter->SetIOVerbose(true);
-  mFilter->AddInputVVImage(mCurrentImage); // CT
-  mFilter->AddInputVVImage(mPatient); // patient mask
-  mFilter->SetArgsInfo(*mArgsInfo);
-
-  // Created threaded execution
-  vvThreadedFilter thread;
-  connect(&thread, SIGNAL(ThreadInterrupted()), this, SLOT(ThreadInterrupted()));
-  thread.SetFilter(mFilter);
-
-  try {
-    thread.Update();
-  }
-  catch(std::runtime_error e) {
-    DD("Error exception handling");
-    DD(m_IsThreadInterrupted);
-  // Check if the thread has been canceled. In this case, return
-  if (m_IsThreadInterrupted) {
-    m_IsThreadInterrupted = false;
-    QApplication::restoreOverrideCursor(); 
-    return;
-  }
-  disconnect(&thread, SIGNAL(ThreadInterrupted()), this, SLOT(ThreadInterrupted()));
-    
-  // Check error during filter
-  // if (mFilter->HasError()) {
-    QApplication::restoreOverrideCursor();
-    QMessageBox::information(this,tr("Error"), e.what());//mFilter->GetLastError().c_str());
-    return;
-  // }
-  } // end exception
-  
-  // Get output
-  std::vector<vvImage::Pointer> output = mFilter->GetOutputVVImages();
-  if (output.size() == 0) {
-    std::cerr << "Error : no output ?" << std::endl;
-    QApplication::restoreOverrideCursor();
-    close();
-    return;
-  }
-  
-  // Set Lung into VV
-  vvImage::Pointer lung = output[0];
-  std::ostringstream osstream;
-  osstream << "Lung_" << mCurrentSlicerManager->GetSlicer(0)->GetFileName() << ".mhd";
-  vvSlicerManager * v = AddImage(lung,osstream.str());
-  v->SetPreset(5);
-  vvToolStructureSetManager::AddImage(mCurrentSlicerManager, "Right lung", lung, 1, false); // Right is greater than Left
-  vvToolStructureSetManager::AddImage(mCurrentSlicerManager, "Left lung", lung, 2, false);  
-
-  // Set trachea into VV
-  if (output.size() == 2) {
-    vvImage::Pointer trachea = output[1];
-    std::ostringstream osstream;
-    osstream << "Trachea_" << mCurrentSlicerManager->GetSlicer(0)->GetFileName() << ".mhd";
-    vvSlicerManager * v = AddImage(trachea,osstream.str());
-    v->SetPreset(5);
-    vvToolStructureSetManager::AddImage(mCurrentSlicerManager, "Trachea", trachea, 0);
-  }
-
-  // End
-  QApplication::restoreOverrideCursor();
-  close();
-}
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-bool vvToolExtractLung::close()
-{
-  return vvToolWidgetBase::close();
-}
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-void vvToolExtractLung::ThreadInterrupted() 
-{ 
-  m_IsThreadInterrupted = true; 
-}
-//------------------------------------------------------------------------------
-
diff --git a/vv/vvToolExtractLung.h b/vv/vvToolExtractLung.h
deleted file mode 100644 (file)
index 5693ad4..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*=========================================================================
-  Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
-
-  Authors belong to: 
-  - University of LYON              http://www.universite-lyon.fr/
-  - Léon Bérard cancer center       http://www.centreleonberard.fr
-  - CREATIS CNRS laboratory         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.
-
-  It is distributed under dual licence
-
-  - BSD        See included LICENSE.txt file
-  - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-===========================================================================**/
-
-#ifndef VVTOOLEXTRACTLUNG_H
-#define VVTOOLEXTRACTLUNG_H
-
-// clitk
-#include "clitkExtractLungGenericFilter.h"
-#include "../segmentation/clitkExtractLung_ggo.h"
-
-// vv
-#include "ui_vvToolExtractLung.h"
-#include "vvToolBase.h"
-#include "vvToolWidgetBase.h"
-#include "vvROIActor.h"
-
-// qt
-#include <QtDesigner/QDesignerExportWidget>
-
-//------------------------------------------------------------------------------
-class vvToolExtractLung:
-  public vvToolWidgetBase,
-  public vvToolBase<vvToolExtractLung>, 
-  private Ui::vvToolExtractLung 
-{
-  Q_OBJECT
-    public:
-  vvToolExtractLung(vvMainWindowBase* parent=0, Qt::WindowFlags f=0);
-  ~vvToolExtractLung();
-
-  //-----------------------------------------------------
-  static void Initialize();
-  virtual void InputIsSelected(vvSlicerManager *m);
-  void GetArgsInfoFromGUI();
-  void SetGUIFromArgsInfo();
-
-  //-----------------------------------------------------
-public slots:
-  virtual void apply();
-  virtual bool close();
-  void PatientMaskInputIsSelected();
-  void ThreadInterrupted();
-
-  //-----------------------------------------------------
-protected:
-  typedef args_info_clitkExtractLung ArgsInfoType;
-  ArgsInfoType * mArgsInfo;
-  typedef clitk::ExtractLungGenericFilter<ArgsInfoType> FilterType;
-  FilterType * mFilter;
-  vvImage::Pointer mPatient;
-  double mPatientBackgroundValue;
-  bool m_IsThreadInterrupted;
-
-}; // end class vvToolExtractLung
-//------------------------------------------------------------------------------
-
-#endif
-
diff --git a/vv/vvToolExtractPatient.cxx b/vv/vvToolExtractPatient.cxx
deleted file mode 100644 (file)
index d81b123..0000000
+++ /dev/null
@@ -1,260 +0,0 @@
-/*=========================================================================
-  Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
-
-  Authors belong to:
-  - University of LYON              http://www.universite-lyon.fr/
-  - Léon Bérard cancer center       http://www.centreleonberard.fr
-  - CREATIS CNRS laboratory         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.
-
-  It is distributed under dual licence
-
-  - BSD        See included LICENSE.txt file
-  - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-  ===========================================================================**/
-
-// vv
-#include "vvToolExtractPatient.h"
-#include "vvToolStructureSetManager.h"
-#include "vvSlicer.h"
-#include "vvImageReader.h"
-#include "vvImageWriter.h"
-#include "vvLabelImageLoaderWidget.h"
-#include "vvThreadedFilter.h"
-
-// Qt
-#include <QMessageBox>
-
-//------------------------------------------------------------------------------
-// Create the tool and automagically (I like this word) insert it in
-// the main window menu.
-ADD_TOOL(vvToolExtractPatient);
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-vvToolExtractPatient::vvToolExtractPatient(vvMainWindowBase * parent, Qt::WindowFlags f):
-  vvToolWidgetBase(parent,f),
-  vvToolBase<vvToolExtractPatient>(parent),
-  Ui::vvToolExtractPatient()
-{
-  // GUI
-  Ui_vvToolExtractPatient::setupUi(mToolWidget);
-  mOptionsBox->setEnabled(true);
-  //connect(mPatientMaskInputWidget, SIGNAL(accepted()), this, SLOT(PatientMaskInputIsSelected()));
-
-  // Default values
-  mArgsInfo = new ArgsInfoType;
-  cmdline_parser_clitkExtractPatient_init(mArgsInfo);
-  SetGUIFromArgsInfo();
-  m_IsThreadInterrupted = false;
-
-  // Create a new ExtractPatient filter
-  mFilter = new FilterType;  // used in AddInputSelector
-
-  // Add input selector
-  AddInputSelector("Select CT thorax image", mFilter);
-}
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-vvToolExtractPatient::~vvToolExtractPatient()
-{
-}
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-void vvToolExtractPatient::Initialize() {
-  SetToolName("ExtractPatient");
-  SetToolMenuName("Extract Patient");
-  SetToolIconFilename(":/common/icons/Patient-overlay.png");
-  SetToolTip("Extract Patient mask from thorax CT.");
-  SetToolExperimental(true);
-  //  SetToolInMenu("Segmentation");
-}
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-void vvToolExtractPatient::InputIsSelected(vvSlicerManager *m)
-{
-  // Hide selector
-  HideInputSelector(); // splitter
-  mToolInputSelectionWidget->hide();
-  mCurrentSlicerManager = m;
-  mCurrentImage = m->GetImage();
-  mLabelInput->setText(m->GetFileName().c_str());
-}
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-// void vvToolExtractPatient::PatientMaskInputIsSelected()
-// {
-//   // Get Patient mask and BG value
-//   mPatient = mPatientMaskInputWidget->GetImage();  
-//   mPatientBackgroundValue = mPatientMaskInputWidget->GetBackgroundValue();
-  
-//   // Check patient dimension
-//   if (mPatient->GetNumberOfDimensions() != 3) {
-//     QMessageBox::information(this,tr("*Error*"), "Mask image must be 3D");
-//     return;
-//   }
-   
-//   mMaskLoaderBox->setEnabled(false);
-//   mOptionsBox->setEnabled(true);
-// }
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-void vvToolExtractPatient::SetGUIFromArgsInfo() 
-{
-  /*
-  mAirUpperThresholdSlider->SetText("Upper threshold for air");
-  mAirUpperThresholdSlider->SetMinimum(-1200);
-  mAirUpperThresholdSlider->SetMaximum(2000);
-  DD(mArgsInfo->upper_arg);
-  mAirUpperThresholdSlider->SetValue(mArgsInfo->upper_arg);
-
-  mAirLowerThresholdSlider->SetText("Lower threshold for air");
-  mAirLowerThresholdSlider->SetMinimum(-1200);
-  mAirLowerThresholdSlider->SetMaximum(2000);
-  mAirLowerThresholdSlider->SetValue(mArgsInfo->lower_arg);
-  */
-
-}
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-void vvToolExtractPatient::GetArgsInfoFromGUI() 
-{
-  //mArgsInfo->patientBG_arg = mPatientMaskInputWidget->GetBackgroundValue();
-  mArgsInfo->verboseOption_flag = true; // DEBUG. TO CHANGE
-  mArgsInfo->verboseStep_flag = true; // DEBUG. TO CHANGE
-  mArgsInfo->writeStep_flag = false;
-  mArgsInfo->input_given = 0;
-  //mArgsInfo->patient_given = 0;
-  mArgsInfo->output_given = 0;
-  //mArgsInfo->outputTrachea_given = 0;
-  //mArgsInfo->remove1_given = 0;
-  
- //  mArgsInfo->upper_arg = mAirUpperThresholdSlider->GetValue();
-//   mArgsInfo->lower_arg = mAirLowerThresholdSlider->GetValue();
-//   if (mRadioButtonLowerThan->isChecked()) mArgsInfo->lower_given = 1;
-}
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-void vvToolExtractPatient::apply() 
-{
-  // Change cursor to wait
-  QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
-  
-  // Read options from GUI and put it in the ArgsInfo struct
-  GetArgsInfoFromGUI();
-  
-  // Check options
-  // if (mArgsInfo->lower_given) {
-//     if (mArgsInfo->lower_arg > mArgsInfo->upper_arg) {    
-//       QApplication::restoreOverrideCursor(); 
-//       QMessageBox::information(this,tr("Error"), "Lower threshold cannot be greater than upper threshold.");
-//       return;
-//     }
-//   }
-
-  // Create new filter
-  //if (mFilter) delete mFilter;
-  DD("new filter");
-  mFilter = new FilterType;  // needed when thread cancel the filter
-  // mFilter->StopOnErrorOff();
-  //  mFilter->SetIOVerbose(true);
-  mFilter->AddInputVVImage(mCurrentImage); // CT
-//   mFilter->AddInputVVImage(mPatient); // patient mask
-  mFilter->SetArgsInfo(*mArgsInfo);
-
-  // Created threaded execution
-  DD("thread");
-  vvThreadedFilter thread;
-  connect(&thread, SIGNAL(ThreadInterrupted()), this, SLOT(ThreadInterrupted()));
-  thread.SetFilter(mFilter);
-
-  try {
-  thread.Update();
-  }
-  catch(std::runtime_error e) {
-
-  // Check if the thread has been canceled. In this case, return
-  if (m_IsThreadInterrupted) {
-    m_IsThreadInterrupted = false;
-    QApplication::restoreOverrideCursor(); 
-    return;
-  }
-  disconnect(&thread, SIGNAL(ThreadInterrupted()), this, SLOT(ThreadInterrupted()));
-    
-  // Check error during filter
-  // if (mFilter->HasError()) {
-    QApplication::restoreOverrideCursor();
-    QMessageBox::information(this,tr("Error"), e.what());//mFilter->GetLastError().c_str());
-    return;
-  // }
-
-  }
-  
-  // Get output
-  std::vector<vvImage::Pointer> output = mFilter->GetOutputVVImages();
-  if (output.size() == 0) {
-    std::cerr << "Error : no output ?" << std::endl;
-    QApplication::restoreOverrideCursor();
-    close();
-    return;
-  }
-  
-  // Set Patient into VV
-  vvImage::Pointer Patient = output[0];
-  std::ostringstream osstream;
-  osstream << "Patient_" << mCurrentSlicerManager->GetSlicer(0)->GetFileName() << ".mhd";
-  vvSlicerManager * v = AddImage(Patient,osstream.str());
-  v->SetPreset(5);
-  vvToolStructureSetManager::AddImage(mCurrentSlicerManager, "Right Patient", Patient, 1, false); // Right is greater than Left
-//   vvToolStructureSetManager::AddImage(mCurrentSlicerManager, "Left Patient", Patient, 2, false);  
-
- //  // Set trachea into VV
-//   if (output.size() == 2) {
-//     vvImage::Pointer trachea = output[1];
-//     std::ostringstream osstream;
-//     osstream << "Trachea_" << mCurrentSlicerManager->GetSlicer(0)->GetFileName() << ".mhd";
-//     vvSlicerManager * v = AddImage(trachea,osstream.str());
-//     v->SetPreset(5);
-//     vvToolStructureSetManager::AddImage(mCurrentSlicerManager, "Trachea", trachea, 0);
-//   }
-
-  // End
-  QApplication::restoreOverrideCursor();
-  close();
-}
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-bool vvToolExtractPatient::close()
-{
-  return vvToolWidgetBase::close();
-}
-//------------------------------------------------------------------------------
-
-
-//------------------------------------------------------------------------------
-void vvToolExtractPatient::ThreadInterrupted() 
-{ 
-  m_IsThreadInterrupted = true; 
-}
-//------------------------------------------------------------------------------
-
diff --git a/vv/vvToolExtractPatient.h b/vv/vvToolExtractPatient.h
deleted file mode 100644 (file)
index b355d97..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*=========================================================================
-  Program:   vv                     http://www.creatis.insa-lyon.fr/rio/vv
-
-  Authors belong to: 
-  - University of LYON              http://www.universite-lyon.fr/
-  - Léon Bérard cancer center       http://www.centreleonberard.fr
-  - CREATIS CNRS laboratory         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.
-
-  It is distributed under dual licence
-
-  - BSD        See included LICENSE.txt file
-  - CeCILL-B   http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
-===========================================================================**/
-
-#ifndef VVTOOLEXTRACTPATIENT_H
-#define VVTOOLEXTRACTPATIENT_H
-
-// clitk
-#include "clitkExtractPatientGenericFilter.h"
-#include "../segmentation/clitkExtractPatient_ggo.h"
-
-// vv
-#include "ui_vvToolExtractPatient.h"
-#include "vvToolBase.h"
-#include "vvToolWidgetBase.h"
-#include "vvROIActor.h"
-
-// qt
-#include <QtDesigner/QDesignerExportWidget>
-
-//------------------------------------------------------------------------------
-class vvToolExtractPatient:
-  public vvToolWidgetBase,
-  public vvToolBase<vvToolExtractPatient>, 
-  private Ui::vvToolExtractPatient 
-{
-  Q_OBJECT
-    public:
-  vvToolExtractPatient(vvMainWindowBase* parent=0, Qt::WindowFlags f=0);
-  ~vvToolExtractPatient();
-
-  //-----------------------------------------------------
-  static void Initialize();
-  virtual void InputIsSelected(vvSlicerManager *m);
-  void GetArgsInfoFromGUI();
-  void SetGUIFromArgsInfo();
-
-  //-----------------------------------------------------
-public slots:
-  virtual void apply();
-  virtual bool close();
-  // void PatientMaskInputIsSelected();
-  void ThreadInterrupted();
-
-  //-----------------------------------------------------
-protected:
-  typedef args_info_clitkExtractPatient ArgsInfoType;
-  ArgsInfoType * mArgsInfo;
-  typedef clitk::ExtractPatientGenericFilter<ArgsInfoType> FilterType;
-  FilterType * mFilter;
-  vvImage::Pointer mPatient;
-  double mPatientBackgroundValue;
-  bool m_IsThreadInterrupted;
-
-}; // end class vvToolExtractPatient
-//------------------------------------------------------------------------------
-
-#endif
-