]> Creatis software - bbtk.git/commitdiff
no message
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Mon, 20 Jun 2011 07:31:51 +0000 (07:31 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Mon, 20 Jun 2011 07:31:51 +0000 (07:31 +0000)
packages/vtk/src/bbvtkBinaryOperations.cxx
packages/vtk/src/bbvtkBinaryOperations.h
packages/vtk/src/bbvtkUnaryOperations.cxx
packages/vtk/src/bbvtkUnaryOperations.h

index 748357bcad6c345ba6bfebfb95d2a66c0d2e765a..abf08b8eadb90adfb2796653cfa239d9191676b2 100644 (file)
@@ -70,35 +70,7 @@ void BinaryOperations::Process()
        bbSignalOutputModification();
 
 }
-void BinaryOperations::crearPredeterminado()
-{
-       int ext[6];
-       vtkImageData* inicial = bbGetInputIn1();
-
-
-       if (constante == NULL)
-       {
-               inicial->GetExtent(ext);
-               constante = vtkImageData::New();
-               constante->SetExtent(ext);
-               constante->SetScalarType(inicial->GetScalarType());
-               constante->AllocateScalars();
-               constante->Update();
-       }
-
-       for (int i=ext[0]; i<=ext[1]; i++)
-       {
-               for (int j=ext[2]; j<=ext[3]; j++)
-               {
-                       for (int k=ext[4]; k<=ext[5]; k++)
-                       {
-                               unsigned short* value = (unsigned short*)constante->GetScalarPointer(i,j,k);
-                               *value = bbGetInputInConstant();
-                       }
-               }
-       }
-}
-
+       
 
 void BinaryOperations::bbUserSetDefaultValues()
 {
@@ -108,10 +80,12 @@ void BinaryOperations::bbUserSetDefaultValues()
    bbSetInputIn1(NULL);
    bbSetInputIn2(NULL);
    bbSetOutputOut(NULL);
-   bbSetInputInConstant(0);
+   bbSetInputOperation(0);
    ope = vtkImageMathematics::New();
    constante = NULL;
 }
+       
+       
 void BinaryOperations::bbUserInitializeProcessing()
 {
 
@@ -120,8 +94,9 @@ void BinaryOperations::bbUserInitializeProcessing()
 //    but this is where you should allocate the internal/output pointers
 //    if any
 
-
 }
+       
+       
 void BinaryOperations::bbUserFinalizeProcessing()
 {
 
index 54c642e37db44037c01223e92a8d39a4aeb9be2b..623d03923a20a3c473116c3a83f0844514eca8f5 100644 (file)
@@ -25,7 +25,6 @@ class bbvtk_EXPORT BinaryOperations
   BBTK_DECLARE_INPUT(In1,vtkImageData*);
   BBTK_DECLARE_INPUT(In2,vtkImageData*);
   BBTK_DECLARE_INPUT(Operation,int);
-  BBTK_DECLARE_INPUT(InConstant,double);
   BBTK_DECLARE_OUTPUT(Out,vtkImageData*);
   BBTK_PROCESS(Process);
   void Process();
@@ -42,12 +41,12 @@ class bbvtk_EXPORT BinaryOperations
 
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(BinaryOperations,bbtk::AtomicBlackBox);
 BBTK_NAME("BinaryOperations");
-BBTK_AUTHOR("_author_");
-BBTK_DESCRIPTION("_description_");
-BBTK_CATEGORY("__CATEGORY__");
+BBTK_AUTHOR("Info-Dev");
+BBTK_DESCRIPTION("Math operation between two images");
+BBTK_CATEGORY("filter");
 BBTK_INPUT(BinaryOperations,In1,"",vtkImageData*,"");
 BBTK_INPUT(BinaryOperations,In2,"",vtkImageData*,"");
-BBTK_INPUT(BinaryOperations,Operation,"0:Add, 1:subtract, 2:multiply, 3:divide",int,"");
+BBTK_INPUT(BinaryOperations,Operation,"0:Add (default) , 1:subtract, 2:multiply, 3:divide",int,"");
 BBTK_OUTPUT(BinaryOperations,Out,"",vtkImageData*,"");
 BBTK_END_DESCRIBE_BLACK_BOX(BinaryOperations);
 }
index 488f175881d5753877444e5a7a0915fce9c6d42b..7424ccd5a4ed7a855d08ad89e02ec747287eaf80 100644 (file)
@@ -40,7 +40,7 @@ void UnaryOperations::Process()
 
                break;
                case 1:
-                               crearPredeterminado();
+//EED Borrame                          crearPredeterminado();
                                ope->SetInput2((vtkDataSet*) constante);
                                ope->SetOperationToSubtract();
                break;
@@ -99,6 +99,8 @@ void UnaryOperations::Process()
        bbSignalOutputModification();
 
 }
+       
+/* Borrame Eduardo - Juan Pablo
 void UnaryOperations::crearPredeterminado()
 {
        int ext[6];
@@ -127,6 +129,9 @@ void UnaryOperations::crearPredeterminado()
                }
        }
 }
+*/
+
+       
 void UnaryOperations::substractWithMinimum()
 {
        int ext[6];
@@ -208,6 +213,7 @@ void UnaryOperations::bbUserSetDefaultValues()
 //   bbSetInputIn2(NULL);
    bbSetOutputOut(NULL);
    bbSetInputInConstant(0);
+   bbSetInputOperation(0);
    ope = vtkImageMathematics::New();
    constante = NULL;
 }
index 08f751594c5b3758dc3ddb742a8bfc02bf4d6812..1f1318041e9cf8b6c627791f6e1d6a4fba36737c 100644 (file)
@@ -41,14 +41,14 @@ class bbvtk_EXPORT UnaryOperations
 };
 
 BBTK_BEGIN_DESCRIBE_BLACK_BOX(UnaryOperations,bbtk::AtomicBlackBox);
-BBTK_NAME("UnaryOperations");
-BBTK_AUTHOR("_author_");
-BBTK_DESCRIPTION("_description_");
-BBTK_CATEGORY("__CATEGORY__");
-BBTK_INPUT(UnaryOperations,In1,"",vtkImageData*,"");
-BBTK_INPUT(UnaryOperations,InConstant,"",double,"");
-BBTK_INPUT(UnaryOperations,Operation,"0:Add, 1:subtract, 2:multiply, 3:divide, 4:invert, 5:sin, 6:cos, 7:exp, 8:log, 9:abs",int,"");
-BBTK_OUTPUT(UnaryOperations,Out,"",vtkImageData*,"");
+  BBTK_NAME("UnaryOperations");
+  BBTK_AUTHOR("Info-Dev Creatis");
+  BBTK_DESCRIPTION("math operation over an image");
+  BBTK_CATEGORY("filtre");
+  BBTK_INPUT(UnaryOperations,In1,"",vtkImageData*,"");
+  BBTK_INPUT(UnaryOperations,InConstant,"",double,"0 default");
+  BBTK_INPUT(UnaryOperations,Operation,"0:Add (Default), 1:subtract, 2:multiply, 3:divide, 4:invert, 5:sin, 6:cos, 7:exp, 8:log, 9:abs",int,"");
+  BBTK_OUTPUT(UnaryOperations,Out,"",vtkImageData*,"");
 BBTK_END_DESCRIBE_BLACK_BOX(UnaryOperations);
 }
 // EO namespace bbSimpleProcessing