]> Creatis software - cpPlugins.git/blobdiff - lib/cpExtensions/Algorithms/MacheteImageFilter.hxx
...
[cpPlugins.git] / lib / cpExtensions / Algorithms / MacheteImageFilter.hxx
index 4a381498fecd3638d6c777f8b6f7b703741f6efa..a984df17784e2548021efbb44c7047ba6689e3d0 100644 (file)
@@ -32,10 +32,10 @@ void cpExtensions::Algorithms::MacheteImageFilter<  I, O>
     otherPoint[0] = p0[0];
     otherPoint[1] = p0[1];
     otherPoint[2] = p0[2];
-    otherPoint[2] = this->point[2]; // TODO : Solve this hammer
+    //otherPoint[2] = this->point[2]; // TODO : Solve this hammer
 
     double dist = this->point.EuclideanDistanceTo(otherPoint);
-    if (dist <= this->radius)
+    if (dist <= this->m_Radius)
     {
       outputIterator.Set(0);
     }
@@ -48,18 +48,44 @@ void cpExtensions::Algorithms::MacheteImageFilter<  I, O>
     ++outputIterator;
   }
 
+  
 }
 
 template< class I, class O>
-void cpExtensions::Algorithms::MacheteImageFilter< I, O>::SetRadius(double rad){
-  this->radius = rad;
+void cpExtensions::Algorithms::MacheteImageFilter< I, O>::SetRadius(const RadiusType & rad)
+{
+  if (this->m_Radius != rad)
+  {
+    this->m_Radius = rad;
+    this->Modified();
+  }
 }
 
+//template< class I, class O>
+//void cpExtensions::Algorithms::MacheteImageFilter< I, O>::SetRadius(const RadiusValueType & rad)
+//{
+//  RadiusType r;
+//  r.Fill(rad);
+//  this->SetRadius(r);
+//}
+
 template< class I, class O>
-void cpExtensions::Algorithms::MacheteImageFilter< I, O>::SetPoint(itk::Point<double, 3> point){
-  this->point = point;
+void cpExtensions::Algorithms::MacheteImageFilter< I, O>::SetPoint(itk::Point<double, 3> & p){
+  if (point != p)
+  {
+    this->point = p;
+    this->Modified();
+  }
 }
 
+template< class I, class O>
+void cpExtensions::Algorithms::MacheteImageFilter< I, O>::SetPoint(const double & x, const double & y, const double & z)
+{
+  this->point[0] = x;
+  this->point[1] = y;
+  this->point[2] = z;
+  this->Modified();
+}