DiamondLightSource / DiamondLightSource/httomo

Check use of `global_index` in image saver wrapper when given a padded block

Open
#407 0 comments 0 reactions 0 assignees View on GitHub
framework
Dominant language
Python
Stars
10
Forks
5
Avg merge
5d 17h
Merged PRs (30d)
1

Description

Due to how indices are shifted when padding is introduced, the `global_index` of a block can be negative (namely, with non-zero padding, the very first block in a chunk will have a negative index in the slicing dim of `global_index`).

The image saver wrapper uses the `global_index` property on a block to determine the offset that the image filenames should have : https://github.com/DiamondLightSource/httomo/blob/4629a0fd99c9be2076eb81bae29cac13cc61c82c/httomo/method_wrappers/images.py#L56-L60

In the development of padding, a `global_index_unpadded` property was added to blocks to provide easy access to an unpadded version of the `global_index`.

In the context of a padded block being saved by the image saver wrapper, because `global_index` can be negative in the slicing dim, it needs to be checked if `global_index` should be used for the offset calculation, or if it should be replaced by `global_index_padded`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.