Author Topic: PixelMath shared variables across instances  (Read 496 times)

Offline robyx

  • Newcomer
  • Posts: 47
PixelMath shared variables across instances
« on: 2019 August 22 14:31:21 »
Hi all,

I'm dealing with this problem: I have this formula

mean(A)/$T

where $T is the target image and A is another image in the workspace. Actually I could refer to A using his ID but this means that I need to edit the formula anytime the ID changes so I would do something smarter to avoid this.

I would brake down the computation into two PixelMath instances X and Y such that X can be dragged on image A and it produces as output mean(A) and then Y can be dragged on any target image to compute mean(A)/$T. In this way I wouldn't need to edit the formula anymore, I would just need to drag the instance X on image A and instance Y on my target.

Let's say that the first PixelMath would look like

Code: [Select]
Calib_A_Mean = mean(A)
and the second one

Code: [Select]
Calib_A_Mean/$T
being Calib_A_Mean a global shared variable initialized by X and read by Y.

My issue is that I cannot find a way to declare a symbol with this properties.
Is that feasible?
if not is there any plan to implement this kind of global scope for variables in PixelMath? in my opinion it would really open new possibilities.

Kind regards,
Roberto