Skip to content

Commit 8c4d3c3

Browse files
authored
fix the dets order issue (#43)
This fixes the fallback logic for the geometric ordering (when no coordinates are present). originally we used emplace_back on a pre-sized vector and std::iota with incorrect iterators, resulting in the detector orders not being filled correctly. this solves those errors with : ``` tesseract: src/tesseract.cc:106: TesseractDecoder::TesseractDecoder(TesseractConfig): Assertion `config.det_orders[i].size() == config.dem.count_detectors()' failed. ```
1 parent 3299e14 commit 8c4d3c3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/tesseract_main.cc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,12 +231,13 @@ struct Args {
231231
std::vector<double> inner_products(config.dem.count_detectors());
232232

233233
if (!detector_coords.size() || !detector_coords.at(0).size()) {
234-
// If there are no detector coordinates, just use the standard ordering
235-
// of the indices.
234+
// If there are no detector coordinates, just use the standard
235+
// ordering of the indices.
236236
for (size_t det_order = 0; det_order < num_det_orders; ++det_order) {
237-
config.det_orders.emplace_back();
238-
std::iota(config.det_orders.back().begin(), config.det_orders.front().end(), 0);
237+
config.det_orders[det_order].resize(config.dem.count_detectors());
238+
std::iota(config.det_orders[det_order].begin(), config.det_orders[det_order].end(), 0);
239239
}
240+
240241
} else {
241242
// Use the coordinates to order the detectors based on a random
242243
// orientation
@@ -694,4 +695,4 @@ int main(int argc, char* argv[]) {
694695
std::cout << " total_time_seconds = " << total_time_seconds;
695696
std::cout << std::endl;
696697
}
697-
}
698+
}

0 commit comments

Comments
 (0)