alan-turing-institute / pixelflow

BSD 3-Clause "New" or "Revised" License
5 stars 4 forks source link

How to create a custom function that is a secondary step on regionprops measurements? #14

Open evangeline-corcoran opened 1 year ago

evangeline-corcoran commented 1 year ago

E.g. I have a script that sorts predicted seeds into valve and collects valve related measurements, but requires bbox, centroid, major axis length and minor axis length from regionprops as inputs.

Can this be run one step or would it need to be a second step after calculating regionprops features?

quantumjot commented 1 year ago

I think we could incorporate this into the PixelflowResult class that is returned, e.g. we pass an analysis or "reduce" function to pixelflow and that is automagically added to PixelflowResult

IFenton commented 1 year ago

I'm addressing this in the branch IFenton-14-CustomFunctions

IFenton commented 1 year ago

I've been considering how this can be implemented through pixelflow, and it seems there are two options:

  1. Have an option to call a secondary function within the main pixelflow function
  2. Have a separate function that takes a PixelflowResult object and does calculations on that.

@evangeline-corcoran do you have any preferences? I think I have a slightly preference for the second option, as the secondary function can't then interfere with the main pixelflow analysis, plus you could run multiple separate functions in succession, but I can see benefits to both.