mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-02-25 13:28:44 +01:00
Dev/multiple rois in aare (#263)
Reading multiple ROI's for aare - read_frame, read_n etc throws for multiple ROIs - new functions read_ROIs, read_n_ROIs - read_roi_into (used for python bindings - to not copy) all these functions use get_frame or get_frame_into where one passes the roi_index ## Refactoring: - each roi keeps track of its subfiles that one has to open e.g. subfiles can be opened several times - refactored class DetectorGeometry - keep track of the updated module geometries in new class ROIGeometry. - ModuleGeometry updates based on ROI ## ROIGeometry: - stores number of modules overlapping with ROI and its indices - size of ROI Note: only tested size of the resulting frames not the actual values --------- Co-authored-by: Erik Fröjdh <erik.frojdh@psi.ch> Co-authored-by: Erik Fröjdh <erik.frojdh@gmail.com>
This commit is contained in:
330
src/RawFile.cpp
330
src/RawFile.cpp
@@ -2,6 +2,7 @@
|
||||
#include "aare/RawFile.hpp"
|
||||
#include "aare/DetectorGeometry.hpp"
|
||||
#include "aare/PixelMap.hpp"
|
||||
#include "aare/ROIGeometry.hpp"
|
||||
#include "aare/algorithm.hpp"
|
||||
#include "aare/defs.hpp"
|
||||
#include "aare/logger.hpp"
|
||||
@@ -17,28 +18,98 @@ RawFile::RawFile(const std::filesystem::path &fname, const std::string &mode)
|
||||
: m_master(fname),
|
||||
m_geometry(m_master.geometry(), m_master.pixels_x(), m_master.pixels_y(),
|
||||
m_master.udp_interfaces_per_module(), m_master.quad()) {
|
||||
|
||||
m_mode = mode;
|
||||
|
||||
m_subfiles.resize(m_master.rois().has_value() ? m_master.rois()->size()
|
||||
: 1);
|
||||
|
||||
if (mode == "r") {
|
||||
if (m_master.roi()) {
|
||||
m_geometry.update_geometry_with_roi(m_master.roi().value());
|
||||
if (m_master.rois().has_value()) {
|
||||
m_ROI_geometries.reserve(m_master.rois()->size());
|
||||
|
||||
// iterate over all ROIS
|
||||
size_t roi_index = 0;
|
||||
const auto rois = m_master.rois().value();
|
||||
for (const auto &roi : rois) {
|
||||
m_ROI_geometries.push_back(ROIGeometry(roi, m_geometry));
|
||||
// open subfiles
|
||||
open_subfiles(roi_index);
|
||||
++roi_index;
|
||||
}
|
||||
|
||||
} else {
|
||||
// no ROI use full detector
|
||||
m_ROI_geometries.reserve(1);
|
||||
m_ROI_geometries.push_back(ROIGeometry(m_geometry));
|
||||
open_subfiles(0);
|
||||
}
|
||||
open_subfiles();
|
||||
} else {
|
||||
throw std::runtime_error(LOCATION +
|
||||
" Unsupported mode. Can only read RawFiles.");
|
||||
}
|
||||
}
|
||||
|
||||
Frame RawFile::read_frame() { return get_frame(m_current_frame++); }
|
||||
Frame RawFile::read_roi(const size_t roi_index) {
|
||||
|
||||
if (!m_master.rois()) {
|
||||
throw std::runtime_error(LOCATION +
|
||||
"No ROIs defined in the master file.");
|
||||
}
|
||||
if (roi_index >= m_ROI_geometries.size()) {
|
||||
throw std::runtime_error(LOCATION + "ROI index out of range.");
|
||||
}
|
||||
return get_frame(m_current_frame++, roi_index);
|
||||
}
|
||||
|
||||
|
||||
std::vector<Frame> RawFile::read_rois() {
|
||||
|
||||
if (!m_master.rois()) {
|
||||
throw std::runtime_error(LOCATION +
|
||||
"No ROIs defined in the master file.");
|
||||
}
|
||||
|
||||
const size_t num_rois = m_ROI_geometries.size();
|
||||
|
||||
std::vector<Frame> frames;
|
||||
frames.reserve(num_rois);
|
||||
|
||||
for (size_t roi_idx = 0; roi_idx < num_rois; ++roi_idx) {
|
||||
frames.push_back(get_frame(m_current_frame, roi_idx));
|
||||
}
|
||||
++m_current_frame;
|
||||
|
||||
return frames;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Frame RawFile::read_frame() {
|
||||
if (m_master.rois().has_value() && m_master.rois()->size() > 1) {
|
||||
throw std::runtime_error(LOCATION +
|
||||
"Multiple ROIs defined in the master file. "
|
||||
"Use read_ROIs() instead.");
|
||||
}
|
||||
return get_frame(m_current_frame++);
|
||||
}
|
||||
|
||||
Frame RawFile::read_frame(size_t frame_number) {
|
||||
if (m_master.rois().has_value() && m_master.rois()->size() > 1) {
|
||||
throw std::runtime_error(
|
||||
LOCATION + "Multiple ROIs defined in the master file. "
|
||||
"Use read_ROIs(const size_t frame_number) instead.");
|
||||
}
|
||||
seek(frame_number);
|
||||
return read_frame();
|
||||
}
|
||||
|
||||
void RawFile::read_into(std::byte *image_buf, size_t n_frames) {
|
||||
// TODO: implement this in a more efficient way
|
||||
if (m_master.rois().has_value() && m_master.rois()->size() > 1) {
|
||||
throw std::runtime_error(LOCATION +
|
||||
"Cannot use read_into for multiple ROIs.");
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < n_frames; i++) {
|
||||
this->get_frame_into(m_current_frame++, image_buf);
|
||||
@@ -47,33 +118,83 @@ void RawFile::read_into(std::byte *image_buf, size_t n_frames) {
|
||||
}
|
||||
|
||||
void RawFile::read_into(std::byte *image_buf) {
|
||||
if (m_master.rois().has_value() && m_master.rois()->size() > 1) {
|
||||
throw std::runtime_error(LOCATION +
|
||||
"Cannot use read_into for multiple ROIs. Use "
|
||||
"read_roi_into() for a single ROI instead.");
|
||||
}
|
||||
return get_frame_into(m_current_frame++, image_buf);
|
||||
}
|
||||
|
||||
void RawFile::read_into(std::byte *image_buf, DetectorHeader *header) {
|
||||
void RawFile::read_roi_into(std::byte *image_buf, const size_t roi_index,
|
||||
const size_t frame_number, DetectorHeader *header) {
|
||||
if (!m_master.rois().has_value()) {
|
||||
throw std::runtime_error(LOCATION +
|
||||
"No ROIs defined in the master file.");
|
||||
}
|
||||
if (roi_index >= num_rois()) {
|
||||
throw std::runtime_error(LOCATION + "ROI index out of range.");
|
||||
}
|
||||
return get_frame_into(frame_number, image_buf, roi_index, header);
|
||||
}
|
||||
|
||||
return get_frame_into(m_current_frame++, image_buf, header);
|
||||
void RawFile::read_into(std::byte *image_buf, DetectorHeader *header) {
|
||||
if (m_master.rois().has_value() && m_master.rois()->size() > 1) {
|
||||
throw std::runtime_error(LOCATION +
|
||||
"Cannot use read_into for multiple ROIs. Use "
|
||||
"read_roi_into() for a single ROI instead.");
|
||||
}
|
||||
return get_frame_into(m_current_frame++, image_buf, 0, header);
|
||||
}
|
||||
|
||||
void RawFile::read_into(std::byte *image_buf, size_t n_frames,
|
||||
DetectorHeader *header) {
|
||||
// return get_frame_into(m_current_frame++, image_buf, header);
|
||||
|
||||
if (m_master.rois().has_value() && m_master.rois()->size() > 1) {
|
||||
throw std::runtime_error(
|
||||
LOCATION +
|
||||
"Cannot use read_into for multiple ROIs."); // TODO: maybe pass
|
||||
// roi_index so one can
|
||||
// use read_into for a
|
||||
// specific ROI
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < n_frames; i++) {
|
||||
this->get_frame_into(m_current_frame++, image_buf, header);
|
||||
this->get_frame_into(m_current_frame++, image_buf, 0, header);
|
||||
image_buf += bytes_per_frame();
|
||||
if (header)
|
||||
header += m_geometry.n_modules_in_roi();
|
||||
header += m_ROI_geometries[0].num_modules_in_roi();
|
||||
}
|
||||
}
|
||||
|
||||
size_t RawFile::bytes_per_frame() {
|
||||
return m_geometry.pixels_x() * m_geometry.pixels_y() * m_master.bitdepth() /
|
||||
if (m_master.rois().has_value() && m_master.rois()->size() > 1) {
|
||||
throw std::runtime_error(
|
||||
LOCATION + "Pass the desired roi_index to bytes_per_frame to get "
|
||||
"bytes_per_frame for the specific ROI. ");
|
||||
}
|
||||
return bytes_per_frame(0);
|
||||
}
|
||||
|
||||
size_t RawFile::bytes_per_frame(const size_t roi_index) {
|
||||
return m_ROI_geometries.at(roi_index).pixels_x() *
|
||||
m_ROI_geometries.at(roi_index).pixels_y() * m_master.bitdepth() /
|
||||
bits_per_byte;
|
||||
}
|
||||
|
||||
size_t RawFile::pixels_per_frame() {
|
||||
// return m_rows * m_cols;
|
||||
return m_geometry.pixels_x() * m_geometry.pixels_y();
|
||||
if (m_master.rois().has_value() && m_master.rois()->size() > 1) {
|
||||
throw std::runtime_error(
|
||||
LOCATION + "Pass the desired roi_index to pixels_per_frame to get "
|
||||
"pixels_per_frame for the specific ROI. ");
|
||||
}
|
||||
return pixels_per_frame(0);
|
||||
}
|
||||
|
||||
size_t RawFile::pixels_per_frame(const size_t roi_index) {
|
||||
return m_ROI_geometries.at(roi_index).pixels_x() *
|
||||
m_ROI_geometries.at(roi_index).pixels_y();
|
||||
}
|
||||
|
||||
DetectorType RawFile::detector_type() const { return m_master.detector_type(); }
|
||||
@@ -93,8 +214,29 @@ void RawFile::seek(size_t frame_index) {
|
||||
size_t RawFile::tell() { return m_current_frame; }
|
||||
|
||||
size_t RawFile::total_frames() const { return m_master.frames_in_file(); }
|
||||
size_t RawFile::rows() const { return m_geometry.pixels_y(); }
|
||||
size_t RawFile::cols() const { return m_geometry.pixels_x(); }
|
||||
|
||||
size_t RawFile::rows() const {
|
||||
if (m_master.rois().has_value() && m_master.rois()->size() > 1) {
|
||||
throw std::runtime_error(LOCATION +
|
||||
"Pass the desired roi_index to rows to get "
|
||||
"rows for the specific ROI. ");
|
||||
}
|
||||
return rows(0);
|
||||
}
|
||||
size_t RawFile::rows(const size_t roi_index) const {
|
||||
return m_ROI_geometries.at(roi_index).pixels_y();
|
||||
}
|
||||
size_t RawFile::cols() const {
|
||||
if (m_master.rois().has_value() && m_master.rois()->size() > 1) {
|
||||
throw std::runtime_error(LOCATION +
|
||||
"Pass the desired roi_index to cols to get "
|
||||
"cols for the specific ROI. ");
|
||||
}
|
||||
return cols(0);
|
||||
}
|
||||
size_t RawFile::cols(const size_t roi_index) const {
|
||||
return m_ROI_geometries.at(roi_index).pixels_x();
|
||||
}
|
||||
size_t RawFile::bitdepth() const { return m_master.bitdepth(); }
|
||||
xy RawFile::geometry() const {
|
||||
return xy{static_cast<uint32_t>(m_geometry.modules_y()),
|
||||
@@ -102,19 +244,46 @@ xy RawFile::geometry() const {
|
||||
}
|
||||
|
||||
size_t RawFile::n_modules() const { return m_geometry.n_modules(); };
|
||||
size_t RawFile::n_modules_in_roi() const {
|
||||
return m_geometry.n_modules_in_roi();
|
||||
|
||||
size_t RawFile::num_rois() const {
|
||||
if (m_master.rois().has_value()) {
|
||||
return m_master.rois()->size();
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
void RawFile::open_subfiles() {
|
||||
if (m_mode == "r")
|
||||
for (size_t i : m_geometry.get_modules_in_roi()) {
|
||||
auto pos = m_geometry.get_module_geometries(i);
|
||||
m_subfiles.emplace_back(std::make_unique<RawSubFile>(
|
||||
const ROIGeometry &RawFile::roi_geometries(size_t roi_index) const {
|
||||
return m_ROI_geometries[roi_index];
|
||||
}
|
||||
|
||||
std::vector<size_t> RawFile::n_modules_in_roi() const {
|
||||
|
||||
std::vector<size_t> results(m_ROI_geometries.size());
|
||||
std::transform(
|
||||
m_ROI_geometries.begin(), m_ROI_geometries.end(), results.begin(),
|
||||
[](const ROIGeometry &roi) { return roi.num_modules_in_roi(); });
|
||||
return results;
|
||||
};
|
||||
|
||||
void RawFile::open_subfiles(const size_t roi_index) {
|
||||
|
||||
if (m_mode == "r") {
|
||||
|
||||
m_subfiles[roi_index].reserve(
|
||||
m_ROI_geometries[roi_index].num_modules_in_roi());
|
||||
|
||||
auto module_indices =
|
||||
m_ROI_geometries[roi_index].module_indices_in_roi();
|
||||
|
||||
for (const size_t i :
|
||||
m_ROI_geometries[roi_index].module_indices_in_roi()) {
|
||||
const auto pos = m_geometry.get_module_geometries(i);
|
||||
m_subfiles[roi_index].emplace_back(std::make_unique<RawSubFile>(
|
||||
m_master.data_fname(i, 0), m_master.detector_type(), pos.height,
|
||||
pos.width, m_master.bitdepth(), pos.row_index, pos.col_index));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
throw std::runtime_error(LOCATION +
|
||||
"Unsupported mode. Can only read RawFiles.");
|
||||
}
|
||||
@@ -139,33 +308,37 @@ DetectorHeader RawFile::read_header(const std::filesystem::path &fname) {
|
||||
|
||||
RawMasterFile RawFile::master() const { return m_master; }
|
||||
|
||||
Frame RawFile::get_frame(size_t frame_index) {
|
||||
auto f = Frame(m_geometry.pixels_y(), m_geometry.pixels_x(),
|
||||
Frame RawFile::get_frame(size_t frame_index, const size_t roi_index) {
|
||||
auto f = Frame(m_ROI_geometries[roi_index].pixels_y(),
|
||||
m_ROI_geometries[roi_index].pixels_x(),
|
||||
Dtype::from_bitdepth(m_master.bitdepth()));
|
||||
std::byte *frame_buffer = f.data();
|
||||
get_frame_into(frame_index, frame_buffer);
|
||||
get_frame_into(frame_index, frame_buffer, roi_index);
|
||||
return f;
|
||||
}
|
||||
|
||||
size_t RawFile::bytes_per_pixel() const { return m_master.bitdepth() / 8; }
|
||||
|
||||
void RawFile::get_frame_into(size_t frame_index, std::byte *frame_buffer,
|
||||
DetectorHeader *header) {
|
||||
const size_t roi_index, DetectorHeader *header) {
|
||||
LOG(logDEBUG) << "RawFile::get_frame_into(" << frame_index << ")";
|
||||
if (frame_index >= total_frames()) {
|
||||
throw std::runtime_error(LOCATION + "Frame number out of range");
|
||||
}
|
||||
std::vector<size_t> frame_numbers(m_geometry.n_modules_in_roi());
|
||||
std::vector<size_t> frame_indices(m_geometry.n_modules_in_roi(),
|
||||
frame_index);
|
||||
std::vector<size_t> frame_numbers(
|
||||
m_ROI_geometries[roi_index].num_modules_in_roi());
|
||||
std::vector<size_t> frame_indices(
|
||||
m_ROI_geometries[roi_index].num_modules_in_roi(), frame_index);
|
||||
|
||||
// sync the frame numbers
|
||||
|
||||
if (m_geometry.n_modules() != 1) { // if we have more than one module
|
||||
for (size_t part_idx = 0; part_idx != m_geometry.n_modules_in_roi();
|
||||
if (m_ROI_geometries[roi_index].num_modules_in_roi() !=
|
||||
1) { // if we have more than one module
|
||||
for (size_t part_idx = 0;
|
||||
part_idx != m_ROI_geometries[roi_index].num_modules_in_roi();
|
||||
++part_idx) {
|
||||
frame_numbers[part_idx] =
|
||||
m_subfiles[part_idx]->frame_number(frame_index);
|
||||
m_subfiles[roi_index][part_idx]->frame_number(frame_index);
|
||||
}
|
||||
|
||||
// 1. if frame number vector is the same break
|
||||
@@ -176,7 +349,8 @@ void RawFile::get_frame_into(size_t frame_index, std::byte *frame_buffer,
|
||||
frame_numbers.begin(),
|
||||
std::min_element(frame_numbers.begin(), frame_numbers.end()));
|
||||
|
||||
// 3. increase its index and update its respective frame number
|
||||
// 3. increase its index and update its respective frame
|
||||
// number
|
||||
frame_indices[min_frame_idx]++;
|
||||
|
||||
// 4. if we can't increase its index => throw error
|
||||
@@ -186,42 +360,50 @@ void RawFile::get_frame_into(size_t frame_index, std::byte *frame_buffer,
|
||||
}
|
||||
|
||||
frame_numbers[min_frame_idx] =
|
||||
m_subfiles[min_frame_idx]->frame_number(
|
||||
m_subfiles[roi_index][min_frame_idx]->frame_number(
|
||||
frame_indices[min_frame_idx]);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_master.geometry().col == 1) {
|
||||
// get the part from each subfile and copy it to the frame
|
||||
for (size_t part_idx = 0; part_idx != m_geometry.n_modules_in_roi();
|
||||
for (size_t part_idx = 0;
|
||||
part_idx != m_ROI_geometries[roi_index].num_modules_in_roi();
|
||||
++part_idx) {
|
||||
auto corrected_idx = frame_indices[part_idx];
|
||||
|
||||
// This is where we start writing
|
||||
auto offset = (m_geometry
|
||||
.get_module_geometries(
|
||||
m_geometry.get_modules_in_roi(part_idx))
|
||||
.origin_y *
|
||||
m_geometry.pixels_x() +
|
||||
m_geometry
|
||||
.get_module_geometries(
|
||||
m_geometry.get_modules_in_roi(part_idx))
|
||||
.origin_x) *
|
||||
m_master.bitdepth() / 8;
|
||||
auto offset =
|
||||
(m_geometry
|
||||
.get_module_geometries(
|
||||
m_ROI_geometries[roi_index].module_indices_in_roi(
|
||||
part_idx))
|
||||
.origin_y *
|
||||
m_ROI_geometries[roi_index].pixels_x() +
|
||||
m_geometry
|
||||
.get_module_geometries(
|
||||
m_ROI_geometries[roi_index].module_indices_in_roi(
|
||||
part_idx))
|
||||
.origin_x) *
|
||||
m_master.bitdepth() / 8;
|
||||
|
||||
if (m_geometry
|
||||
.get_module_geometries(
|
||||
m_geometry.get_modules_in_roi(part_idx))
|
||||
m_ROI_geometries[roi_index].module_indices_in_roi(
|
||||
part_idx))
|
||||
.origin_x != 0)
|
||||
throw std::runtime_error(
|
||||
LOCATION +
|
||||
" Implementation error. x pos not 0."); // TODO: origin
|
||||
" Implementation error. x pos not 0."); // TODO:
|
||||
// origin
|
||||
// can still
|
||||
// change if roi
|
||||
// change if
|
||||
// roi
|
||||
// changes
|
||||
// TODO! What if the files don't match?
|
||||
m_subfiles[part_idx]->seek(corrected_idx);
|
||||
m_subfiles[part_idx]->read_into(frame_buffer + offset, header);
|
||||
m_subfiles[roi_index][part_idx]->seek(corrected_idx);
|
||||
m_subfiles[roi_index][part_idx]->read_into(frame_buffer + offset,
|
||||
header);
|
||||
if (header)
|
||||
++header;
|
||||
}
|
||||
@@ -230,23 +412,25 @@ void RawFile::get_frame_into(size_t frame_index, std::byte *frame_buffer,
|
||||
// TODO! should we read row by row?
|
||||
|
||||
// create a buffer large enough to hold a full module
|
||||
auto bytes_per_part = m_master.pixels_y() * m_master.pixels_x() *
|
||||
m_master.bitdepth() /
|
||||
8; // TODO! replace with image_size_in_bytes
|
||||
auto bytes_per_part =
|
||||
m_master.pixels_y() * m_master.pixels_x() * m_master.bitdepth() /
|
||||
8; // TODO! replace with image_size_in_bytes // TODO
|
||||
// shouldnt it only be the module size? - check
|
||||
|
||||
auto *part_buffer = new std::byte[bytes_per_part];
|
||||
|
||||
// TODO! if we have many submodules we should reorder them on the
|
||||
// module level
|
||||
// TODO! if we have many submodules we should reorder them on
|
||||
// the module level
|
||||
|
||||
for (size_t part_idx = 0; part_idx != m_geometry.n_modules_in_roi();
|
||||
for (size_t part_idx = 0;
|
||||
part_idx != m_ROI_geometries[roi_index].num_modules_in_roi();
|
||||
++part_idx) {
|
||||
auto pos = m_geometry.get_module_geometries(
|
||||
m_geometry.get_modules_in_roi(part_idx));
|
||||
m_ROI_geometries[roi_index].module_indices_in_roi(part_idx));
|
||||
auto corrected_idx = frame_indices[part_idx];
|
||||
|
||||
m_subfiles[part_idx]->seek(corrected_idx);
|
||||
m_subfiles[part_idx]->read_into(part_buffer, header);
|
||||
m_subfiles[roi_index][part_idx]->seek(corrected_idx);
|
||||
m_subfiles[roi_index][part_idx]->read_into(part_buffer, header);
|
||||
if (header)
|
||||
++header;
|
||||
|
||||
@@ -255,7 +439,8 @@ void RawFile::get_frame_into(size_t frame_index, std::byte *frame_buffer,
|
||||
|
||||
auto irow = (pos.origin_y + cur_row);
|
||||
auto icol = pos.origin_x;
|
||||
auto dest = (irow * this->m_geometry.pixels_x() + icol);
|
||||
auto dest =
|
||||
(irow * m_ROI_geometries[roi_index].pixels_x() + icol);
|
||||
dest = dest * m_master.bitdepth() / 8;
|
||||
memcpy(frame_buffer + dest,
|
||||
part_buffer +
|
||||
@@ -269,7 +454,17 @@ void RawFile::get_frame_into(size_t frame_index, std::byte *frame_buffer,
|
||||
|
||||
std::vector<Frame> RawFile::read_n(size_t n_frames) {
|
||||
// TODO: implement this in a more efficient way
|
||||
if (num_rois() > 1) {
|
||||
throw std::runtime_error(LOCATION +
|
||||
"Multiple ROIs defined in the master "
|
||||
"file. Use "
|
||||
"read_num_rois for a specific ROI or use "
|
||||
"read_ROIs to read one frame after "
|
||||
"the other.");
|
||||
}
|
||||
|
||||
std::vector<Frame> frames;
|
||||
frames.reserve(n_frames);
|
||||
for (size_t i = 0; i < n_frames; i++) {
|
||||
frames.push_back(this->get_frame(m_current_frame));
|
||||
m_current_frame++;
|
||||
@@ -277,11 +472,26 @@ std::vector<Frame> RawFile::read_n(size_t n_frames) {
|
||||
return frames;
|
||||
}
|
||||
|
||||
std::vector<Frame> RawFile::read_n_with_roi(const size_t n_frames,
|
||||
const size_t roi_index) {
|
||||
if (roi_index >= num_rois()) {
|
||||
throw std::runtime_error(LOCATION + "ROI index out of range.");
|
||||
}
|
||||
|
||||
std::vector<Frame> frames;
|
||||
frames.reserve(n_frames);
|
||||
for (size_t i = 0; i < n_frames; i++) {
|
||||
frames.push_back(this->get_frame(m_current_frame, roi_index));
|
||||
m_current_frame++;
|
||||
}
|
||||
return frames;
|
||||
}
|
||||
|
||||
size_t RawFile::frame_number(size_t frame_index) {
|
||||
if (frame_index >= m_master.frames_in_file()) {
|
||||
throw std::runtime_error(LOCATION + " Frame number out of range");
|
||||
}
|
||||
return m_subfiles[0]->frame_number(frame_index);
|
||||
return m_subfiles[0][0]->frame_number(frame_index);
|
||||
}
|
||||
|
||||
} // namespace aare
|
||||
|
||||
Reference in New Issue
Block a user