nion-software / experimental

Collection of experimental scripts in development
GNU General Public License v3.0
4 stars 4 forks source link

There should be a binning tool in MultiDimensionalProcessing #40

Open Brow71189 opened 3 months ago

Brow71189 commented 3 months ago
#### To Do
- [ ] https://github.com/nion-software/nionswift/issues/430
TomaSusi commented 3 months ago

Request from Vienna!

cmeyer commented 3 months ago

I'm close enough to implementing the general case of applying any processing to sequences/collections that I think we could focus our effort on (a) doing that; (b) implementing the 2D binning algorithm nicely; (c) providing reduction options for all potential coordinate sets.

To that end, is there anything more to the binning for an individual 2D element than "reduce by number of pixels"?

And, is there anything unique about binning in the collection/sequence coordinate systems?

Brow71189 commented 3 months ago

I think having a binning that can bin any axis of a multi-D dataset will be enough. So probably your general case will work. We just need to make sure this is fast, i.e. don't do any weird resampling but simplay sum groups of neighboring pixels, just like camera binning does.

TomaSusi commented 3 months ago

The py4DSTEM guys have some code to handle edges that might be worth glancing at: https://github.com/py4dstem/py4DSTEM/blob/dev/py4DSTEM/preprocess/preprocess.py#L155