Skip to content

Commit

Permalink
Merge pull request #139 from jfennick/spelling_fixes
Browse files Browse the repository at this point in the history
apply spelling fixes
  • Loading branch information
sameeul authored Aug 24, 2023
2 parents 813b7aa + 22c10c3 commit bbc8852
Show file tree
Hide file tree
Showing 42 changed files with 92 additions and 88 deletions.
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
- id: codespell
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 |
Expand Down
2 changes: 1 addition & 1 deletion ci-utils/build_conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions codespellignore.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ nd
Nd
ans
ser
jave
Numer.
Wee
Fertil
2 changes: 1 addition & 1 deletion docs/source/Math/f_2dmoments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----------
Expand Down
4 changes: 2 additions & 2 deletions docs/source/Math/f_gldzm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 ,

Expand Down
4 changes: 2 additions & 2 deletions docs/source/Math/f_ngtdm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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::
Expand Down
4 changes: 2 additions & 2 deletions docs/source/cmdline_and_examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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".

Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions docs/source/devguide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:`<Pixel2>` 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:`<Pixel2>` 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++

Expand Down Expand Up @@ -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++

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/source/featurelist.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/source/supported_formats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/nyx/cli_nested_roi_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> csvHeader, csvFields;
Expand Down
2 changes: 1 addition & 1 deletion src/nyx/environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/nyx/feature_method.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::vector<double>>& feature_vals) = 0;

// Feature-specific cache clean-up
Expand Down
4 changes: 2 additions & 2 deletions src/nyx/features/basic_morphology.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/nyx/features/chords.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ class Chords_feature
Chords_feature (const std::vector<Pixel2> & 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<double, double, double, double, double, double, double, double> 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<double, double, double, double, double, double, double, double> get_allchords_stats();

/// @brief Calculates "maxchords" and "allchords" features for a range of ROI labels
Expand Down
12 changes: 6 additions & 6 deletions src/nyx/features/contour.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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();
Expand All @@ -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);
}
}
Expand Down Expand Up @@ -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]);
Expand Down Expand Up @@ -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;
}
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/nyx/features/ellipse_fitting.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
Loading

0 comments on commit bbc8852

Please sign in to comment.