diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 808486d7..64f0c4c2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: # - id: check-yaml # checks yaml files for parseable syntax. # - id: debug-statements # checks for debugger imports and py37+ `breakpoint()` calls in python source. - id: destroyed-symlinks # detects symlinks which are changed to regular files with a content of a path which that symlink was pointing to. - - id: detect-aws-credentials # detects *your* aws credentials from the aws cli credentials file. + # - id: detect-aws-credentials # detects *your* aws credentials from the aws cli credentials file. - id: detect-private-key # detects the presence of private keys. # - id: double-quote-string-fixer # replaces double quoted strings with single quoted strings. # - id: end-of-file-fixer # ensures that a file is either empty, or ends with one newline. @@ -66,7 +66,7 @@ repos: # rev: v0.9.0.2 # hooks: # - id: shellcheck -#- repo: https://github.com/codespell-project/codespell -# rev: v2.2.4 -# hooks: -# - id: codespell \ No newline at end of file +- repo: https://github.com/codespell-project/codespell + rev: v2.2.4 + hooks: + - id: codespell \ No newline at end of file diff --git a/README.md b/README.md index 3e716a1b..6d5ae102 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ or conda install nyxus -c conda-forge ``` -Usage is very straightforward. Given `intensities` and `labels` folders, Nyxus pairs up intensity-label images and extracts features from all of them. A summary of the avaialble feature are [listed below](#available-features). +Usage is very straightforward. Given `intensities` and `labels` folders, Nyxus pairs up intensity-label images and extracts features from all of them. A summary of the available feature are [listed below](#available-features). ```python from nyxus import Nyxus @@ -138,7 +138,7 @@ Nyxus can also be [built from source](#building-from-source) and used from the c ## Getting and setting parameters of Nyxus All parameters to configure Nyxus are available to set within the constructor. These parameters can also be updated after the object is created using the `set_params` -method. This method takes in keyword arguments where the key is a valid parameter in Nyxus and the value is the updated value for the paramter. For example, +method. This method takes in keyword arguments where the key is a valid parameter in Nyxus and the value is the updated value for the parameter. For example, to update the `coarse_gray_depth` to 256 and the `gabor_f0` parameter to 0.1, the following can be done: ```python @@ -301,7 +301,7 @@ Nyxus provides a set of pixel intensity, morphology, texture, intensity distribu | INTEGRATED_INTENSITY | Integrated intensity of the region of interest (ROI) | | MEAN, MAX, MEDIAN, STANDARD_DEVIATION, MODE | Mean/max/median/stddev/mode intensity value of the ROI | | SKEWNESS, KURTOSIS, HYPERSKEWNESS, HYPERFLATNESS | higher standardized moments | -| MEAN_ABSOLUTE_DEVIATION | Mean absolute devation | +| MEAN_ABSOLUTE_DEVIATION | Mean absolute deviation | | ENERGY | ROI energy | | ROOT_MEAN_SQUARED | Root of mean squared deviation | | ENTROPY | ROI entropy - a measure of the amount of information in the ROI | diff --git a/ci-utils/build_conda.sh b/ci-utils/build_conda.sh index 56ba36ee..21c0e76f 100755 --- a/ci-utils/build_conda.sh +++ b/ci-utils/build_conda.sh @@ -13,7 +13,7 @@ then exit fi -MINICONDA=$PWD/miniconda-for-nyxus # Modify this to your preferred location for persistance +MINICONDA=$PWD/miniconda-for-nyxus # Modify this to your preferred location for persistence CPP_BUILD_DIR=$PWD SRC_ROOT=$1 #source dir location NYXUS_ROOT=$SRC_ROOT diff --git a/codespellignore.txt b/codespellignore.txt index fc25256a..ab2c52fc 100644 --- a/codespellignore.txt +++ b/codespellignore.txt @@ -2,3 +2,7 @@ nd Nd ans ser +jave +Numer. +Wee +Fertil \ No newline at end of file diff --git a/docs/source/Math/f_2dmoments.rst b/docs/source/Math/f_2dmoments.rst index 89b4c3aa..9f28677c 100644 --- a/docs/source/Math/f_2dmoments.rst +++ b/docs/source/Math/f_2dmoments.rst @@ -40,7 +40,7 @@ and represent the center of mass of the image :math:`f(x,y)`. Hu's Uniqueness Theorem states that if :math:`f(x,y)` is piecewise continuous and has nonzero values only in the finite part of the :math:`(x,y)` plane, then geometric moments of all orders exist. It can then be shown that the moment set :math:`{\mu_{pq}}` is uniquely determined by :math:`f(x,y)` and conversely, :math:`f(x,y)` is uniquely determined by :math:`{\mu_{pq}}`. Since an image has -finite area, a moment set can be evaluted computationally and used to uniquely describe the information contained in the image. +finite area, a moment set can be evaluated computationally and used to uniquely describe the information contained in the image. Raw moments ----------- diff --git a/docs/source/Math/f_gldzm.rst b/docs/source/Math/f_gldzm.rst index 65578c31..89d9c196 100644 --- a/docs/source/Math/f_gldzm.rst +++ b/docs/source/Math/f_gldzm.rst @@ -20,7 +20,7 @@ The continuity is meant as a 4-connected neighbourhood. For example, the followi \fbox{3} & 1 & 0 & 0 & 0 & 1 & 0 \end{bmatrix} -The zone's distance is the minimum of its each pixel's distance to the ROI or image border measured as the number of pixel boudaries to the first off-ROI or off-image pixel. +The zone's distance is the minimum of its each pixel's distance to the ROI or image border measured as the number of pixel boundaries to the first off-ROI or off-image pixel. Considering the following ROI image @@ -93,7 +93,7 @@ Applied to the example, the GLDZM :math:`M(I_2)` of image :math:`I_2` having dis 1 & 1 & 0\end{bmatrix} Let -:math:`m(x,d)` be an element ofthe distance zone matrix corresponding to grey level :math:`x` and zone distance :math:`d` , +:math:`m(x,d)` be an element of the distance zone matrix corresponding to grey level :math:`x` and zone distance :math:`d` , :math:`N_g` -- the number of grey levels , diff --git a/docs/source/Math/f_ngtdm.rst b/docs/source/Math/f_ngtdm.rst index d7399f23..588c5620 100644 --- a/docs/source/Math/f_ngtdm.rst +++ b/docs/source/Math/f_ngtdm.rst @@ -4,8 +4,8 @@ Texture features / NGTDM A Neighbouring Gray Tone Difference Matrix quantifies the difference between a gray value and the average gray value of its neighbours within distance :math:`\delta`. The sum of absolute differences for gray level :math:`i` is stored in the matrix. -Let :math:`\textbf{X}_{gl}` be a set of segmented voxels and :math:`x_{gl}(j_x,j_y,j_z) \in \textbf{X}_{gl}` be the gray level of a voxel at postion -:math:`(j_x,j_y,j_z)`, then the average gray level of the neigbourhood is: +Let :math:`\textbf{X}_{gl}` be a set of segmented voxels and :math:`x_{gl}(j_x,j_y,j_z) \in \textbf{X}_{gl}` be the gray level of a voxel at position +:math:`(j_x,j_y,j_z)`, then the average gray level of the neighborhood is: .. math:: diff --git a/docs/source/cmdline_and_examples.rst b/docs/source/cmdline_and_examples.rst index bb49b729..34f36c6d 100644 --- a/docs/source/cmdline_and_examples.rst +++ b/docs/source/cmdline_and_examples.rst @@ -4,7 +4,7 @@ Command line Assuming you built the Nyxus executable from source code, the following parameters are available for the command -line usage. Regular comand line users should adhere +line usage. Regular command line users should adhere parameter value to the "Type" column. WIPP developers should adhere to columns "WIPP I/O role" and "WIPP type". @@ -345,7 +345,7 @@ The `features` variable will now use the custom names, as shown below 14 custom_seg_name2 Intensity2 6 54573.3 54573.3 ... 0.980769 All parameters to configure Nyxus are available to set within the constructor. These parameters can also be updated after the object is created using the `set_params` -method. This method takes in keyword arguments where the key is a valid parameter in Nyxus and the value is the updated value for the paramter. For example, +method. This method takes in keyword arguments where the key is a valid parameter in Nyxus and the value is the updated value for the parameter. For example, to update the `coarse_gray_depth` to 256 and the `gabor_f0` parameter to 0.1, the following can be done: .. code-block:: python diff --git a/docs/source/devguide.rst b/docs/source/devguide.rst index f8dc225e..6ca10900 100644 --- a/docs/source/devguide.rst +++ b/docs/source/devguide.rst @@ -45,7 +45,7 @@ edit the integer to string feature identifier mapping in mapping UserFacingFeatu Step 3 - create a feature method class ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Any Nyxus feature needs to be derived from class FeatureMethod defining a particular calculator of one or multiple features. FeatureMethod is a skeleton of the custom feature calculator responding to image data streamed to it in various ways - pixel by pixel (so called online mode), as a cached pixel cloud in the form of std::vector\ :raw-html-m2r:`` object for images whose size permits caching a single ROI's data in user computer's RAM (so called trivial ROIs), and as a browser of a mask-intensity image pair for ROIs whose cache exceeds the RAM limit (so called non-trivial or oversized ROIs). All the particular feature calculation logic neds to be placed in your implementation of FeatureMethod's pure virtual methods. The class's header and source files are suggested to be placed in directory "features". For example, if we want to implement a class calculating a 3-segmental ROI intensity statistics (means) weighted by unit perimeter length delivered to user as features MYFEATURE1, MYFEATURE2, and MYFEATURE3: +Any Nyxus feature needs to be derived from class FeatureMethod defining a particular calculator of one or multiple features. FeatureMethod is a skeleton of the custom feature calculator responding to image data streamed to it in various ways - pixel by pixel (so called online mode), as a cached pixel cloud in the form of std::vector\ :raw-html-m2r:`` object for images whose size permits caching a single ROI's data in user computer's RAM (so called trivial ROIs), and as a browser of a mask-intensity image pair for ROIs whose cache exceeds the RAM limit (so called non-trivial or oversized ROIs). All the particular feature calculation logic needs to be placed in your implementation of FeatureMethod's pure virtual methods. The class's header and source files are suggested to be placed in directory "features". For example, if we want to implement a class calculating a 3-segmental ROI intensity statistics (means) weighted by unit perimeter length delivered to user as features MYFEATURE1, MYFEATURE2, and MYFEATURE3: .. code-block:: c++ @@ -135,7 +135,7 @@ For example Step 8 - implement feature calculation of oversized ROIs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -An oversized ROI's cached data cannot fit in computer meory so in the oversized ROI scenarios we cannot rely on its pixel cloud or image matrix. Instead, all the calculations should be performed "in place" - using the image browser class ImageLoader (header image_loader.h) similarly to class ImageMatrix (image_matrix.h) and creating out of memory cache using classes OutOfRamPixelCloud, OOR_ReadMatrix, ReadImageMatrix_nontriv, and WriteImageMatrix_nontriv (header image_matrix.nontriv). You are guaranteed to have initialized object LR::osized_pixel_cloud prior to the call of method osized_calculate(). For example: +An oversized ROI's cached data cannot fit in computer memory so in the oversized ROI scenarios we cannot rely on its pixel cloud or image matrix. Instead, all the calculations should be performed "in place" - using the image browser class ImageLoader (header image_loader.h) similarly to class ImageMatrix (image_matrix.h) and creating out of memory cache using classes OutOfRamPixelCloud, OOR_ReadMatrix, ReadImageMatrix_nontriv, and WriteImageMatrix_nontriv (header image_matrix.nontriv). You are guaranteed to have initialized object LR::osized_pixel_cloud prior to the call of method osized_calculate(). For example: .. code-block:: c++ @@ -225,7 +225,7 @@ Often multiple features need to be calculated together and the user faces the ne nyxus --features=AREA_PIXELS_COUNT,AREA_UM2,CENTROID_X,CENTROID_Y,BBOX_YMIN,BBOX_XMIN,BBOX_HEIGHT,BBOX_WIDTH --intDir=/home/ec2-user/work/datasetXYZ/int --segDir=/home/ec2-user/work/dataXYZ/seg --outDir=/home/ec2-user/work/datasetXYZ --filePattern=.* --outputType=separatecsv -Features can be grouped toegther and gived convenient aliases, for example the above features AREA_PIXELS_COUNT, AREA_UM2, CENTROID_X, CENTROID_Y, BBOX_YMIN, BBOX_XMIN, BBOX_HEIGHT, and BBOX_WIDTH can be refered to as \*BASIC_MORPHOLOGY\* . (Asterisks are a part of the alias and aren't special symbols.) The command line then becomes simpler +Features can be grouped toegther and given convenient aliases, for example the above features AREA_PIXELS_COUNT, AREA_UM2, CENTROID_X, CENTROID_Y, BBOX_YMIN, BBOX_XMIN, BBOX_HEIGHT, and BBOX_WIDTH can be referred to as \*BASIC_MORPHOLOGY\* . (Asterisks are a part of the alias and aren't special symbols.) The command line then becomes simpler .. code-block:: bash diff --git a/docs/source/featurelist.rst b/docs/source/featurelist.rst index 99eb28d6..0b6c2a98 100644 --- a/docs/source/featurelist.rst +++ b/docs/source/featurelist.rst @@ -44,9 +44,9 @@ Nyxus provided features * - HYPERFLATNESS - Hyperflatness - the 6th standardized moment * - MEAN_ABSOLUTE_DEVIATION - - Mean absolute devation + - Mean absolute deviation * - MEDIAN_ABSOLUTE_DEVIATION - - Median absolute devation + - Median absolute deviation * - ENERGY - ROI energy * - ROOT_MEAN_SQUARED diff --git a/docs/source/supported_formats.rst b/docs/source/supported_formats.rst index 7739bee0..ebb8bda5 100644 --- a/docs/source/supported_formats.rst +++ b/docs/source/supported_formats.rst @@ -5,7 +5,7 @@ Supported Image Formats Currently, Nyxus supports OME-TIFF, OME-Zarr and DICOM 2D Grayscale images. OME-TIFF images uses the standard TIFF specification to store one or multiple image planes. OME-TIFF images are always structured as -5D data((T)ime, (C)hannel, Z, Y and X). For 2D single channel image, Z, C and T dimentions are constrained to be one. OME-TIFF images also contain an XML +5D data((T)ime, (C)hannel, Z, Y and X). For 2D single channel image, Z, C and T dimensions are constrained to be one. OME-TIFF images also contain an XML document stored under the ``IMAGE_DESCRIPTION`` tag. This XML document contains the metadata to extract Image File Directory (IFD) for a given T, C and Z position. Since, Nyxus only processes grayscale 2D images at a fixed time point, the images are assumed to have only one IFD, and the internal loader reads the first IFD even if the image file contains multiple IFDs. diff --git a/plugin.json b/plugin.json index 8039d518..3ab2a3c3 100644 --- a/plugin.json +++ b/plugin.json @@ -1191,7 +1191,7 @@ { "key": "inputs.outputType", "title": "Output file type", - "description": "Save csv file separately for each image or one csv file for all images. Alternatively, outuput can be written as arrow or parquet file" + "description": "Save csv file separately for each image or one csv file for all images. Alternatively, output can be written as arrow or parquet file" }, { "key": "inputs.embeddedpixelsize", diff --git a/src/nyx/cli_nested_roi_options.cpp b/src/nyx/cli_nested_roi_options.cpp index ae99276c..76b9cd20 100644 --- a/src/nyx/cli_nested_roi_options.cpp +++ b/src/nyx/cli_nested_roi_options.cpp @@ -441,7 +441,7 @@ namespace Nyxus int lPar = p.first; auto nCh = r.children.size(); - // Search this parent's feature extraction result recod + // Search this parent's feature extraction result record std::string csvFP = get_feature_output_fname(r.intFname, r.segFname); std::string csvWholeline; std::vector csvHeader, csvFields; diff --git a/src/nyx/environment.cpp b/src/nyx/environment.cpp index 521223ec..88281c51 100644 --- a/src/nyx/environment.cpp +++ b/src/nyx/environment.cpp @@ -42,7 +42,7 @@ namespace Nyxus // Check individual features for (const auto &s : strings) { - // Forgive user's typos of consequtive commas e.g. MIN,MAX,,MEDIAN + // Forgive user's typos of consecutive commas e.g. MIN,MAX,,MEDIAN if (s.empty()) continue; diff --git a/src/nyx/feature_method.h b/src/nyx/feature_method.h index 72e169dd..998cd08f 100644 --- a/src/nyx/feature_method.h +++ b/src/nyx/feature_method.h @@ -29,7 +29,7 @@ class FeatureMethod virtual void osized_reduce() final {}; // Get rid of this method in all derived virtual void osized_calculate (LR& r, ImageLoader& imloader) = 0; // Called once right after having scanned the ROI in the raster order. Put your reduction or summarization of data gathered in osized_add_online_pixel() - // Put method-dependent set of calculation results in the standard feature results list further savable as CSV-file + // Put method-dependent set of calculation results in the standard feature results list further saveable as CSV-file virtual void save_value(std::vector>& feature_vals) = 0; // Feature-specific cache clean-up diff --git a/src/nyx/features/basic_morphology.cpp b/src/nyx/features/basic_morphology.cpp index c08bb78d..a23ce19c 100644 --- a/src/nyx/features/basic_morphology.cpp +++ b/src/nyx/features/basic_morphology.cpp @@ -80,7 +80,7 @@ void BasicMorphologyFeatures::calculate(LR& r) for (auto& px : r.raw_pixels) { - // the "+1" is only for compatability with matlab code (where index starts from 1) + // the "+1" is only for compatibility with matlab code (where index starts from 1) x_mass = x_mass + (px.x + 1) * px.inten; y_mass = y_mass + (px.y + 1) * px.inten; mass += px.inten; @@ -171,7 +171,7 @@ void BasicMorphologyFeatures::osized_calculate(LR& r, ImageLoader& imloader) for (size_t i = 0; i < r.raw_pixels_NT.size(); i++) // for (auto& px : r.raw_pixels) { auto px = r.raw_pixels_NT.get_at(i); - // the "+1" is only for compatability with matlab code (where index starts from 1) + // the "+1" is only for compatibility with matlab code (where index starts from 1) x_mass = x_mass + (px.x + 1) * px.inten; y_mass = y_mass + (px.y + 1) * px.inten; mass += px.inten; diff --git a/src/nyx/features/chords.h b/src/nyx/features/chords.h index bbeecd8a..6864ec14 100644 --- a/src/nyx/features/chords.h +++ b/src/nyx/features/chords.h @@ -41,11 +41,11 @@ class Chords_feature Chords_feature (const std::vector & raw_pixels, const AABB & bb, const double cenx, const double ceny); /// @brief Calculated maxchords statistics - /// @return Tupple of [0] max, [1] min, [2] median, [3] mean, [4] mode, [5] std, [6] min_angle, [7] max_angle + /// @return Tuple of [0] max, [1] min, [2] median, [3] mean, [4] mode, [5] std, [6] min_angle, [7] max_angle std::tuple get_maxchords_stats(); /// @brief Calculated allchords statistics - /// @return Tupple of [0] max, [1] min, [2] median, [3] mean, [4] mode, [5] std, [6] min_angle, [7] max_angle + /// @return Tuple of [0] max, [1] min, [2] median, [3] mean, [4] mode, [5] std, [6] min_angle, [7] max_angle std::tuple get_allchords_stats(); /// @brief Calculates "maxchords" and "allchords" features for a range of ROI labels diff --git a/src/nyx/features/contour.cpp b/src/nyx/features/contour.cpp index c3d84dac..2ca289fd 100644 --- a/src/nyx/features/contour.cpp +++ b/src/nyx/features/contour.cpp @@ -159,7 +159,7 @@ void ContourFeature::buildRegularContour(LR& r) if (counter2 > 8) { // If counter2 is above 8, we have sought around the neighborhood and - // therefor the border is a single non-blank pixel, and we can exit + // therefore the border is a single non-blank pixel, and we can exit counter2 = 0; break; } @@ -200,7 +200,7 @@ void ContourFeature::buildRegularContour(LR& r) std::cout << "\n\n\n"; ); - //==== Remove padding and save the countour image as a vector of non-blank pixels + //==== Remove padding and save the contour image as a vector of non-blank pixels AABB & bb = r.aabb; // r.aux_image_matrix.original_aabb; int base_x = bb.get_xmin(), base_y = bb.get_ymin(); @@ -213,7 +213,7 @@ void ContourFeature::buildRegularContour(LR& r) auto inte = borderImage[idx]; if (inte) { - Pixel2 p(x, y, inte - 1); // Undecorate the intesity + Pixel2 p(x, y, inte - 1); // Undecorate the intensity r.contour.push_back(p); } } @@ -251,7 +251,7 @@ void ContourFeature::buildRegularContour(LR& r) cands.push_back(px); } - // --are there any tip's neighbr candidate? + // --are there any tip's neighbor candidate? if (!cands.empty()) { int distMin = pxTip.sqdist(cands[0]); @@ -483,7 +483,7 @@ void ContourFeature::buildRegularContour_nontriv(LR& r) if (counter2 > 8) { // If counter2 is above 8 we have traced around the neighborhood and - // therefor the border is a single black pixel and we can exit + // therefore the border is a single black pixel and we can exit counter2 = 0; break; } @@ -496,7 +496,7 @@ void ContourFeature::buildRegularContour_nontriv(LR& r) } } - //==== Remove padding and save the countour image as a vector of contour-onlu pixels + //==== Remove padding and save the contour image as a vector of contour-onlu pixels AABB& bb = r.aabb; // r.aux_image_matrix.original_aabb; int base_x = bb.get_xmin(), base_y = bb.get_ymin(); diff --git a/src/nyx/features/ellipse_fitting.h b/src/nyx/features/ellipse_fitting.h index b42cd370..118435f1 100644 --- a/src/nyx/features/ellipse_fitting.h +++ b/src/nyx/features/ellipse_fitting.h @@ -40,7 +40,7 @@ class EllipseFittingFeature: public FeatureMethod /// @return Value of the ellipse elongation feature double get_elongation(); - /// @brief Orientation describes whather the ellipse is horizontal or vertical + /// @brief Orientation describes whether the ellipse is horizontal or vertical /// @return double get_orientation(); diff --git a/src/nyx/features/gabor.cpp b/src/nyx/features/gabor.cpp index f020e3a1..7d0b4f2d 100644 --- a/src/nyx/features/gabor.cpp +++ b/src/nyx/features/gabor.cpp @@ -65,7 +65,7 @@ void GaborFeature::calculate (LR& r) if (double(a) > cmpval) baselineScore++; - // Iterate frequencies and score corresponding filter responce over the baseline + // Iterate frequencies and score corresponding filter response over the baseline for (int i=0; i < nFreqs; i++) { // filter response for i-th frequency @@ -137,7 +137,7 @@ void GaborFeature::calculate_gpu (LR& r) if (double(a) > cmpval) baselineScore++; - // Iterate frequencies and score corresponding filter responce over the baseline + // Iterate frequencies and score corresponding filter response over the baseline for (int i=0; i < nFreqs; i++) { // filter response for i-th frequency @@ -198,7 +198,7 @@ void GaborFeature::calculate_gpu_multi_filter (LR& r) tx.resize (n + 1); ty.resize (n + 1); - // Variables that will be initialized in the 1-st iteration of the fillowing loop + // Variables that will be initialized in the 1-st iteration of the following loop unsigned long baselineScore = 0; // abundance of baseline signal pixels over its average double maxval = 0.0; // max value of the baseline signal @@ -302,7 +302,7 @@ void GaborFeature::conv_dud( mc = ma + mb - 1; nc = (na + nb - 1) * 2; - // initalize the output matrix + // initialize the output matrix int mcnc = mc * nc; for (int i = 0; i < mcnc; i++) C[i] = 0.0; diff --git a/src/nyx/features/gabor_nontriv.cpp b/src/nyx/features/gabor_nontriv.cpp index 8ee1ec7f..09397951 100644 --- a/src/nyx/features/gabor_nontriv.cpp +++ b/src/nyx/features/gabor_nontriv.cpp @@ -185,7 +185,7 @@ void GaborFeature::conv_dud_NT ( mc = ma + mb - 1; nc = (na + nb - 1) * 2; - // initalize the output matrix + // initialize the output matrix int mcnc = mc * nc; for (int i = 0; i < mcnc; i++) C[i] = 0.0; diff --git a/src/nyx/features/geo_len_thickness.cpp b/src/nyx/features/geo_len_thickness.cpp index 3b467970..368daf20 100644 --- a/src/nyx/features/geo_len_thickness.cpp +++ b/src/nyx/features/geo_len_thickness.cpp @@ -18,7 +18,7 @@ void GeodeticLengthThicknessFeature::calculate (LR& r) if (SqRootTmp < 0) SqRootTmp = 0; - // Calcuate geodetic_length with pq-formula (see above): + // Calculate geodetic_length with pq-formula (see above): geodetic_length = roiPerimeter / 4 + sqrt(SqRootTmp); // Calculate thickness by rewriting Equation (2): diff --git a/src/nyx/features/gldm.h b/src/nyx/features/gldm.h index 5852bd29..2ffc74a0 100644 --- a/src/nyx/features/gldm.h +++ b/src/nyx/features/gldm.h @@ -88,8 +88,8 @@ class GLDMFeature: public FeatureMethod private: bool bad_roi_data = false; // used to prevent calculation of degenerate ROIs - int Ng = 0; // number of discreet intensity values in the image - int Nd = 0; // number of discreet dependency sizes in the image + int Ng = 0; // number of discrete intensity values in the image + int Nd = 0; // number of discrete dependency sizes in the image int Nz = 0; // number of dependency zones in the ROI, Nz = sum(sum(P[i,j])) double sum_p = 0; diff --git a/src/nyx/features/glrlm.h b/src/nyx/features/glrlm.h index e775ce28..f3c5ea61 100644 --- a/src/nyx/features/glrlm.h +++ b/src/nyx/features/glrlm.h @@ -109,8 +109,8 @@ class GLRLMFeature: public FeatureMethod angled_LRHGLE; bool bad_roi_data = false; // used to prevent calculation of degenerate ROIs - std::vector angles_Ng; // number of discreet intensity values in the image - std::vector angles_Nr; // number of discreet run lengths in the image + std::vector angles_Ng; // number of discrete intensity values in the image + std::vector angles_Nr; // number of discrete run lengths in the image std::vector angles_Np; // number of voxels in the image std::vector angles_P; std::vector sum_p; diff --git a/src/nyx/features/glszm.cpp b/src/nyx/features/glszm.cpp index b5d6d587..856441a3 100644 --- a/src/nyx/features/glszm.cpp +++ b/src/nyx/features/glszm.cpp @@ -11,7 +11,7 @@ GLSZMFeature::GLSZMFeature() : FeatureMethod("GLSZMFeature") provide_features (GLSZMFeature::featureset); } -void GLSZMFeature::osized_add_online_pixel (size_t x, size_t y, uint32_t intensity) {} // Not suporting +void GLSZMFeature::osized_add_online_pixel (size_t x, size_t y, uint32_t intensity) {} // Not supporting void GLSZMFeature::osized_calculate (LR& r, ImageLoader&) { diff --git a/src/nyx/features/glszm.h b/src/nyx/features/glszm.h index cc2e46a6..c76c4faf 100644 --- a/src/nyx/features/glszm.h +++ b/src/nyx/features/glszm.h @@ -103,8 +103,8 @@ class GLSZMFeature: public FeatureMethod private: bool bad_roi_data = false; // used to prevent calculation of degenerate ROIs - int Ng = 0; // number of discreet intensity values in the image - int Ns = 0; // number of discreet zone sizes in the image + int Ng = 0; // number of discrete intensity values in the image + int Ns = 0; // number of discrete zone sizes in the image int Np = 0; // number of voxels in the image int Nz = 0; // number of zones in the ROI, 1<=Nz<=Np SimpleMatrix P; @@ -123,8 +123,8 @@ class GLSZMFeature: public FeatureMethod void clear_buffers() { bad_roi_data = false; // used to prevent calculation of degenerate ROIs - Ng = 0; // number of discreet intensity values in the image - Ns = 0; // number of discreet zone sizes in the image + Ng = 0; // number of discrete intensity values in the image + Ns = 0; // number of discrete zone sizes in the image Np = 0; // number of voxels in the image Nz = 0; // number of zones in the ROI, 1<=Nz<=Np P.clear(); diff --git a/src/nyx/features/hexagonality_polygonality.cpp b/src/nyx/features/hexagonality_polygonality.cpp index 54cdb436..7ce747fd 100644 --- a/src/nyx/features/hexagonality_polygonality.cpp +++ b/src/nyx/features/hexagonality_polygonality.cpp @@ -111,7 +111,7 @@ void HexagonalityPolygonalityFeature::calculate (LR& r) std::vector list_perim = { perim1, perim2, perim3, perim4, perim5, perim6, perim7, perim8, perim9, perim10, perim11, perim12, perim13, perim14 }; std::vector perim_array; - // 1 - Create an array of the ratio of all Perimeters to eachother. 2 - Create Summary statistics of all array ratios. + // 1 - Create an array of the ratio of all Perimeters to each other. 2 - Create Summary statistics of all array ratios. double sum2 = 0; for (int ib = 0; ib < list_perim.size(); ++ib) for (int ic = ib + 1; ic < list_perim.size(); ++ic) diff --git a/src/nyx/features/neighbors.cpp b/src/nyx/features/neighbors.cpp index 439bd00f..9c1219ef 100644 --- a/src/nyx/features/neighbors.cpp +++ b/src/nyx/features/neighbors.cpp @@ -99,7 +99,7 @@ void parallel_process_1_batch_of_collision_pairs (size_t start, size_t end, std: // Save partial statis of r1's touching pixel stats r1.fvals[PERCENT_TOUCHING][0] += n_touchingOuterPixels; - // Definitely neigbors + // Definitely neighbors r1.fvals[NUM_NEIGHBORS][0]++; r1.aux_neighboring_labels.push_back(l2); } @@ -211,7 +211,7 @@ void NeighborsFeature::manual_reduce() // Save partial statis of r1's touching pixel stats r1.fvals[PERCENT_TOUCHING][0] += n_touchingOuterPixels; - // Definitely neigbors + // Definitely neighbors r1.fvals[NUM_NEIGHBORS][0]++; r2.fvals[NUM_NEIGHBORS][0]++; r1.aux_neighboring_labels.push_back (l2); @@ -265,7 +265,7 @@ void NeighborsFeature::manual_reduce() // Save partial statis of r1's touching pixel stats r1.fvals[PERCENT_TOUCHING][0] += n_touchingOuterPixels; - // Definitely neigbors + // Definitely neighbors r1.fvals[NUM_NEIGHBORS][0]++; r1.aux_neighboring_labels.push_back(l2); @@ -465,7 +465,7 @@ void NeighborsFeature::manual_reduce() } } - // Angle between neigbors + // Angle between neighbors Moments2 mom2; std::vector anglesRounded; for (auto l : Nyxus::uniqueLabels) @@ -531,8 +531,8 @@ inline unsigned long NeighborsFeature::spat_hash_2d(StatsInt x, StatsInt y, int { unsigned long h = x * 73856093; h = h ^ y * 19349663; - // hash hash  z × 83492791 // For the future - // hash hash  l × 67867979 + // hash hash  z � 83492791 // For the future + // hash hash  l � 67867979 unsigned long retval = h % m; return retval; } diff --git a/src/nyx/features/ngtdm.cpp b/src/nyx/features/ngtdm.cpp index 652114a4..215975eb 100644 --- a/src/nyx/features/ngtdm.cpp +++ b/src/nyx/features/ngtdm.cpp @@ -114,7 +114,7 @@ void NGTDMFeature::calculate (LR& r) nd++; } - // Save the intensity's average neigborhood intensity + // Save the intensity's average neighborhood intensity if (nd > 0) { //if(pi == 1) { // std::cerr << "neigsI: " << neigsI << ", nd: " << nd << std::endl; @@ -274,7 +274,7 @@ void NGTDMFeature::osized_calculate (LR& r, ImageLoader&) nd++; } - // Save the intensity's average neigborhood intensity + // Save the intensity's average neighborhood intensity if (nd > 0) { neigsI /= nd; diff --git a/src/nyx/features/ngtdm.h b/src/nyx/features/ngtdm.h index 91e61700..067e14bf 100644 --- a/src/nyx/features/ngtdm.h +++ b/src/nyx/features/ngtdm.h @@ -10,8 +10,8 @@ /// @brief Neighbouring Gray Tone Difference Matrix (NGTDM) features /// Neighbouring Gray Tone Difference Matrix quantifies the difference between a gray value and the average gray value /// of its neighbours within distance : math:`\delta`. The sum of absolute differences for gray level : math:`i` is stored in the matrix. -/// Let :math:`\textbf{ X }_{ gl }` be a set of segmented voxelsand :math:`x_{gl}(j_x, j_y, j_z) \in \textbf{ X }_{ gl }` be the gray level of a voxel at postion -/// : math:`(j_x, j_y, j_z)`, then the average gray level of the neigbourhood is : +/// Let :math:`\textbf{ X }_{ gl }` be a set of segmented voxelsand :math:`x_{gl}(j_x, j_y, j_z) \in \textbf{ X }_{ gl }` be the gray level of a voxel at position +/// : math:`(j_x, j_y, j_z)`, then the average gray level of the neighborhood is : /// /// ..math:: /// @@ -63,10 +63,10 @@ class NGTDMFeature: public FeatureMethod private: bool bad_roi_data = false; // used to prevent calculation of degenerate ROIs - int Ng = 0; // number of discreet intensity values in the image + int Ng = 0; // number of discrete intensity values in the image int Ngp = 0; // number of non-zero gray levels. Since we keep only informative (non-zero) levels, Ngp is always ==Ng int Nvp = 0; // number of "valid voxels" i.e. those voxels that have at least 1 neighbor - int Nd = 0; // number of discreet dependency sizes in the image + int Nd = 0; // number of discrete dependency sizes in the image int Nz = 0; // number of dependency zones in the ROI, Nz = sum(sum(P[i,j])) double Nvc = 0; // sum of N vector std::vector P, S; diff --git a/src/nyx/features_calc_workflow.cpp b/src/nyx/features_calc_workflow.cpp index 6197b324..34bda171 100644 --- a/src/nyx/features_calc_workflow.cpp +++ b/src/nyx/features_calc_workflow.cpp @@ -70,7 +70,7 @@ namespace Nyxus // Allocate the value matrix for (int i = 0; i < AvailableFeatures::_COUNT_; i++) { - std::vector row{ 0.0 }; // One value initialy. More values can be added for Haralick and Zernike type methods + std::vector row{ 0.0 }; // One value initially. More values can be added for Haralick and Zernike type methods r.fvals.push_back(row); } diff --git a/src/nyx/gpu/gabor.cuh b/src/nyx/gpu/gabor.cuh index a860927d..b6b9913d 100644 --- a/src/nyx/gpu/gabor.cuh +++ b/src/nyx/gpu/gabor.cuh @@ -54,10 +54,10 @@ namespace CuGabor{ * @param out Results array * @param image Image to convolve * @param kernel Kernel - * @param image_n Widht of image - * @param image_m Heigh of image + * @param image_n Width of image + * @param image_m Height of image * @param kernel_n Width of kernel - * @param kernel_m Heigh of image + * @param kernel_m Height of image */ bool conv_dud_gpu_fft(double* out, // must be zeroed const unsigned int* image, diff --git a/src/nyx/gpu/helper_cuda.h b/src/nyx/gpu/helper_cuda.h index fe4742ab..03ba7400 100644 --- a/src/nyx/gpu/helper_cuda.h +++ b/src/nyx/gpu/helper_cuda.h @@ -614,7 +614,7 @@ inline void __getLastCudaError(const char* errorMessage, const char* file, } // This will only print the proper error string when calling cudaGetLastError -// but not exit program incase error detected. +// but not exit program in case error detected. #define printLastCudaError(msg) __printLastCudaError(msg, __FILE__, __LINE__) inline void __printLastCudaError(const char* errorMessage, const char* file, @@ -646,7 +646,7 @@ inline int _ConvertSMVer2Cores(int major, int minor) { // Defines for GPU Architecture types (using the SM version to determine // the # of cores per SM typedef struct { - int SM; // 0xMm (hexidecimal notation), M = SM Major version, + int SM; // 0xMm (hexadecimal notation), M = SM Major version, // and m = SM minor version int Cores; } sSMtoCores; @@ -693,7 +693,7 @@ inline const char* _ConvertSMVer2ArchName(int major, int minor) { // Defines for GPU Architecture types (using the SM version to determine // the GPU Arch name) typedef struct { - int SM; // 0xMm (hexidecimal notation), M = SM Major version, + int SM; // 0xMm (hexadecimal notation), M = SM Major version, // and m = SM minor version const char* name; } sSMtoArchName; diff --git a/src/nyx/output_2_buffer.cpp b/src/nyx/output_2_buffer.cpp index 7ca134f8..4b40ccac 100644 --- a/src/nyx/output_2_buffer.cpp +++ b/src/nyx/output_2_buffer.cpp @@ -57,7 +57,7 @@ namespace Nyxus bool angledGlcmFeature = std::find (GLCMFeature::featureset.begin(), GLCMFeature::featureset.end(), fc) != GLCMFeature::featureset.end(); if (angledGlcmFeature) { - // Polulate with angles + // Populate with angles for (auto ang : theEnvironment.glcmAngles) { std::string col = fn + "_" + std::to_string(ang); @@ -72,7 +72,7 @@ namespace Nyxus bool glrlmFeature = std::find (GLRLMFeature::featureset.begin(), GLRLMFeature::featureset.end(), fc) != GLRLMFeature::featureset.end(); if (glrlmFeature) { - // Polulate with angles + // Populate with angles for (auto ang : GLRLMFeature::rotAngles) { std::string col = fn + "_" + std::to_string(ang); @@ -189,7 +189,7 @@ namespace Nyxus if (vv.size() < GLCMFeature::angles.size()) vv.resize(GLCMFeature::angles.size(), 0.0); - // Polulate with angles + // Populate with angles int nAng = GLCMFeature::angles.size(); for (int i=0; i < nAng; i++) rescache.add_numeric(vv[i]); @@ -202,7 +202,7 @@ namespace Nyxus bool glrlmFeature = std::find (GLRLMFeature::featureset.begin(), GLRLMFeature::featureset.end(), fc) != GLRLMFeature::featureset.end(); if (glrlmFeature) { - // Polulate with angles + // Populate with angles int nAng = 4; for (int i=0; i < nAng; i++) rescache.add_numeric(vv[i]); diff --git a/src/nyx/output_2_csv.cpp b/src/nyx/output_2_csv.cpp index 9ac20ebb..9b573cf1 100644 --- a/src/nyx/output_2_csv.cpp +++ b/src/nyx/output_2_csv.cpp @@ -145,7 +145,7 @@ namespace Nyxus bool angledGlcmFeature = std::find (GLCMFeature::featureset.begin(), GLCMFeature::featureset.end(), fc) != GLCMFeature::featureset.end(); if (angledGlcmFeature) { - // Polulate with angles + // Populate with angles for (auto ang : theEnvironment.glcmAngles) { // CSV separator @@ -161,7 +161,7 @@ namespace Nyxus bool glrlmFeature = std::find (GLRLMFeature::featureset.begin(), GLRLMFeature::featureset.end(), fc) != GLRLMFeature::featureset.end(); if (glrlmFeature) { - // Polulate with angles + // Populate with angles for (auto ang : GLRLMFeature::rotAngles) { ssHead << "," << fn << "_" << ang; @@ -285,7 +285,7 @@ namespace Nyxus bool glrlmFeature = std::find (GLRLMFeature::featureset.begin(), GLRLMFeature::featureset.end(), fc) != GLRLMFeature::featureset.end(); if (glrlmFeature) { - // Polulate with angles + // Populate with angles int nAng = 4; for (int i=0; i < nAng; i++) { diff --git a/src/nyx/output_writers.h b/src/nyx/output_writers.h index 34b60214..24e4c527 100644 --- a/src/nyx/output_writers.h +++ b/src/nyx/output_writers.h @@ -23,7 +23,7 @@ * @brief Base class for creating Apache Arrow output writers * * This class provides methods for the Arrow table used for writing to Arrow formats and - * provides virtual functions to overriden for writing to different formats + * provides virtual functions to overridden for writing to different formats * */ class ApacheArrowWriter @@ -172,7 +172,7 @@ class ParquetWriter : public ApacheArrowWriter { * * @param header Header data * @param string_columns String data (filenames) - * @param numeric_columns Numberic data (feature calculations) + * @param numeric_columns Numeric data (feature calculations) * @param number_of_rows Number of rows * @return arrow::Status */ @@ -215,7 +215,7 @@ class ArrowIPCWriter : public ApacheArrowWriter { * * @param header Header data * @param string_columns String data (filenames) - * @param numeric_columns Numberic data (feature calculations) + * @param numeric_columns Numeric data (feature calculations) * @param number_of_rows Number of rows * @return arrow::Status */ diff --git a/src/nyx/phase2.cpp b/src/nyx/phase2.cpp index 8bd65e3d..25deaca1 100644 --- a/src/nyx/phase2.cpp +++ b/src/nyx/phase2.cpp @@ -279,7 +279,7 @@ namespace Nyxus size_t itemFootprint = r.get_ram_footprint_estimate(); - // Sheck if we are good to accumulate this ROI in the current batch or should close the batch and reduce it + // Check if we are good to accumulate this ROI in the current batch or should close the batch and reduce it if (batchDemand + itemFootprint < memory_limit) { Pending.push_back(lab); diff --git a/src/nyx/python/new_bindings_py.cpp b/src/nyx/python/new_bindings_py.cpp index e77974bc..3cb1d040 100644 --- a/src/nyx/python/new_bindings_py.cpp +++ b/src/nyx/python/new_bindings_py.cpp @@ -643,7 +643,7 @@ PYBIND11_MODULE(backend, m) /// /// The following code block is a quick & simple manual test of the Python interface -/// invokable from from the command line. It lets you bypass building and installing the Python library. +/// invocable from from the command line. It lets you bypass building and installing the Python library. /// To use it, /// #define TESTING_PY_INTERFACE, /// exclude file main_nyxus.cpp from build, and diff --git a/src/nyx/python/nyxus/nyxus.py b/src/nyx/python/nyxus/nyxus.py index 8e2b669c..d7b56801 100644 --- a/src/nyx/python/nyxus/nyxus.py +++ b/src/nyx/python/nyxus/nyxus.py @@ -88,7 +88,7 @@ class Nyxus: Size of filter kernel's side gabor_gamma: float (optional, default 0.1) Aspect ratio of the Gaussian factor - gabor_sig2lam: float (optional, deafult 0.8) + gabor_sig2lam: float (optional, default 0.8) Spatial frequency bandwidth. gabor_f0: float (optional, default 0.1) frequency of the baseline lowpass filter as denominator of `\pi`. diff --git a/tests/test_all.cc b/tests/test_all.cc index aa570fd6..eb59ee9b 100644 --- a/tests/test_all.cc +++ b/tests/test_all.cc @@ -592,7 +592,7 @@ TEST(TEST_NYXUS, TEST_IBSI_NGTDM_STRENGTH) ASSERT_NO_THROW(test_ibsi_ngtdm_strength()); } -//==== Tests of texture feature extraction witout binning +//==== Tests of texture feature extraction without binning // GLCM tests diff --git a/tests/test_ibsi_gldzm.h b/tests/test_ibsi_gldzm.h index 33aa3dfd..1ea7ae24 100644 --- a/tests/test_ibsi_gldzm.h +++ b/tests/test_ibsi_gldzm.h @@ -71,7 +71,7 @@ void test_ibsi_gldzm_feature (const AvailableFeatures& feature, const std::strin // Activate the IBSI compliance mode Environment::ibsi_compliance = true; - // Chck if ground truth is available for the feature + // Check if ground truth is available for the feature ASSERT_TRUE (ibsi_gldzm_gtruth.count(feature_name) > 0); double total = 0; diff --git a/tests/test_ibsi_ngldm.h b/tests/test_ibsi_ngldm.h index ba2659d3..9d627d5d 100644 --- a/tests/test_ibsi_ngldm.h +++ b/tests/test_ibsi_ngldm.h @@ -118,7 +118,7 @@ void test_ibsi_ngldm_feature (const AvailableFeatures& feature, const std::strin // Activate the IBSI compliance mode Environment::ibsi_compliance = true; - // Chck if ground truth is available for the feature + // Check if ground truth is available for the feature ASSERT_TRUE(ibsi_ngldm_gtruth.count(feature_name) > 0); double total = 0;