CERN / CERN/TIGRE

Add projection binning utility

Open
#381 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
MATLAB
Stars
803
Forks
262
Avg merge
9d 13h
Merged PRs (30d)
8

Description

a python code would be e.g.:

```
def BinProjection(array, factor, average=True):
if average:
if array.shape[0] % factor or array.shape[1] % factor:
array = array[
: (array.shape[0] // factor) * factor, : (array.shape[1] // factor) * factor
]
shape = (array.shape[0] // factor, factor, array.shape[1] // factor, factor)
return array.reshape(shape).mean(axis=(-1, 1), dtype=numpy.float32)
else:
return array[::factor, ::factor]
```

Ideally it also gets geometry as input and it modifies it accordingly. MATLAB code also is useful.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.