Skip to content

Commit 95fd11c

Browse files
committed
differences for PR #338
1 parent 6bc24fe commit 95fd11c

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

07-thresholding.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -478,9 +478,7 @@ def measure_root_mass(filename, sigma=1.0):
478478

479479
# determine root mass ratio
480480
root_pixels = np.count_nonzero(binary_mask)
481-
w = binary_mask.shape[1]
482-
h = binary_mask.shape[0]
483-
density = root_pixels / (w * h)
481+
density = root_pixels / binary_mask.size
484482

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

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

651646
# determine root mass ratio
652647
root_pixels = np.count_nonzero(binary_mask)
653-
w = binary_mask.shape[1]
654-
h = binary_mask.shape[0]
655-
density = root_pixels / (w * h)
648+
density = root_pixels / binary_mask.size
656649

657650
return density
658651

LICENSE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ SOFTWARE.
6969
## Trademark
7070

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

7575
[cc-by-human]: https://creativecommons.org/licenses/by/4.0/
7676
[cc-by-legal]: https://creativecommons.org/licenses/by/4.0/legalcode
7777
[mit-license]: https://opensource.org/licenses/mit-license.html
78-
[carpentries]: https://carpentries.org
78+
[ci]: https://communityin.org/
7979
[osi]: https://opensource.org

md5sum.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"file" "checksum" "built" "date"
22
"CODE_OF_CONDUCT.md" "c93c83c630db2fe2462240bf72552548" "site/built/CODE_OF_CONDUCT.md" "2023-04-25"
3-
"LICENSE.md" "e94126b93e27bae014999c2e84ee93f8" "site/built/LICENSE.md" "2025-02-04"
3+
"LICENSE.md" "b24ebbb41b14ca25cf6b8216dda83e5f" "site/built/LICENSE.md" "2025-02-05"
44
"config.yaml" "101b3ac4b679126bb1f437306eb1b836" "site/built/config.yaml" "2023-04-25"
55
"index.md" "6e80c662708984307918adfad711e15f" "site/built/index.md" "2023-07-26"
66
"episodes/01-introduction.md" "4fe9db38f75f93b3ffbdb3115d36b802" "site/built/01-introduction.md" "2024-11-28"
@@ -9,7 +9,7 @@
99
"episodes/04-drawing.md" "48b42ee384b5b907d9f9b93ad0e98ce8" "site/built/04-drawing.md" "2024-06-07"
1010
"episodes/05-creating-histograms.md" "4abbd123ba97d63c795398be6f6b7621" "site/built/05-creating-histograms.md" "2024-03-14"
1111
"episodes/06-blurring.md" "894ff33379584a8ee777f779564d5b01" "site/built/06-blurring.md" "2024-06-18"
12-
"episodes/07-thresholding.md" "4d34b89c8cd33cb6bb54103f805a39b9" "site/built/07-thresholding.md" "2024-03-12"
12+
"episodes/07-thresholding.md" "512a1806b8061dded3a68871e7bcdfe9" "site/built/07-thresholding.md" "2025-02-05"
1313
"episodes/08-connected-components.md" "f599af69b770c7234a4e7d4a06a7f6dd" "site/built/08-connected-components.md" "2024-11-13"
1414
"episodes/09-challenges.md" "3e95485b1bae2c37538830225ea26598" "site/built/09-challenges.md" "2024-03-12"
1515
"instructors/instructor-notes.md" "e8e378a5dfaec7b2873d788be85003ce" "site/built/instructor-notes.md" "2024-06-18"

0 commit comments

Comments
 (0)