From 36ba94ecef3d633c2bcd8643918671b896c81124 Mon Sep 17 00:00:00 2001 From: Eduardo Davila Date: Mon, 20 Jun 2011 07:31:51 +0000 Subject: [PATCH] no message --- packages/vtk/src/bbvtkBinaryOperations.cxx | 37 ++++------------------ packages/vtk/src/bbvtkBinaryOperations.h | 9 +++--- packages/vtk/src/bbvtkUnaryOperations.cxx | 8 ++++- packages/vtk/src/bbvtkUnaryOperations.h | 16 +++++----- 4 files changed, 25 insertions(+), 45 deletions(-) diff --git a/packages/vtk/src/bbvtkBinaryOperations.cxx b/packages/vtk/src/bbvtkBinaryOperations.cxx index 748357b..abf08b8 100644 --- a/packages/vtk/src/bbvtkBinaryOperations.cxx +++ b/packages/vtk/src/bbvtkBinaryOperations.cxx @@ -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() { diff --git a/packages/vtk/src/bbvtkBinaryOperations.h b/packages/vtk/src/bbvtkBinaryOperations.h index 54c642e..623d039 100644 --- a/packages/vtk/src/bbvtkBinaryOperations.h +++ b/packages/vtk/src/bbvtkBinaryOperations.h @@ -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); } diff --git a/packages/vtk/src/bbvtkUnaryOperations.cxx b/packages/vtk/src/bbvtkUnaryOperations.cxx index 488f175..7424ccd 100644 --- a/packages/vtk/src/bbvtkUnaryOperations.cxx +++ b/packages/vtk/src/bbvtkUnaryOperations.cxx @@ -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; } diff --git a/packages/vtk/src/bbvtkUnaryOperations.h b/packages/vtk/src/bbvtkUnaryOperations.h index 08f7515..1f13180 100644 --- a/packages/vtk/src/bbvtkUnaryOperations.h +++ b/packages/vtk/src/bbvtkUnaryOperations.h @@ -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 -- 2.47.1