From 069c3149fbb2c43eccc5caeea0fc13ee6c88ca6d Mon Sep 17 00:00:00 2001 From: Oleg Alexandrov Date: Fri, 15 Dec 2023 22:24:44 -0800 Subject: [PATCH] Simplify reading serial numbers --- src/asp/Camera/BundleAdjustIsis.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/asp/Camera/BundleAdjustIsis.cc b/src/asp/Camera/BundleAdjustIsis.cc index 9c1428f02..e69009acd 100644 --- a/src/asp/Camera/BundleAdjustIsis.cc +++ b/src/asp/Camera/BundleAdjustIsis.cc @@ -64,18 +64,18 @@ void readSerialNumbers(std::string const& outputPrefix, serialNumbers.clear(); try { - // Create a list of cub files. Need this to find the serial numbers - std::string cubeList = outputPrefix + "-list.txt"; - vw::vw_out() << "Writing image list: " << cubeList << std::endl; - asp::write_list(cubeList, image_files); - Isis::SerialNumberList serial_list(QString::fromStdString(cubeList)); + Isis::SerialNumberList serial_list; + for (size_t i = 0; i < image_files.size(); i++) { + QString fileName = QString::fromStdString(image_files[i]); + serial_list.add(fileName); + } for (size_t i = 0; i < image_files.size(); i++) { - QString fileName = serial_list.fileName(i); QString serialNumber = serial_list.serialNumber(i); serialNumbers.push_back(serialNumber.toStdString()); } } catch (...) { // The above will fail for non-ISIS images. + serialNumbers.clear(); for (size_t i = 0; i < image_files.size(); i++) { serialNumbers.push_back(image_files[i]); }