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()
{
bbSetInputIn1(NULL);
bbSetInputIn2(NULL);
bbSetOutputOut(NULL);
- bbSetInputInConstant(0);
+ bbSetInputOperation(0);
ope = vtkImageMathematics::New();
constante = NULL;
}
+
+
void BinaryOperations::bbUserInitializeProcessing()
{
// but this is where you should allocate the internal/output pointers
// if any
-
}
+
+
void BinaryOperations::bbUserFinalizeProcessing()
{
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();
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);
}
break;
case 1:
- crearPredeterminado();
+//EED Borrame crearPredeterminado();
ope->SetInput2((vtkDataSet*) constante);
ope->SetOperationToSubtract();
break;
bbSignalOutputModification();
}
+
+/* Borrame Eduardo - Juan Pablo
void UnaryOperations::crearPredeterminado()
{
int ext[6];
}
}
}
+*/
+
+
void UnaryOperations::substractWithMinimum()
{
int ext[6];
// bbSetInputIn2(NULL);
bbSetOutputOut(NULL);
bbSetInputInConstant(0);
+ bbSetInputOperation(0);
ope = vtkImageMathematics::New();
constante = NULL;
}
};
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