diff --git a/CHANGELOG.md b/CHANGELOG.md index 114c96d9d2..5acfb480ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ update the Unreleased link so that it compares against the latest release tag. - Camera models now use the ALE library to interpolate states and orientations. Users will likely see very small changes in sensor ephemerides. These were tested and are within existing interpolation tolerances. [#2370](https://github.com/USGS-Astrogeology/ISIS3/issues/2370) - The isis3VarInit script is now just called isisVarInit and allows for more robust paths. [#3945](https://github.com/USGS-Astrogeology/ISIS3/pull/3945) - Isis2raw will now output straight to a 32bit file (no stretch) when stretch is set to None and bittype is set to 32bit. [#3878](https://github.com/USGS-Astrogeology/ISIS3/issues/3878) + - Findimageoverlaps can now have calculations and writes happen at the same time or sequentially. [#4047](https://github.com/USGS-Astrogeology/ISIS3/pull/4047) ### Fixed @@ -42,7 +43,7 @@ update the Unreleased link so that it compares against the latest release tag. - The ISIS library now has the correct version suffix. [#3365](https://github.com/USGS-Astrogeology/ISIS3/issues/3365) - Equalizer now reports the correct equation and values used to perform the adjustment. [#3987](https://github.com/USGS-Astrogeology/ISIS3/issues/3987) - Map2cam now works correctly when specifying bands for input cubes. [#3856](https://github.com/USGS-Astrogeology/ISIS3/issues/3856) - + - mro/hideal2pds app now writes the correct SAMPLE_BIT_MASK values to the output label. [#3978](https://github.com/USGS-Astrogeology/ISIS3/issues/3978) - For Histograms in ISIS, updated the math for calculating what bin data should be placed in and the min/max values of each bin to be more intuitive. In addition, the output of hist and cnethist were changed to display the min/max values of each bin instead of the middle pixel's DN. [#3882](https://github.com/USGS-Astrogeology/ISIS3/issues/3882) diff --git a/isis/src/base/apps/findimageoverlaps/findimageoverlaps.cpp b/isis/src/base/apps/findimageoverlaps/findimageoverlaps.cpp index 0dceee8578..06dcacd857 100644 --- a/isis/src/base/apps/findimageoverlaps/findimageoverlaps.cpp +++ b/isis/src/base/apps/findimageoverlaps/findimageoverlaps.cpp @@ -11,13 +11,13 @@ using namespace std; namespace Isis { - void findimageoverlaps(UserInterface &ui, Pvl *log) { + void findimageoverlaps(UserInterface &ui, bool useThread, Pvl *log) { FileList images(ui.GetFileName("FROMLIST")); - findimageoverlaps(images, ui, log); + findimageoverlaps(images, ui, useThread, log); } - void findimageoverlaps(FileList &images, UserInterface &ui, Pvl *log) { + void findimageoverlaps(FileList &images, UserInterface &ui, bool useThread, Pvl *log) { // list of sns/filenames sorted by serial number SerialNumberList serialNumbers(true); @@ -47,7 +47,7 @@ namespace Isis { } // Now we want the ImageOverlapSet to calculate our overlaps - ImageOverlapSet overlaps(true); + ImageOverlapSet overlaps(true, useThread); // Use multi-threading to create the overlaps overlaps.FindImageOverlaps(serialNumbers, diff --git a/isis/src/base/apps/findimageoverlaps/findimageoverlaps.h b/isis/src/base/apps/findimageoverlaps/findimageoverlaps.h index d8ca4a1932..201e8886d2 100644 --- a/isis/src/base/apps/findimageoverlaps/findimageoverlaps.h +++ b/isis/src/base/apps/findimageoverlaps/findimageoverlaps.h @@ -6,9 +6,9 @@ #include "UserInterface.h" namespace Isis { - extern void findimageoverlaps(UserInterface &ui, Pvl *log=nullptr); + extern void findimageoverlaps(UserInterface &ui, bool useThread=true, Pvl *log=nullptr); - extern void findimageoverlaps(FileList &images, UserInterface &ui, Pvl *log=nullptr); + extern void findimageoverlaps(FileList &images, UserInterface &ui, bool useThread=true, Pvl *log=nullptr); } #endif diff --git a/isis/src/base/apps/findimageoverlaps/main.cpp b/isis/src/base/apps/findimageoverlaps/main.cpp index 620564ba61..e12ef47054 100644 --- a/isis/src/base/apps/findimageoverlaps/main.cpp +++ b/isis/src/base/apps/findimageoverlaps/main.cpp @@ -10,9 +10,9 @@ using namespace Isis; void IsisMain() { UserInterface &ui = Application::GetUserInterface(); Pvl appLog; - + try { - findimageoverlaps(ui, &appLog); + findimageoverlaps(ui, true, &appLog); } catch (...) { for (auto grpIt = appLog.beginGroup(); grpIt!= appLog.endGroup(); grpIt++) { diff --git a/isis/src/base/objs/ImageOverlapSet/ImageOverlapSet.cpp b/isis/src/base/objs/ImageOverlapSet/ImageOverlapSet.cpp index e8b8541900..3f52ba48b8 100644 --- a/isis/src/base/objs/ImageOverlapSet/ImageOverlapSet.cpp +++ b/isis/src/base/objs/ImageOverlapSet/ImageOverlapSet.cpp @@ -33,12 +33,12 @@ namespace Isis { * addition to logging errors. * @see automaticRegistration.doc */ - ImageOverlapSet::ImageOverlapSet(bool continueOnError) { + ImageOverlapSet::ImageOverlapSet(bool continueOnError, bool useThread) { p_continueAfterError = continueOnError; p_writtenSoFar = 0; p_calculatedSoFar = -1; - p_threadedCalculate = false; + p_threadedCalculate = useThread; p_snlist = NULL; } @@ -181,9 +181,6 @@ namespace Isis { p_snlist = &boundaries; - // This will enable using mutexes and spawning threads where necessary. - p_threadedCalculate = true; - FindImageOverlaps(boundaries); // While our exit condition is not true, call WriteImageOverlaps with the filename. diff --git a/isis/src/base/objs/ImageOverlapSet/ImageOverlapSet.h b/isis/src/base/objs/ImageOverlapSet/ImageOverlapSet.h index 2d03f455f3..94a6032fe4 100644 --- a/isis/src/base/objs/ImageOverlapSet/ImageOverlapSet.h +++ b/isis/src/base/objs/ImageOverlapSet/ImageOverlapSet.h @@ -97,11 +97,11 @@ namespace Isis { * undefined behavior caused by unlocking an unlocked mutex. * @history 2017-05-23 Ian Humphrey - Added a tryLock() to FindAllOverlaps to prevent a * segfault from occuring on OSX with certain data. Fixes #4810. - * + * */ class ImageOverlapSet : private QThread { public: - ImageOverlapSet(bool continueOnError = false); + ImageOverlapSet(bool continueOnError = false, bool useThread = true); virtual ~ImageOverlapSet(); void FindImageOverlaps(SerialNumberList &boundaries); diff --git a/isis/tests/FuntionalTestsFindImageOverlaps.cpp b/isis/tests/FunctionalTestsFindImageOverlaps.cpp similarity index 97% rename from isis/tests/FuntionalTestsFindImageOverlaps.cpp rename to isis/tests/FunctionalTestsFindImageOverlaps.cpp index 039f87cc92..35bdc4dcad 100644 --- a/isis/tests/FuntionalTestsFindImageOverlaps.cpp +++ b/isis/tests/FunctionalTestsFindImageOverlaps.cpp @@ -59,7 +59,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestFindImageOverlapsNoOverlap) { Pvl appLog; try { - findimageoverlaps(options, &appLog); + findimageoverlaps(options, false, &appLog); FAIL() << "Expected an IException with message: \"No overlaps were found\"."; } catch(IException &e) { @@ -76,7 +76,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestFindImageOverlapTwoImageOverlap) { FileList images; images.append(FileName(cube1->fileName())); images.append(FileName(cube2->fileName())); - findimageoverlaps(images, ui, nullptr); + findimageoverlaps(images, ui, false, nullptr); // Find all the overlaps between the images in the FROMLIST // The overlap polygon coordinates are in Lon/Lat order @@ -145,7 +145,7 @@ TEST_F(ThreeImageNetwork, FunctionalTestFindImageOverlapFullOverlap) { FileList images; images.append(FileName(cube1->fileName())); images.append(FileName(cube2->fileName())); - findimageoverlaps(images, ui, nullptr); + findimageoverlaps(images, ui, false, nullptr); // Find all the overlaps between the images in the FROMLIST // The overlap polygon coordinates are in Lon/Lat order