Skip to content
Snippets Groups Projects
Unverified Commit ae7eccf3 authored by Christine Kim's avatar Christine Kim Committed by GitHub
Browse files

8.0.4 LTS Release Prep (#5686)


* Adds HRSC support in socetlinescankeywords (#5669)

* Adds HRSC support in socetlinescankeywords

* Add test cube

* Fixed tests

* Converted skypt to a callable app. Converted existing Makefile tests to gtests. Removed existing Makefile tests.  (#5444)

* Converted skypt to a callable app. Converted existing makefile tests to gtest format and removed old makefile tests and data. Addresses #5443.

* Updated contributor list to add Sarah S. Sutton. Addresses #5443.

---------

Co-authored-by: default avatarSarah Sutton <ssutton@dhcp-10-142-214-177.uawifi.arizona.edu>

* Noseam has been refactored to be callable. Makefile test has been converted to a gtest and removed. (#5600)

* Noseam has been refactored to be callable. Makefile test has been converted to a gtest and removed. Addresses #5599.

* Modifications to address gtest failures. Also added addtional input parameter error checking to ensure noseam exits prior to generation of temporary files. Finally modified gtests to remove the print.prt file if generated. Addresses #5599.

* The explode application has been refactored to be callable and Makefile test converted to a gtest. (#5590)

* Updated explode application gtest to use DefaultCube fixture instead of cube in isis/tests/data. Addresses #5557.

* Cleaned up includes in default explode gtest. Added history entry to explode.xml. Addresses #5557.

* Updating main.cpp and removed Makefile tests for explode conversion to callable app. Addresses #5557.

* Added CHANGELOG entry for conversion of explode app to callable function. Addresses #5557.

---------

Co-authored-by: default avatarAdam Paquette <acpaquette@usgs.gov>

* Isisminer has been refactored to be callable and Makefile tests converted to gtest format (#5579)

* Fixed minor misspellings in error messages. Addresses #5516.

* Test data added for isisminer. Addresses #5516.

* Converted isisminer Makefile tests to gtest format. Addresses #5516.

* Converted isisminer application to callable function. Addresses #5516.

* Minor tweak to isisminer csvwriter test. Addresses #5516.

* Added compareCsvLineCustomDelimiter method, specifically for isisminer testing support. Addresses #5516.

* Removed isisminer Makefile tests (replaced by gtests) and updated CHANGELOG reflecting conversion of isisminer to callable app. Addresses #5516.

* Replace isis cube in /isis/tests/data/isisminer/gistest with isd and label files. Minor tweaks to FunctionalTestsIsisminer.cpp. History entry added to isisminer.xml. Addresses #5516.

* Minor changes for conversion of isisminer to callable app. Addresses #5516.

* Had to add data file index.lbl to the .gitignore file for it to be uploaded. Addresses #5516.

* Algebra has been refactored to be callable; old Makefile tests have been converted to gtests and removed. Addresses #5594. (#5597)

* Photrim has been refactored to be callable; old Makefile tests have been converted to gtests and removed. (#5582)

* Photrim has been converted to a callable app. Corresponding Makefile tests have been converted to gtests and removed. Addresses #5581.

* Tweaks to FunctionalTestsPhotrim.cpp. Addresses #5581.

* Bandtrim has been refactored to be callable; old Makefile tests have been converted to gtests. (#5572)

* Bandtrim has been refactored to be callable; old Makefile tests have been removed and replaced by gtests. Addresses #5571.

* Update FunctionalTestsBandtrim.cpp

Minor documentation change.

* Updated kaguyasp2ascii to support newer (detached) data (#5568)

* Modified to work with new (detached) data

* Updated changelog

* Allow data specification outside current directory

* Jigsaw csm error message (#5562)

* Added fail-early + error message for csminit'd images without csm solve parameters

* Updated changelog

* Bug fix in noproj to remove persistent temporary lbl file (#5578)

* Added line to close match cube in noproj.cpp. Not closing the cube resulted in a temporary "*.lbl" file that remained after running the noproj application. Addresses #5577.

* CHANGELOG entry for noproj bug fix. Addresses #5577.

* Added history entry in noproj.xml. Addresses #5577.

* Remove restrictive validity check in caminfo (#5553)

* Removed preemptive validity check for polygon

* Removed unused import

* Updated changelog

* Qview command line Fix (#5505)

* Avoid double image load when opening cubes from cmdline in qview

* Added changelog entry

* Revert interval change

* Change qt to qt-main

* Update deps and pcl cmake

* Add float.h

* CsmSerialNumber.trn - typo and PVL compilant fix (#5561)

* Fixed typo

* PVL compliant

* PR feedback changes

* hrsc2isis support for level 3 images (#5560)

* Remove label check for level3

* update changelog

* fix test

* addressed PR feedback

* fixed grammar

* Fixed gllssi2isis to support V1.1 data (#5570)

* Removed a debug output statement inadvertently left in noseam.cpp. Addresses #5660. (#5661)

* Bug fixes to address incorrect handling of RADIUS in the jigsaw GUI and in the bundleout.txt file when performing a rectangular (XYZ) bundle adjustment, originally implemented in UofA OSIRIS-REx code on 2019-07-30. Addresses #5642. (#5643)

* The RADIUS checkbox in the GUI is excluded when a RECTANGULAR solution is selected.

* In the bundleout.txt file, for rectangular solutions, 1) RADIUS is set to N/A in the SOLVE OPTIONS section; and 2) the POINTS UNCERTAINTY SECTION was fixed to properly display adjusted point uncertainty statistics with Error Propagation turned on.

* Spacing for point labels was cleaned up in the INPUT: GLOBAL IMAGE PARAMETER UNCERTAINTIES section.

* Finally, a slight modification was added to the FunctionalTestJigsawBundleXYZ ctest to verify that RADIUS is N/A in a RECTANGULAR solution.

* Updated kaguyasp2ascii to support newer (detached) data (#5568)

* Modified to work with new (detached) data

* Updated changelog

* Allow data specification outside current directory

* Speeds up FunctionalTestCamstatsDefaultParameters (#5647)

* speed up camstats

* add changelog

* fixes photomet not accepting backplanes (#5658)

* fixes photomet not accepting backplanes

* fix changelog

* Converted to gtests

* Add input cube attributes

* Convert dstripe to gtests (#5665)

* Convert dstripe to gtests

* add changelog

* Fixed build error

* trigger build

* trigger build

* Update docs

---------

Co-authored-by: default avatarAmy Stamile <74275278+amystamile-usgs@users.noreply.github.com>
Co-authored-by: default avatarSarah Sutton <ssutton@lpl.arizona.edu>
Co-authored-by: default avatarSarah Sutton <ssutton@dhcp-10-142-214-177.uawifi.arizona.edu>
Co-authored-by: default avatarkledmundson <6842706+kledmundson@users.noreply.github.com>
Co-authored-by: default avatarAdam Paquette <acpaquette@usgs.gov>
Co-authored-by: default avatarAustin Sanders <arsanders@usgs.gov>
Co-authored-by: default avatarShin-ya Murakami <86389420+murashinln@users.noreply.github.com>
parent 5ac230a8
No related branches found
No related tags found
No related merge requests found
Showing
with 404 additions and 216 deletions
...@@ -336,6 +336,10 @@ ...@@ -336,6 +336,10 @@
{ {
"name": "Miller-Ribelin, Elizabeth" "name": "Miller-Ribelin, Elizabeth"
}, },
{
"affiliation": "Japan Aerospace Exploration Agency, Institute of Space and Astronautical Science",
"name": "Murakami, Shin-ya",
"orcid": "0000-0002-7137-4849"
{ {
"affiliation": "United States Geological Survey, Astro Geology Science Center", "affiliation": "United States Geological Survey, Astro Geology Science Center",
"name": "Nelson, Gavin" "name": "Nelson, Gavin"
...@@ -437,6 +441,10 @@ ...@@ -437,6 +441,10 @@
{ {
"name": "Sucharski, Tracie" "name": "Sucharski, Tracie"
}, },
{
"affiliation": "University of Arizona, Lunar and Planetary Laboratory",
"name": "Sutton, Sarah S."
},
{ {
"name": "Takir, Driss" "name": "Takir, Driss"
}, },
......
...@@ -35,11 +35,43 @@ release. ...@@ -35,11 +35,43 @@ release.
## [Unreleased] ## [Unreleased]
## [8.0.4] - 2024-11-27
### Added
- Added HRSC support in socetlinescankeywords [#5465](https://github.com/DOI-USGS/ISIS3/issues/5465)
### Changed
- Skypt has been refactored to be callable; old Makefile tests have been removed and replaced by gtests. Issue: [#5443](https://github.com/USGS-Astrogeology/ISIS3/issues/5443)
- Noseam has been refactored to be callable; old Makefile test has been removed and replaced by a gtest. Issue: [#5599](https://github.com/USGS-Astrogeology/ISIS3/issues/5599)
- Explode has been refactored to be callable; old Makefile test has been removed and replaced by a gtest. Issue: [#5557](https://github.com/USGS-Astrogeology/ISIS3/issues/5557)
- Isisminer has been refactored to be callable; old Makefile tests have been removed and replaced by gtests. Issue: [#5516](https://github.com/USGS-Astrogeology/ISIS3/issues/5516)
- Algebra has been refactored to be callable; old Makefile tests have been removed and replaced by gtests. Issue: [#5594](https://github.com/USGS-Astrogeology/ISIS3/issues/5594)
- Photrim has been refactored to be callable; old Makefile tests have been removed and replaced by gtests. Issue: [#5581](https://github.com/USGS-Astrogeology/ISIS3/issues/5581)
- Bandtrim has been refactored to be callable; old Makefile tests have been removed and replaced by gtests. Issue: [#5571](https://github.com/USGS-Astrogeology/ISIS3/issues/5571)
- Modified kaguyasp2isis to work with new (detached) data [#5436](https://github.com/DOI-USGS/ISIS3/issues/5436)
- Added jigsaw error message for csminit'd images without csm parameters[#5486](https://github.com/DOI-USGS/ISIS3/issues/5486)
### Fixed
- Fixed a bug in noproj.cpp which left a persisent lbl file after running noproj. [#5577](https://github.com/DOI-USGS/ISIS3/issues/5577)
- Fixed a bug in PolygonTools in which the program exited before attempting to fix an invalid Polygon [#5520](https://github.com/DOI-USGS/ISIS3/issues/5520)
- Fixed a bug in QVIEW where images would double load if loaded from the commandline [#5505](https://github.com/DOI-USGS/ISIS3/pull/5505)
- Fixed CSMSerialNumber.trn typo [#5485](https://github.com/DOI-USGS/ISIS3/issues/5485)
- Fixed CSMSerialNumber.trn to be PVL compliant [#5484](https://github.com/DOI-USGS/ISIS3/issues/5484)
- Fixed hrsc2isis to support level 3 hrsc images [#5497](https://github.com/DOI-USGS/ISIS3/issues/5497)
- Fixed gllssi2isis to support V1.1 data [#5396](https://github.com/DOI-USGS/ISIS3/issues/5396)
- Fixed noseam bug where a debugging output statement was inadvertently left in noseam.cpp. Issue: [5660](https://github.com/DOI-USGS/ISIS3/issues/5660)
- Fixed jigsaw bugs in which RADIUS is handled incorrectly in the jigsaw gui and in the bundleout.txt file. Slightly modified the FunctionalTestJigsawBundleXYZ ctest accordingly. Issue: [5642](https://github.com/DOI-USGS/ISIS3/issues/5642)
- Fixed a bug in kaguyasp2isis that doesn't work for data with a detached label. [#5568](https://github.com/DOI-USGS/ISIS3/pull/5568)
- Fixed FunctionalTestCamstatsDefaultParameters test by increasing the runtime speed [#5459](https://github.com/DOI-USGS/ISIS3/issues/5459)
- Fixed PHOTOMET not accepting backplanes [#5281](https://github.com/DOI-USGS/ISIS3/issues/5281)
- Fixed dstripe parallel test failing by converting tests to gtests [#5613](https://github.com/DOI-USGS/ISIS3/issues/5613)
## [8.0.3] - 2023-04-18 ## [8.0.3] - 2023-04-18
### Changed ### Changed
- Disabled option to use web=true when running spiceinit with HRSC images. [#5223](https://github.com/DOI-USGS/ISIS3/issues/5223) - Disabled option to use web=true when running spiceinit with HRSC images. [#5223](https://github.com/DOI-USGS/ISIS3/issues/5223)
- Changed the default spiceinit url to https://astrogeology.usgs.gov/apis/ale/v0.9.1/spiceserver/ and added deprecation warning for use of https://services.isis.astrogeology.usgs.gov/cgi-bin/spiceinit.cgi url. [#5327](https://github.com/USGS-Astrogeology/ISIS3/issues/5327) - Changed the default spiceinit url to https://astrogeology.usgs.gov/apis/ale/v0.9.1/spiceserver/ and added deprecation warning for use of https://services.isis.astrogeology.usgs.gov/cgi-bin/spiceinit.cgi url. [#5327](https://github.com/USGS-Astrogeology/ISIS3/issues/5327)
- Skypt has been refactored to be callable; old Makefile tests have been removed and replaced by gtests. Issue: [#5443](https://github.com/USGS-Astrogeology/ISIS3/issues/5443)
### Fixed ### Fixed
- Fixed a bug in which capital E was problematic for OSX / Ubuntu [#5466](https://github.com/DOI-USGS/ISIS3/pull/5466) - Fixed a bug in which capital E was problematic for OSX / Ubuntu [#5466](https://github.com/DOI-USGS/ISIS3/pull/5466)
......
...@@ -43,6 +43,43 @@ ...@@ -43,6 +43,43 @@
"date": { "date": {
"metadataLastUpdated": "2023-02-27" "metadataLastUpdated": "2023-02-27"
} }
}, {
"name": "ISIS3",
"organization": "U.S. Geological Survey",
"description": "GitHub code repository for the Integrated Software for Imagers and Spectrometers (ISIS)",
"version": "8.0.4",
"status": "Production",
"permissions": {
"usageType": "openSource",
"licenses": [
{
"name": "Public Domain, CC0-1.0",
"URL": "https://code.usgs.gov/astrogeology/isis/-/raw/8.0.4/LICENSE.md"
}
]
},
"homepageURL": "https://isis.astrogeology.usgs.gov",
"downloadURL": "https://code.usgs.gov/astrogeology/isis/-/archive/8.0.4/isis-8.0.4.zip",
"disclaimerURL": "https://code.usgs.gov/astrogeology/isis/-/raw/8.0.4/DISCLAIMER.md",
"repositoryURL": "https://code.usgs.gov/astrogeology/isis.git",
"vcs": "git",
"laborHours": 0,
"tags": [
"Planetary",
"Remote Sensing",
"Photogrammetry",
"Data Processing"
],
"languages": [
"C++"
],
"contact": {
"name": "Christine Kim",
"email": "chkim@usgs.gov"
},
"date": {
"metadataLastUpdated": "2024-11-27"
}
}, { }, {
"name": "ISIS3", "name": "ISIS3",
"organization": "U.S. Geological Survey", "organization": "U.S. Geological Survey",
......
...@@ -3,10 +3,10 @@ channels: ...@@ -3,10 +3,10 @@ channels:
- defaults - defaults
dependencies: dependencies:
- ale=0.9.1 - ale =0.10.0,<1
- armadillo - armadillo
- boost=1.72 - boost >=1.78.0,<1.79
- boost-cpp=1.72 - boost-cpp >=1.78.0,<1.79
- blas - blas
- usgs-astrogeology::bullet - usgs-astrogeology::bullet
- bz2file - bz2file
...@@ -32,9 +32,9 @@ dependencies: ...@@ -32,9 +32,9 @@ dependencies:
- jpeg - jpeg
- usgs-astrogeology::kakadu==1 - usgs-astrogeology::kakadu==1
- krb5 - krb5
- libopencv>=4.5.2 - libopencv >=4.7,<4.8
- libpng>=1.6.34 - libpng>=1.6.34
- libprotobuf<3.20 - libprotobuf
- libtiff>=4.0 - libtiff>=4.0
- libxml2 - libxml2
- make - make
...@@ -47,16 +47,17 @@ dependencies: ...@@ -47,16 +47,17 @@ dependencies:
- nn - nn
- opencv>=4.5.2 - opencv>=4.5.2
- openssl>=1.1.1k - openssl>=1.1.1k
- pcl >= 1.10.0 - pcl >=1.13,<1.14
- protobuf<3.20 - protobuf
- python>=3.7.11 - python >=3.10
- python_abi >=3.10
- pytest - pytest
- rclone - rclone
- qhull - qhull
- qt>=5.9.6,<5.15.0 - qt-main >=5.15.8, <5.16
- qwt - qwt <6.3.0
- sqlite - sqlite >=3.46.0,<3.47
- suitesparse - suitesparse<7.7.0
- superlu - superlu
- swig - swig
- texlive-core - texlive-core
......
...@@ -34,7 +34,7 @@ set(PACKAGE "ISIS") ...@@ -34,7 +34,7 @@ set(PACKAGE "ISIS")
set(PACKAGE_NAME "USGS ISIS") set(PACKAGE_NAME "USGS ISIS")
# Version number # Version number
set(VERSION "8.0.3") set(VERSION "8.0.4")
string(REPLACE "." ";" VERSION_LIST ${VERSION}) string(REPLACE "." ";" VERSION_LIST ${VERSION})
list(GET VERSION_LIST 0 VERSION_MAJOR) list(GET VERSION_LIST 0 VERSION_MAJOR)
list(GET VERSION_LIST 1 VERSION_MINOR) list(GET VERSION_LIST 1 VERSION_MINOR)
......
Group = Keyword1 Group = Keyword1
Auto Auto = 1
InputKey = CSMPlatformId InputKey = CSMPlatformID
InputGroup = "IsisCube,CsmInfo" InputGroup = "IsisCube,CsmInfo"
InputPosition = (IsisCube, CsmInfo) InputPosition = (IsisCube, CsmInfo)
OutputName = Keyword1 OutputName = Keyword1
...@@ -9,7 +9,7 @@ Group = Keyword1 ...@@ -9,7 +9,7 @@ Group = Keyword1
End_Group End_Group
Group = Keyword2 Group = Keyword2
Auto Auto = 1
InputKey = CSMInstrumentId InputKey = CSMInstrumentId
InputGroup = "IsisCube,CsmInfo" InputGroup = "IsisCube,CsmInfo"
InputPosition = (IsisCube, CsmInfo) InputPosition = (IsisCube, CsmInfo)
...@@ -19,7 +19,7 @@ Group = Keyword2 ...@@ -19,7 +19,7 @@ Group = Keyword2
End_Group End_Group
Group = Keyword3 Group = Keyword3
Auto Auto = 1
InputKey = ReferenceTime InputKey = ReferenceTime
InputGroup = "IsisCube,CsmInfo" InputGroup = "IsisCube,CsmInfo"
InputPosition = (IsisCube, CsmInfo) InputPosition = (IsisCube, CsmInfo)
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
find_path(PCL_INCLUDE_DIR find_path(PCL_INCLUDE_DIR
NAME pcl_base.h NAME pcl_base.h
PATH_SUFFIXES "pcl-1.8/pcl" "pcl-1.9/pcl" "pcl-1.11/pcl" "pcl-1.13/pcl" PATH_SUFFIXES "pcl-1.8/pcl" "pcl-1.9/pcl" "pcl-1.11/pcl" "pcl-1.12/pcl" "pcl-1.13/pcl" "pcl-1.14/pcl"
) )
find_library(PCL_COMMON_LIBRARY NAMES pcl_common) find_library(PCL_COMMON_LIBRARY NAMES pcl_common)
......
/** This is free and unencumbered software released into the public domain.
The authors of ISIS do not claim copyright on the contents of this file.
For more details about the LICENSE terms and the AUTHORS, you will
find files of those names at the top level of this repository. **/
/* SPDX-License-Identifier: CC0-1.0 */
#include "algebra.h"
#include "Cube.h"
#include "FileName.h"
#include "ProcessByLine.h"
#include "SpecialPixel.h"
namespace Isis {
/*
* Algebra
*
* This program performs simple algebra on either one or two
* cubes. The two cubes may be added, subtracted, multiplied or divided.
*
* The following equations are used:
* UNARY: out = (A * from1) + C
* ADD: out = ((from1 - D) * A) + ((from2 - E) * B) + C
* SUBTRACT: out = ((from1 - D) * A) - ((from2 - E) * B) + C
* MULTIPLY: out = ((from1 - D) * A) * ((from2 - E) * B) + C
* DIVIDE: out = ((from1 - D) * A) / ((from2 - E) * B) + C
*
* The FROM2 cube must have either one band or the same number of bands
* as the FROM cube. If the FROM2 cube has one band, then the algebraic
* formula will be applied to all bands in FROM using that single band
* in FROM2. If FROM2 is a multi-band cube, the algebra will be performed
* between corresponding bands from FROM and FROM2.
*
* @param ui UserInterface object containing parameters
*/
void algebra(UserInterface &ui) {
Cube* icube1 = new Cube();
icube1->open(ui.GetCubeName("FROM"));
Cube* icube2 = nullptr;
if(ui.WasEntered("FROM2")) {
icube2 = new Cube();
icube2->open(ui.GetCubeName("FROM2"));
}
algebra(icube1, ui, icube2);
}
/*
* Algebra
*
* This program performs simple algebra on either one or two
* cubes. The two cubes may be added, subtracted, multiplied or divided.
*
* The following equations are used:
* UNARY: out = (A * from1) + C
* ADD: out = ((from1 - D) * A) + ((from2 - E) * B) + C
* SUBTRACT: out = ((from1 - D) * A) - ((from2 - E) * B) + C
* MULTIPLY: out = ((from1 - D) * A) * ((from2 - E) * B) + C
* DIVIDE: out = ((from1 - D) * A) / ((from2 - E) * B) + C
*
* The FROM2 cube must have either one band or the same number of bands
* as the FROM cube. If the FROM2 cube has one band, then the algebraic
* formula will be applied to all bands in FROM using that single band
* in FROM2. If FROM2 is a multi-band cube, the algebra will be performed
* between corresponding bands from FROM and FROM2.
*
* @param icube1 Cube* input cube1
* @param ui UserInterface object containing parameters
* @param icube2 Cube* input cube2; optional second input cube
*/
void algebra(Cube* icube1, UserInterface &ui, Cube* icube2) {
// Processing by line
ProcessByLine p;
// Set input cubes and attributes into ProcessByLine p
CubeAttributeInput inatts1 = ui.GetInputAttribute("FROM");
CubeAttributeInput inatts2;
p.SetInputCube(icube1->fileName(), inatts1);
if(icube2 != nullptr) {
inatts2 = ui.GetInputAttribute("FROM2");
p.SetInputCube(icube2->fileName(), inatts2);
}
// Set output cube and attributes into ProcessByLine p
QString outCubeFname = ui.GetCubeName("TO");
CubeAttributeOutput &outatts = ui.GetOutputAttribute("TO");
p.SetOutputCube(outCubeFname, outatts);
// Get the coefficients
double Isisa = ui.GetDouble("A");
double Isisb = ui.GetDouble("B");
double Isisc = ui.GetDouble("C");
double Isisd = ui.GetDouble("D");
double Isise = ui.GetDouble("E");
QString op = ui.GetString("OPERATOR");
//*****************************************
// Lambda functions to perform operations *
//*****************************************
// operatorProcess for add, subtract, multiply, divide
auto operatorProcess = [&](std::vector<Buffer *> &in, std::vector<Buffer *> &out)->void {
Buffer &inp1 = *in[0];
Buffer &inp2 = *in[1];
Buffer &outp = *out[0];
// Loop for each pixel in the line
// Special pixel propagation:
// 1) special pixels in inp1 propagate to output cube unchanged
// 2) if inp1 is not special and inp2 is, the output pixel is set to Null
for(int i = 0; i < inp1.size(); i++) {
if(IsSpecial(inp1[i])) {
outp[i] = inp1[i];
}
else if(IsSpecial(inp2[i])) {
outp[i] = NULL8;
}
else {
double operand1 = (inp1[i] - Isisd) * Isisa;
double operand2 = (inp2[i] - Isise) * Isisb;
if(op == "ADD") {
outp[i] = (operand1 + operand2) + Isisc;
}
if(op == "SUBTRACT") {
outp[i] = (operand1 - operand2) + Isisc;
}
if(op == "MULTIPLY") {
outp[i] = (operand1 * operand2) + Isisc;
}
if(op == "DIVIDE") {
if((inp2[i] - Isise) * Isisb == 0.0) {
outp[i] = NULL8;
}
else {
outp[i] = (operand1 / operand2) + Isisc;
}
}
}
}
};
// Unary process
auto unaryProcess = [&](Buffer &in, Buffer &out)->void {
// Loop for each pixel in the line.
// Special pixels propagate directly to output
for(int i = 0; i < in.size(); i++) {
if(IsSpecial(in[i])) {
out[i] = in[i];
}
else {
out[i] = in[i] * Isisa + Isisc;
}
}
};
//*****************************************
// End Lambda functions *
//*****************************************
// Start processing based on the operator
if(op == "UNARY") {
p.ProcessCube(unaryProcess);
}
else {
p.ProcessCubes(operatorProcess); // add, subtract, multiply, divide
}
p.EndProcess();
}
}
/** This is free and unencumbered software released into the public domain.
The authors of ISIS do not claim copyright on the contents of this file.
For more details about the LICENSE terms and the AUTHORS, you will
find files of those names at the top level of this repository. **/
/* SPDX-License-Identifier: CC0-1.0 */
#ifndef algebra_h
#define algebra_h
#include "UserInterface.h"
namespace Isis{
extern void algebra(UserInterface &ui);
extern void algebra(Cube* icube1, UserInterface &ui, Cube* icube2=nullptr);
}
#endif
...@@ -87,6 +87,9 @@ ...@@ -87,6 +87,9 @@
Updated to use the new ProcessByLine API. This program now takes Updated to use the new ProcessByLine API. This program now takes
advantage of multiple global processing threads. advantage of multiple global processing threads.
</change> </change>
<change name="Ken Edmundson" date="2024-08-22">
Converted to callable app and converted Makefile tests to gtests.
</change>
</history> </history>
<category> <category>
......
#include "Isis.h" /** This is free and unencumbered software released into the public domain.
#include "ProcessByBrick.h"
#include "ProcessByLine.h"
#include "SpecialPixel.h"
#include "IException.h"
using namespace std;
using namespace Isis;
void add(vector<Buffer *> &in, The authors of ISIS do not claim copyright on the contents of this file.
vector<Buffer *> &out); For more details about the LICENSE terms and the AUTHORS, you will
void sub(vector<Buffer *> &in, find files of those names at the top level of this repository. **/
vector<Buffer *> &out);
void mult(vector<Buffer *> &in,
vector<Buffer *> &out);
void divide(vector<Buffer *> &in,
vector<Buffer *> &out);
void unaryFunction(Buffer &in, Buffer &out);
double Isisa, Isisb, Isisc, Isisd, Isise;
void IsisMain() {
std::cout << "algebra - got to main...\n";
// We will be processing by line /* SPDX-License-Identifier: CC0-1.0 */
ProcessByLine p;
// Setup the input and output files
UserInterface &ui = Application::GetUserInterface();
// Setup the input and output cubes
p.SetInputCube("FROM");
if(ui.WasEntered("FROM2")) p.SetInputCube("FROM2");
p.SetOutputCube("TO");
// Get the coefficients
Isisa = ui.GetDouble("A");
Isisb = ui.GetDouble("B");
Isisc = ui.GetDouble("C");
Isisd = ui.GetDouble("D");
Isise = ui.GetDouble("E");
// Start the processing based on the operator
QString op = ui.GetString("OPERATOR");
if(op == "ADD") p.ProcessCubes(&add);
if(op == "SUBTRACT") p.ProcessCubes(&sub);
if(op == "MULTIPLY") p.ProcessCubes(&mult);
if(op == "DIVIDE") p.ProcessCubes(&divide);
if(op == "UNARY") p.ProcessCube(&unaryFunction);
}
// Add routine #include "Isis.h"
void add(vector<Buffer *> &in, vector<Buffer *> &out) {
Buffer &inp1 = *in[0];
Buffer &inp2 = *in[1];
Buffer &outp = *out[0];
// Loop for each pixel in the line.
for(int i = 0; i < inp1.size(); i++) {
if(IsSpecial(inp1[i])) {
outp[i] = inp1[i];
}
else if(IsSpecial(inp2[i])) {
outp[i] = NULL8;
}
else {
outp[i] = ((inp1[i] - Isisd) * Isisa) + ((inp2[i] - Isise) * Isisb) + Isisc;
}
}
}
// Sub routine
void sub(vector<Buffer *> &in, vector<Buffer *> &out) {
Buffer &inp1 = *in[0];
Buffer &inp2 = *in[1];
Buffer &outp = *out[0];
// Loop for each pixel in the line.
for(int i = 0; i < inp1.size(); i++) {
if(IsSpecial(inp1[i])) {
outp[i] = inp1[i];
}
else if(IsSpecial(inp2[i])) {
outp[i] = NULL8;
}
else {
outp[i] = ((inp1[i] - Isisd) * Isisa) - ((inp2[i] - Isise) * Isisb) + Isisc;
}
}
}
// Sub routine #include "algebra.h"
void mult(vector<Buffer *> &in, vector<Buffer *> &out) {
Buffer &inp1 = *in[0];
Buffer &inp2 = *in[1];
Buffer &outp = *out[0];
// Loop for each pixel in the line. #include "Application.h"
for(int i = 0; i < inp1.size(); i++) {
if(IsSpecial(inp1[i])) {
outp[i] = inp1[i];
}
else if(IsSpecial(inp2[i])) {
outp[i] = NULL8;
}
else {
outp[i] = ((inp1[i] - Isisd) * Isisa) * ((inp2[i] - Isise) * Isisb) + Isisc;
}
}
}
// Div routine using namespace Isis;
void divide(vector<Buffer *> &in, vector<Buffer *> &out) {
Buffer &inp1 = *in[0];
Buffer &inp2 = *in[1];
Buffer &outp = *out[0];
// Loop for each pixel in the line. void IsisMain() {
for(int i = 0; i < inp1.size(); i++) { UserInterface &ui = Application::GetUserInterface();
if(IsSpecial(inp1[i])) { algebra(ui);
outp[i] = inp1[i];
}
else if(IsSpecial(inp2[i])) {
outp[i] = NULL8;
}
else {
if((inp2[i] - Isise) * Isisb == 0.0) {
outp[i] = NULL8;
}
else {
outp[i] = ((inp1[i] - Isisd) * Isisa) / ((inp2[i] - Isise) * Isisb) + Isisc;
}
}
}
} }
// Unary routine
void unaryFunction(Buffer &in, Buffer &out) {
// Loop for each pixel in the line.
for(int i = 0; i < in.size(); i++) {
if(IsSpecial(in[i])) {
out[i] = in[i];
}
else {
out[i] = in[i] * Isisa + Isisc;
}
}
}
BLANKS = "%-6s"
LENGTH = "%-40s"
include $(ISISROOT)/make/isismake.tststree
APPNAME = algebra
include $(ISISROOT)/make/isismake.tsts
commands:
$(APPNAME) from=$(INPUT)/isisTruth.cub+1 \
from2=$(INPUT)/isisTruth.cub+2 \
to=$(OUTPUT)/algebraTruth2.cub \
operator=add \
a=1 \
b=1 \
c=0 > /dev/null;
APPNAME = algebra
include $(ISISROOT)/make/isismake.tsts
commands:
$(APPNAME) from=$(INPUT)/isisTruth.cub+1 \
from2=$(INPUT)/isisTruth.cub+2 \
to=$(OUTPUT)/algebraTruth5.cub \
operator=divide \
a=1 \
b=1 \
c=0 > /dev/null;
APPNAME = algebra
include $(ISISROOT)/make/isismake.tsts
commands:
$(APPNAME) from=$(INPUT)/isisTruth.cub+1 \
from2=$(INPUT)/isisTruth.cub+2 \
to=$(OUTPUT)/algebraTruth4.cub \
operator=multiply \
a=1 \
b=1 \
c=0 > /dev/null;
APPNAME = algebra
include $(ISISROOT)/make/isismake.tsts
commands:
$(APPNAME) from=$(INPUT)/isisTruth.cub+1 \
from2=$(INPUT)/isisTruth.cub+2 \
to=$(OUTPUT)/algebraTruth3.cub \
a=1 \
b=1 \
c=0 > /dev/null;
APPNAME = algebra
include $(ISISROOT)/make/isismake.tsts
commands:
$(APPNAME) from=$(INPUT)/isisTruth.cub+1 \
to= $(OUTPUT)/algebraTruth1.cub \
operator=unary \
a=1 \
c=0 > /dev/null;
/** This is free and unencumbered software released into the public domain.
The authors of ISIS do not claim copyright on the contents of this file.
For more details about the LICENSE terms and the AUTHORS, you will
find files of those names at the top level of this repository. **/
/* SPDX-License-Identifier: CC0-1.0 */
#include "bandtrim.h"
#include "Cube.h"
#include "ProcessByBrick.h"
#include "SpecialPixel.h"
namespace Isis {
// Process to trim spectral pixels if any are null
void BandTrimSpectral(Buffer &in, Buffer &out);
/**
* Bandtrim searches for NULL pixels in all bands of a cube.
* When a NULL pixel is found the corresponding pixel is set
* to NULL in all other bands.
*
* @param ui User Interface with application parameters
*/
void bandtrim(UserInterface &ui) {
// open cube
Cube icube;
icube.open(ui.GetCubeName("FROM"));
bandtrim(&icube, ui);
}
/**
* Bandtrim searches for NULL pixels in all bands of a cube.
* When a NULL pixel is found the corresponding pixel is set
* to NULL in all other bands.
*
* @param icube Input cube
* @param ui User Interface with application parameters
*/
void bandtrim(Cube *icube, UserInterface &ui) {
ProcessByBrick p;
p.SetInputCube(icube);
p.SetBrickSize(1, 1, icube->bandCount());
QString fname = ui.GetCubeName("TO");
CubeAttributeOutput &atts = ui.GetOutputAttribute("TO");
p.SetOutputCube(fname, atts);
p.StartProcess(BandTrimSpectral);
p.EndProcess();
}
// Process to trim spectral pixels if any are null
void BandTrimSpectral(Buffer &in, Buffer &out) {
// Copy input to output and check to see if we should null
bool nullPixels = false;
for(int i = 0; i < in.size(); i++) {
out[i] = in[i];
if(in[i] == Isis::Null) nullPixels = true;
}
// Null all pixels in the spectra if necessary
if(nullPixels) {
for(int i = 0; i < in.size(); i++) {
out[i] = Isis::Null;
}
}
}
}
\ No newline at end of file
/** This is free and unencumbered software released into the public domain.
The authors of ISIS do not claim copyright on the contents of this file.
For more details about the LICENSE terms and the AUTHORS, you will
find files of those names at the top level of this repository. **/
/* SPDX-License-Identifier: CC0-1.0 */
#ifndef bandtrim_h
#define bandtrim_h
#include "UserInterface.h"
namespace Isis{
extern void bandtrim(UserInterface &ui);
extern void bandtrim(Cube *iCube, UserInterface &ui);
}
#endif
...@@ -35,6 +35,9 @@ ...@@ -35,6 +35,9 @@
<change name="Steven Lambright" date="2008-05-12"> <change name="Steven Lambright" date="2008-05-12">
Removed references to CubeInfo Removed references to CubeInfo
</change> </change>
<change name="Ken Edmundson" date="2024-07-31">
Converted to callable app and converted Makefile tests to gtests.
</change>
</history> </history>
<groups> <groups>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment