Hi Andrés,
Definitely no bug here
In your test case, you aren't applying the same DBE instances with and without a ProcessContainer. In the first step (when the DBE instance is applied through a container) I1's background is subtracted, since you first open the DBE icon over I1. In the second step, you select I2_clone and open the DBE icon. When you do this, DBE recomputes all background samples over I2_clone. When you apply, I2_clone's background is subtracted.
To prove this, modify your test case as follows:
- Load I1, I2 and TestDBE.psm.
- Open ProcessContainer, reset it, and drag the DBE icon to it.
- Drag the DBE icon to I1 (do not open the icon, just drag).
- Drag the ProcessContainer to I2.
Both results are identical, as expected.
When you open the DBE interface, all background samples are automatically recalculated for the selected image. In this way you can be sure the generated background model is coherent with the working image. Now that DBE can modify images, we have opened the door to potentially confusing situations like this one
Special care is needed to keep track of which background model is being "transported" by each DBE instance.
Thank you for your nice test example. As Sander has said, it's great when things are described so concisely and accurately.