Skip to content

Commit

Permalink
differences for PR #338
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Feb 5, 2025
1 parent 6bc24fe commit 95fd11c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
13 changes: 3 additions & 10 deletions 07-thresholding.md
Original file line number Diff line number Diff line change
Expand Up @@ -478,9 +478,7 @@ def measure_root_mass(filename, sigma=1.0):

# determine root mass ratio
root_pixels = np.count_nonzero(binary_mask)
w = binary_mask.shape[1]
h = binary_mask.shape[0]
density = root_pixels / (w * h)
density = root_pixels / binary_mask.size

return density
```
Expand All @@ -499,11 +497,8 @@ Recall that in the `binary_mask`, every pixel has either a value of
zero (black/background) or one (white/foreground).
We want to count the number of white pixels,
which can be accomplished with a call to the NumPy function `np.count_nonzero`.
Then we determine the width and height of the image by using
the elements of `binary_mask.shape`
(that is, the dimensions of the NumPy array that stores the image).
Finally, the density ratio is calculated by dividing the number of white pixels
by the total number of pixels `w*h` in the image.
by the total number of pixels `binary_mask.size` in the image.
The function returns then root density of the image.

We can call this function with any filename and
Expand Down Expand Up @@ -650,9 +645,7 @@ def enhanced_root_mass(filename, sigma):

# determine root mass ratio
root_pixels = np.count_nonzero(binary_mask)
w = binary_mask.shape[1]
h = binary_mask.shape[0]
density = root_pixels / (w * h)
density = root_pixels / binary_mask.size

return density

Expand Down
6 changes: 3 additions & 3 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ SOFTWARE.
## Trademark

"The Carpentries", "Software Carpentry", "Data Carpentry", and "Library
Carpentry" and their respective logos are registered trademarks of
[The Carpentries, Inc.][carpentries].
Carpentry" and their respective logos are registered trademarks of [Community
Initiatives][ci].

[cc-by-human]: https://creativecommons.org/licenses/by/4.0/
[cc-by-legal]: https://creativecommons.org/licenses/by/4.0/legalcode
[mit-license]: https://opensource.org/licenses/mit-license.html
[carpentries]: https://carpentries.org
[ci]: https://communityin.org/
[osi]: https://opensource.org
4 changes: 2 additions & 2 deletions md5sum.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"file" "checksum" "built" "date"
"CODE_OF_CONDUCT.md" "c93c83c630db2fe2462240bf72552548" "site/built/CODE_OF_CONDUCT.md" "2023-04-25"
"LICENSE.md" "e94126b93e27bae014999c2e84ee93f8" "site/built/LICENSE.md" "2025-02-04"
"LICENSE.md" "b24ebbb41b14ca25cf6b8216dda83e5f" "site/built/LICENSE.md" "2025-02-05"
"config.yaml" "101b3ac4b679126bb1f437306eb1b836" "site/built/config.yaml" "2023-04-25"
"index.md" "6e80c662708984307918adfad711e15f" "site/built/index.md" "2023-07-26"
"episodes/01-introduction.md" "4fe9db38f75f93b3ffbdb3115d36b802" "site/built/01-introduction.md" "2024-11-28"
Expand All @@ -9,7 +9,7 @@
"episodes/04-drawing.md" "48b42ee384b5b907d9f9b93ad0e98ce8" "site/built/04-drawing.md" "2024-06-07"
"episodes/05-creating-histograms.md" "4abbd123ba97d63c795398be6f6b7621" "site/built/05-creating-histograms.md" "2024-03-14"
"episodes/06-blurring.md" "894ff33379584a8ee777f779564d5b01" "site/built/06-blurring.md" "2024-06-18"
"episodes/07-thresholding.md" "4d34b89c8cd33cb6bb54103f805a39b9" "site/built/07-thresholding.md" "2024-03-12"
"episodes/07-thresholding.md" "512a1806b8061dded3a68871e7bcdfe9" "site/built/07-thresholding.md" "2025-02-05"
"episodes/08-connected-components.md" "f599af69b770c7234a4e7d4a06a7f6dd" "site/built/08-connected-components.md" "2024-11-13"
"episodes/09-challenges.md" "3e95485b1bae2c37538830225ea26598" "site/built/09-challenges.md" "2024-03-12"
"instructors/instructor-notes.md" "e8e378a5dfaec7b2873d788be85003ce" "site/built/instructor-notes.md" "2024-06-18"
Expand Down

0 comments on commit 95fd11c

Please sign in to comment.