Skip to content

Commit

Permalink
Merge pull request #102 from friskluft/POL2510_gldzm
Browse files Browse the repository at this point in the history
GLDZM feature group
  • Loading branch information
hsidky authored Apr 24, 2023
2 parents d467206 + 8d4b260 commit f9cc922
Show file tree
Hide file tree
Showing 19 changed files with 728 additions and 19 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ set(SOURCE
src/nyx/features/glcm.cpp
src/nyx/features/glcm_nontriv.cpp
src/nyx/features/gldm.cpp
src/nyx/features/gldzm.cpp
src/nyx/features/glrlm.cpp
src/nyx/features/glszm.cpp
src/nyx/features/hexagonality_polygonality.cpp
Expand Down
2 changes: 1 addition & 1 deletion src/nyx/environment.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#define ONLINESTATSTHRESH "--onlineStatsThresh" // Environment :: onlineStatsThreshold -- Example: --onlineStatsThresh=150
#define XYRESOLUTION "--pixelsPerCentimeter" // pixels per centimeter
#define PXLDIST "--pixelDistance" // used in neighbor features
#define COARSEGRAYDEPTH "--coarseGrayDepth" // Default - 8
#define COARSEGRAYDEPTH "--coarseGrayDepth" // Environment :: raw_coarse_grayscale_depth
#define RAMLIMIT "--ramLimit" // Optional. Limit for treating ROIs as non-trivial and for setting the batch size of trivial ROIs. Default - amount of available system RAM
#define TEMPDIR "--tempDir" // Optional. Used in processing non-trivial features. Default - system temp directory
#define IBSICOMPLIANCE "--ibsi" // skip binning for grey level and grey tone features
Expand Down
6 changes: 3 additions & 3 deletions src/nyx/feature_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ bool FeatureManager::check_11_correspondence()
else // error - no providers
{
success = false;
std::cout << "Error: feature " << theFeatureSet.findFeatureNameByCode((AvailableFeatures)i_fcode) << " (code " << i_fcode << ") is not provided by any feature method \n";
std::cout << "Error: feature " << theFeatureSet.findFeatureNameByCode((AvailableFeatures)i_fcode) << " (code " << i_fcode << ") is not provided by any feature method. Check constructor of class FeatureManager\n";
}
}

Expand Down Expand Up @@ -199,15 +199,15 @@ void FeatureManager::build_user_requested_set()
FeatureMethod* fm = get_feature_method_by_code (fc);

if (fm == nullptr)
throw (std::runtime_error("Feature " + std::to_string(fc) + " is not provided by any feature method"));
throw (std::runtime_error("Feature " + std::to_string(fc) + " is not provided by any feature method. Check constructor of class FeatureManager"));

// first, save feature methods of fm's dependencies
for (auto depend_fc : fm->dependencies)
{
FeatureMethod* depend_fm = get_feature_method_by_code (depend_fc);

if (depend_fm == nullptr)
throw (std::runtime_error("Feature " + std::to_string(depend_fc) + " is not provided by any feature method"));
throw (std::runtime_error("Feature " + std::to_string(depend_fc) + " is not provided by any feature method. Check constructor of class FeatureManager"));

// save this fm if it's not yet saved
if (std::find(user_requested_features.begin(), user_requested_features.end(), depend_fm) == user_requested_features.end())
Expand Down
4 changes: 3 additions & 1 deletion src/nyx/feature_mgr_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "features/geodetic_len_thickness.h"
#include "features/glcm.h"
#include "features/glrlm.h"
#include "features/gldzm.h"
#include "features/glszm.h"
#include "features/gldm.h"
#include "features/hexagonality_polygonality.h"
Expand Down Expand Up @@ -48,7 +49,8 @@ FeatureManager::FeatureManager()
register_feature (new FractalDimensionFeature());
register_feature (new GLCMFeature());
register_feature (new GLRLMFeature());
register_feature (new GLSZMFeature());
register_feature (new GLDZMFeature());
register_feature (new GLSZMFeature());
register_feature (new GLDMFeature());
register_feature (new NGTDMFeature());
register_feature (new ImageMomentsFeature());
Expand Down
4 changes: 2 additions & 2 deletions src/nyx/features/gldm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ void GLDMFeature::calculate(LR& r)
bool disableGrayBinning = Environment::ibsi_compliance || nGrays >= piRange;

// Gather zones
for (int row = 0; row < D.height(); row++)
for (int col = 0; col < D.width(); col++)
for (int row = 0; row < D.get_height(); row++)
for (int col = 0; col < D.get_width(); col++)
{
// Find a non-blank pixel
PixIntens pi = Nyxus::to_grayscale (D.yx(row, col), r.aux_min, piRange, nGrays, disableGrayBinning);
Expand Down
Loading

0 comments on commit f9cc922

Please sign in to comment.