forked from PolusAI/nyxus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into image_quality_v5
- Loading branch information
Showing
55 changed files
with
1,757 additions
and
1,322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#include "cli_glcm_options.h" | ||
#include "features/glcm.h" | ||
|
||
using namespace Nyxus; | ||
|
||
bool GLCMoptions::parse_input() | ||
{ | ||
if (!rawAngles.empty()) | ||
{ | ||
//==== Parse rotations | ||
if (!rawAngles.empty()) | ||
{ | ||
std::string ermsg; | ||
if (!Nyxus::parse_delimited_string_list_to_ints(rawAngles, glcmAngles, ermsg)) | ||
{ | ||
std::cerr << "Error parsing list of integers " << rawAngles << ": " << ermsg << "\n"; | ||
return false; | ||
} | ||
|
||
// The angle list parsed well, let's tell it to GLCMFeature | ||
GLCMFeature::angles = glcmAngles; | ||
} | ||
} | ||
|
||
if (!rawOffs.empty()) | ||
{ | ||
// string -> real | ||
int x; | ||
bool ok = Nyxus::parse_as_int (rawOffs, x); | ||
if (!ok || x <= 0) | ||
{ | ||
ermsg = "Error in " + rawOffs + ": expecting a positive integer value"; | ||
return false; | ||
} | ||
|
||
// set feature class parameter | ||
GLCMFeature::offset = x; | ||
} | ||
|
||
return true; | ||
} | ||
|
||
bool GLCMoptions::empty() | ||
{ | ||
return rawAngles.empty() && rawOffs.empty(); | ||
} | ||
|
||
std::string GLCMoptions::get_last_er_msg() | ||
{ | ||
return ermsg; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
class GLCMoptions | ||
{ | ||
public: | ||
// Parses 'raw*', set 'defined_' and 'ermsg' | ||
bool parse_input(); | ||
|
||
std::string get_last_er_msg(); | ||
|
||
bool empty(); | ||
|
||
// intentionally public to be accessed by Environment | ||
std::string rawOffs = "", // matches GLCMOFFSET | ||
rawAngles = ""; // matches GLCMANGLES | ||
|
||
std::vector<int> glcmAngles = { 0, 45, 90, 135 }; | ||
|
||
private: | ||
bool defined_ = false; | ||
std::string ermsg = ""; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.