Commit d7774a4
committed
Mask out invalid pixels in the polar view
This makes it so that any invalid pixels (as defined by the detector's
panel buffer) do not have an effect on the resulting polar image and
lineout. Any polar view pixels that were interpolated with an invalid
pixel will be nan.
The intended usage is as follows:
```python
img = pv.warp_image(image_dict, pad_with_nans=True,
do_interpolation=True)
cake = np.mean(img, axis=0)
```
The `img` that is returned from the warp image is a masked array,
with all invalid pixels being masked out. If `np.mean(img, axis=0)` is
applied to this, it ignores all masked out pixels when computing the
mean along the axis (which is the behavior we want). This is preferred
over doing something like `np.sum(img.filled(0), axis=0)`, since columns
with invalid pixels will be reduced in value.
Signed-off-by: Patrick Avery <patrick.avery@kitware.com>1 parent c6f1247 commit d7774a4
2 files changed
+47
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
325 | 326 | | |
326 | 327 | | |
327 | 328 | | |
| 329 | + | |
| 330 | + | |
328 | 331 | | |
329 | 332 | | |
330 | 333 | | |
331 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
332 | 348 | | |
333 | 349 | | |
334 | 350 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
0 commit comments