bbSetOutputOut(NULL);
return;
}
- switch (bbGetInputOperation())
- {
- case 0:
- ope->SetOperationToAdd();
- break;
- case 1:
- ope->SetOperationToSubtract();
-
- break;
- case 2:
- ope->SetOperationToMultiply();
- break;
- case 3:
- ope->SetOperationToDivide();
- break;
- case 4:
- ope->SetOperationToMax();
- break;
- case 5:
- ope->SetOperationToMin();
- break;
- default:
- std::cout << "Invalid Operation" << std::endl;
- return;
- break;
- }
- ope->Modified();
- ope->Update();
- vtkImageData* salida = ope->GetOutput();
- bbSetOutputOut(salida);
+
+ if ( (bbGetInputOperation()>=0) && (bbGetInputOperation()<=5) )
+ {
+ switch (bbGetInputOperation())
+ {
+ case 0:
+ ope->SetOperationToAdd();
+ break;
+ case 1:
+ ope->SetOperationToSubtract();
+ break;
+ case 2:
+ ope->SetOperationToMultiply();
+ break;
+ case 3:
+ ope->SetOperationToDivide();
+ break;
+ case 4:
+ ope->SetOperationToMax();
+ break;
+ case 5:
+ ope->SetOperationToMin();
+ break;
+ default:
+ std::cout << "Invalid Operation" << std::endl;
+ return;
+ break;
+ }
+ ope->Modified();
+ ope->Update();
+ bbSetOutputOut( ope->GetOutput() );
+ } // if operation 0..5
+
+ if ( bbGetInputOperation()==6 )
+ {
+ bbSetOutputOut( bbGetInputIn1() );
+ }
+ if ( bbGetInputOperation()==7 )
+ {
+ bbSetOutputOut( bbGetInputIn2() );
+ }
+
// bbSignalOutputModification();
}
BBTK_CATEGORY("filter");
BBTK_INPUT(BinaryOperations,In1,"first image to be operated",vtkImageData*,"NULL default");
BBTK_INPUT(BinaryOperations,In2,"second image to be operated",vtkImageData*,"NULL default");
- BBTK_INPUT(BinaryOperations,Operation,"0:Add (default) , 1:subtract, 2:multiply, 3:divide, 4=Max, 5=Min",int,"");
+ BBTK_INPUT(BinaryOperations,Operation,"0:Add (default) , 1:subtract, 2:multiply, 3:divide, 4=Max, 5=Min, 6=Replace with In1, 7=Replace with In2",int,"");
BBTK_OUTPUT(BinaryOperations,Out,"",vtkImageData*,"");
BBTK_END_DESCRIBE_BLACK_BOX(BinaryOperations);
}