mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2025-06-19 18:47:13 +02:00
add python bindings for numpy
This commit is contained in:
@ -25,5 +25,17 @@ DataType Frame<DataType>::get(int row, int col) {
|
||||
return m_data[row*m_cols + col];
|
||||
}
|
||||
|
||||
template <typename DataType>
|
||||
std::vector<std::vector<DataType>> Frame<DataType>::get_array() {
|
||||
std::vector<std::vector<DataType>> array;
|
||||
for (int i = 0; i < m_rows; i++) {
|
||||
std::vector<DataType> row;
|
||||
row.assign(m_data + i*m_cols, m_data + (i+1)*m_cols);
|
||||
array.push_back(row);
|
||||
}
|
||||
|
||||
return array;
|
||||
}
|
||||
|
||||
|
||||
template class Frame<uint16_t>;
|
||||
|
Reference in New Issue
Block a user