Skip to content

Handling 16bit image depth data correctly#5

Closed
CV-GPhL wants to merge 6 commits into
dectris-cloud:masterfrom
CV-GPhL:master
Closed

Handling 16bit image depth data correctly#5
CV-GPhL wants to merge 6 commits into
dectris-cloud:masterfrom
CV-GPhL:master

Conversation

@CV-GPhL

@CV-GPhL CV-GPhL commented Nov 8, 2019

Copy link
Copy Markdown

Added missing include file (for compilation with Intel Compiler v16)
Added missing include (for compilation with Intel v16 compiler)
Added missing include file (for compilation with Intel v16 compiler)
…ently active/inactive pixels stored in image data array as 2^32-1)

Without that change those data items will be passed to the data processing software incorrectly: for details see
 https://www.globalphasing.com/autoproc/wiki/index.cgi?DataProcessingHdf5Eiger16bit201910

template<class T> void applyMaskAndTransformToInt32(const T * indata, int outdata[], const uint32_t * maskData, size_t size) {
constexpr size_t maxSigned = (size_t)std::numeric_limits<int32_t>::max();
template<class T> void applyMaskAndTransformToInt32(const T * indata, int outdata[], const uint32_t * maskData, size_t size, size_t maxSigned) {

@pilipp pilipp Nov 8, 2019

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simpler:
#include <type_traits>
constexpr size_t maxSigned = (size_t)std::numeric_limits<std::make_signed<T>::type>::max();

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely: I'm no C++ expert by a (very) long stretch ... The main idea was to show you what I did to resolve the 16/32-bit issue and you can take the lead in providing the "proper" solution here.

@pilipp pilipp closed this Oct 30, 2020
@pilipp

pilipp commented Oct 30, 2020

Copy link
Copy Markdown
Contributor

The change has been performed in a different PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants