Skip to content

Commit 35f5456

Browse files
committed
improved links
1 parent 9858778 commit 35f5456

11 files changed

+58
-57
lines changed

_extras/edge-detection.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ while ignoring parts of the image that will not help us.
3131
For example, once we have found the edges of the objects in the image
3232
(or once we have converted the image to binary using thresholding),
3333
we can use that information to find the image *contours*,
34-
which we will learn about in the following
35-
[connected components]({{ page.root }}/09-connected-components) episode.
34+
which we will learn about in
35+
[the _Connected Component Analysis_ episode]({{ page.root }}{% link _episodes/08-connected-components.md %}).
3636
With the contours,
3737
we can do things like counting the number of objects in the image,
3838
measure the size of the objects, classify the shapes of the objects, and so on.
@@ -83,7 +83,7 @@ The skimage `skimage.feature.canny()` function performs the following steps:
8383

8484
1. A Gaussian blur
8585
(that is characterized by the `sigma` parameter,
86-
see [introduction]({{ page.root }}/06-blurring/))
86+
see [_Blurring Images_]({{ page.root }}{% link _episodes/06-blurring.md %}))
8787
is applied to remove noise from the image.
8888
(So if we are doing edge detection via this function,
8989
we should not perform our own blurring step.)
@@ -122,7 +122,8 @@ based on the contents of the image(s) to be processed.
122122
The following program illustrates how the `skimage.feature.canny()` method
123123
can be used to detect the edges in an image.
124124
We will execute the program on the `data/junk-01.jpg` image,
125-
which we used before in the [Thresholding]({{ page.root }}/07-thresholding/) episode:
125+
which we used before in
126+
[the _Thresholding_ episode]({{ page.root }}{% link _episodes/07-thresholding.md %}):
126127

127128
![Colored shapes](../data/shapes-01.jpg)
128129

@@ -457,14 +458,14 @@ The image shows the edges in an output file.
457458
458459
Keep this plugin technique in your image processing "toolbox."
459460
You can use sliders (or other interactive elements,
460-
see the [skimage documentation](https://scikit-image.org/docs/dev/api/skimage.viewer.widgets.html))
461+
see [the skimage documentation](https://scikit-image.org/docs/dev/api/skimage.viewer.widgets.html))
461462
to vary other kinds of parameters, such as sigma for blurring,
462463
binary thresholding values, and so on.
463464
A few minutes developing a program to tweak parameters like this can
464465
save you the hassle of repeatedly running a program from the command line
465466
with different parameter values.
466467
Furthermore, skimage already comes with a few viewer plugins that you can
467-
check out in the [documentation](https://scikit-image.org/docs/dev/api/skimage.viewer.plugins.html).
468+
check out in [the documentation](https://scikit-image.org/docs/dev/api/skimage.viewer.plugins.html).
468469
469470
## Other edge detection functions
470471

episodes/01-introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ objects in an image."
1919
---
2020

2121
We can use relatively simple image processing and computer vision techniques in
22-
Python, using the [skimage](https://scikit-image.org/) library.
22+
Python, using [the skimage library](https://scikit-image.org/).
2323
With careful experimental design, a digital camera or a flatbed scanner,
2424
in conjunction with some Python code,
2525
can be a powerful instrument in answering many different kinds of problems.
@@ -75,7 +75,7 @@ resulting in an image like this:
7575
As we move through this workshop,
7676
we will learn image analysis methods useful for many different scientific problems.
7777
These will be linked together and applied to a real problem in
78-
the final end-of-workshop [capstone challenge]({{page.root}}/09-challenges/).
78+
the final end-of-workshop [capstone challenge]({{page.root}}{% link _episodes/09-challenges.md %}).
7979

8080
Let's get started,
8181
by learning some basics about how images are represented and stored digitally.

episodes/02-image-basics.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,9 @@ A lot of science went into making this the default due to its robustness
348348
when it comes to how the human mind interprets relative color values,
349349
grey-scale printability,
350350
and color-blind friendliness
351-
([https://matplotlib.org/stable/tutorials/colors/colormaps.html](https://matplotlib.org/stable/tutorials/colors/colormaps.html),
352-
[https://bids.github.io/colormap/](https://bids.github.io/colormap/)).
351+
(You can read more about this default color map in
352+
[a Matplotlib tutorial](https://matplotlib.org/stable/tutorials/colors/colormaps.html)
353+
and [an explanatory article by the authors](https://bids.github.io/colormap/)).
353354
Thus it is a good place to start,
354355
and you should change it only with purpose and forethought.
355356
For now, let's see how you can do that using an alternative map

episodes/03-skimage-images.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Image representation in skimage"
2+
title: "Image Representation in skimage"
33
teaching: 70
44
exercises: 50
55
questions:
@@ -33,7 +33,7 @@ let us review and expand on the concepts we just learned.
3333

3434
## Images are represented as NumPy arrays
3535

36-
In the [Image Basics]({{page.root}}/02-image-basics) episode,
36+
In [the Image Basics episode]({{page.root}}{% link _episodes/02-image-basics.md %}),
3737
we learned that images are represented as
3838
rectangular arrays of individually-colored square pixels,
3939
and that the color of each pixel can be represented as an RGB triplet of numbers.
@@ -87,8 +87,8 @@ blue in layer 2.
8787
Skimage provides easy-to-use functions for reading, displaying, and saving images.
8888
All of the popular image formats, such as BMP, PNG, JPEG, and TIFF are supported,
8989
along with several more esoteric formats.
90-
See the [skimage documentation](http://scikit-image.org/docs/stable/)
91-
for more information.
90+
[The skimage documentation](http://scikit-image.org/docs/stable/)
91+
has more information about supported file formats.
9292

9393
Let us examine a simple Python program to load, display,
9494
and save an image to a different format.
@@ -279,7 +279,7 @@ In this case, the `.tif` extension causes the image to be saved as a TIFF.
279279
280280
## Manipulating pixels
281281
282-
In the [Image Basics]({{page.root}}/02-image-basics) episode,
282+
In [the _Image Basics_ episode]({{page.root}}{% link _episodes/02-image-basics.md %}),
283283
we individually manipulated the colors of pixels by changing the numbers stored
284284
in the image's NumPy array. Let's apply the principles learned there
285285
along with some new principles to a real world example.
@@ -295,7 +295,7 @@ we can simply look through the array for pixel color values that are
295295
less than some threshold value.
296296
This process is called *thresholding*,
297297
and we will see more powerful methods to perform the thresholding task in
298-
the [Thresholding]({{ page.root }}/07-thresholding/) episode.
298+
[the _Thresholding_ episode]({{ page.root }}{% link _episodes/07-thresholding.md %}).
299299
Here, though, we will look at a simple and elegant NumPy method for thresholding.
300300
Let us develop a program that keeps only the pixel color values in an image
301301
that have value greater than or equal to 128.

episodes/04-drawing.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ based on changes in color or shape.
2929
Often we wish to select only a portion of an image to analyze,
3030
and ignore the rest.
3131
Creating a rectangular sub-image with slicing,
32-
as we did in the [skimage Images]({{ page.root }}/03-skimage-images) lesson
32+
as we did in [the _Image Representation in skimage_ episode]({{ page.root }}{% link _episodes/03-skimage-images.md %})
3333
is one option for simple cases.
3434
Another option is to create another special image,
3535
of the same size as the original,
@@ -133,9 +133,9 @@ The function returns the rectangle as row (`rr`) and column (`cc`) coordinate ar
133133
> ## Check the documentation!
134134
>
135135
> When using an skimage function for the first time - or the fifth time -
136-
> it is wise to check how the function is used, via the online
137-
> [skimage documentation](https://scikit-image.org/docs/dev/user_guide)
138-
> or via other usage examples on programming-related sites such as
136+
> it is wise to check how the function is used, via
137+
> [the skimage documentation](https://scikit-image.org/docs/dev/user_guide)
138+
> or other usage examples on programming-related sites such as
139139
> [Stack Overflow](https://stackoverflow.com/).
140140
> Basic information about skimage functions can be found interactively in Python,
141141
> via commands like `help(skimage)` or `help(skimage.draw.rectangle)`.
@@ -180,8 +180,8 @@ The function returns the rectangle as row (`rr`) and column (`cc`) coordinate ar
180180
> the (y, x) coordinate of one end of the line,
181181
> and the (y, x) coordinate of the other end of the line.
182182
>
183-
> Other drawing functions supported by skimage can be found in the
184-
> [skimage reference pages](https://scikit-image.org/docs/dev/api/skimage.draw.html?highlight=draw#module-skimage.draw).
183+
> Other drawing functions supported by skimage can be found in
184+
> [the skimage reference pages](https://scikit-image.org/docs/dev/api/skimage.draw.html?highlight=draw#module-skimage.draw).
185185
>
186186
> First let's make an empty, black image with a size of 800x600 pixels:
187187
>

episodes/05-creating-histograms.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ display histograms for images.
2626

2727
As it pertains to images, a *histogram* is a graphical representation showing
2828
how frequently various color values occur in the image.
29-
We saw in the [Image Basics]({{ page.root }}/02-image-basics) episode
29+
We saw in
30+
[the _Image Basics_ episode]({{ page.root }}{% link _episodes/02-image-basics.md %})
3031
that we could use a histogram to visualize
3132
the differences in uncompressed and compressed image formats.
3233
If your project involves detecting color changes between images,
3334
histograms will prove to be very useful,
3435
and histograms are also quite handy as a preparatory step before performing
35-
[Thresholding]({{ page.root }}/07-thresholding).
36+
[thresholding]({{ page.root }}/07-thresholding).
3637

3738
## Grayscale Histograms
3839

@@ -184,9 +185,9 @@ it produces this histogram:
184185
>
185186
> First, hover over the plant seedling image with your mouse to determine the
186187
> *(x, y)* coordinates of a bounding box around the leaf of the seedling.
187-
> Then, using techniques from the
188-
> [Drawing and Bitwise Operations]({{ page.root }}/04-drawing/)
189-
> episode, create a mask with a white rectangle covering that bounding box.
188+
> Then, using techniques from
189+
> [the _Drawing and Bitwise Operations_ episode]({{ page.root }}{% link _episodes/04-drawing.md %}),
190+
> create a mask with a white rectangle covering that bounding box.
190191
>
191192
> After you have created the mask, apply it to the input image before passing
192193
> it to the `np.histogram` function.
@@ -241,7 +242,7 @@ it produces this histogram:
241242
We can also create histograms for full color images,
242243
in addition to grayscale histograms.
243244
We have seen color histograms before,
244-
in the [Image Basics]({{ page.root }}/02-image-basics) episode.
245+
in [the _Image Basics_ episode]({{ page.root }}{% link _episodes/02-image-basics.md %}).
245246
A program to create color histograms starts in a familiar way:
246247
247248
~~~

episodes/06-blurring.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Blurring images"
2+
title: "Blurring Images"
33
teaching: 35
44
exercises: 25
55
questions:
@@ -11,8 +11,7 @@ keypoints:
1111
- "Applying a low-pass blurring filter smooths edges and removes noise from
1212
an image."
1313
- "Blurring is often used as a first step before we perform
14-
[Thresholding]({{ page.root }}/07-thresholding) or
15-
[Edge Detection]({{ page.root }}/../_extras/edge_detection.md)."
14+
thresholding or edge detection."
1615
- "The Gaussian blur can be applied to an image with the
1716
`skimage.filters.gaussian()` function."
1817
- "Larger sigma values may remove more noise, but they will also remove detail
@@ -36,7 +35,7 @@ we make the color transition from one side of an edge in the image to another
3635
smooth rather than sudden.
3736
The effect is to average out rapid changes in pixel intensity.
3837
A blur is a very common operation we need to perform before other tasks such as
39-
[thresholding]({{ page.root }}/07-thresholding).
38+
[thresholding]({{ page.root }}{% link _episodes/07-thresholding.md %}).
4039
There are several different blurring functions in the `skimage.filters` module,
4140
so we will focus on just one here, the *Gaussian blur*.
4241

@@ -216,7 +215,7 @@ next pixel in the image.
216215
>
217216
> A similar process would be used to fill in all of the other missing pixels from
218217
> the kernel. Other *border modes* are available; you can learn more about them
219-
> in the [skimage documentation](https://scikit-image.org/docs/dev/user_guide).
218+
> in [the skimage documentation](https://scikit-image.org/docs/dev/user_guide).
220219
>
221220
{: .callout}
222221
@@ -333,5 +332,5 @@ The Gaussian blur is a way to apply a low-pass filter in skimage.
333332
It is often used to remove Gaussian (i. e., random) noise from the image.
334333
For other kinds of noise, e.g. "salt and pepper" or "static" noise, a
335334
median filter is typically used.
336-
See the [`skimage.filters` documentation](https://scikit-image.org/docs/dev/api/skimage.filters.html#module-skimage.filters)
335+
See [the `skimage.filters` documentation](https://scikit-image.org/docs/dev/api/skimage.filters.html#module-skimage.filters)
337336
for a list of available filters.

episodes/07-thresholding.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ arrays, since they have only one color value channel. They are boolean, hence th
2525
the values 0 (off) and 1 (on)."
2626
- "Thresholding can be used to create masks that select only the interesting
2727
parts of an image, or as the first step before
28-
[Edge Detection]({{ page.root }}/08-edge-detection/) or finding
29-
[Contours]({{ page.root }}/09-contours/)."
28+
edge detection or finding contours."
3029
---
3130

3231
In this episode, we will learn how to use skimage functions to apply
@@ -40,7 +39,7 @@ we use thresholding as a way to select areas of interest of an image,
4039
while ignoring the parts we are not concerned with.
4140
We have already done some simple thresholding,
4241
in the "Manipulating pixels" section of
43-
the [Skimage Images]({{ page.root }}/03-skimage-images/) episode.
42+
[the _Image Representation in skimage_ episode]({{ page.root }}{% link _episodes/03-skimage-images.md %}).
4443
In that case, we used a simple NumPy array manipulation to
4544
separate the pixels belonging to the root system of a plant from the black background.
4645
In this episode, we will learn how to use skimage functions to perform thresholding.
@@ -85,7 +84,7 @@ we have to provide a threshold value `t`.
8584

8685
The process works like this.
8786
First, we will load the original image, convert it to grayscale,
88-
and de-noise it as in the [Blurring]({{ page.root }}/06-blurring/) episode.
87+
and de-noise it as in [the _Blurring Images_ episode]({{ page.root }}{% link _episodes/06-blurring.md %}).
8988

9089
~~~
9190
# convert the image to grayscale
@@ -117,7 +116,7 @@ and try to identify what grayscale ranges correspond to the shapes in the image
117116
or the background.
118117

119118
The histogram for the shapes image shown above can be produced as in
120-
the [Creating Histograms]({{ page.root }}/05-creating-histograms/) episode.
119+
[the _Creating Histograms_ episode]({{ page.root }}{% link _episodes/05-creating-histograms.md %}).
121120

122121
~~~
123122
# create a histogram of the blurred grayscale image
@@ -191,12 +190,12 @@ while the rest of the mask image is black.
191190
> It is worth noting that the principle for simple and automatic thresholding
192191
> can also be used for images with pixel ranges other than [0.0, 1.0].
193192
> For example, we could perform thresholding on pixel intensity values
194-
> in the range [0, 255] as we have already seen in the
195-
> [Image representation in skimage]({{ page.root}}/03-skimage-images/) epsiode.
193+
> in the range [0, 255] as we have already seen in
194+
> [the _Image Representation in skimage_ episode]({{ page.root}}{% link _episodes/03-skimage-images.md %}).
196195
{: .callout}
197196

198197
We can now apply the `binary_mask` to the original colored image as we
199-
have learned in the [Drawing and Bitwise Operations]({{page.root}}/04-drawing/) episode.
198+
have learned in [the _Drawing and Bitwise Operations_ episode]({{page.root}}{% link _episodes/04-drawing.md %}).
200199
What we are left with is only the colored shapes from the original.
201200

202201
~~~
@@ -303,13 +302,13 @@ has two peaks that correspond to background and objects of interest.
303302
> ## Denoising an image before thresholding
304303
>
305304
> In practice, it is often necessary to denoise the image before
306-
> thresholding, which can be done with one of the methods from the
307-
> [Blurring]({{ page.root }}/06-blurring/) episode.
305+
> thresholding, which can be done with one of the methods from
306+
> [the _Blurring Images_ episode]({{ page.root }}{% link _episodes/06-blurring.md %}).
308307
{: .callout}
309308
310309
Consider the image `data/maize-root-cluster.jpg` of a maize root system which
311310
we have seen before in
312-
the [Skimage Images]({{ page.root }}/03-skimage-images/) episode.
311+
[the _Image Representation in skimage_ episode]({{ page.root }}{% link _episodes/03-skimage-images.md %}).
313312
314313
~~~
315314
image = skimage.io.imread("data/maize-root-cluster.jpg")
@@ -566,7 +565,7 @@ data/trial-293.jpg,0.13607895611702128
566565
> > If we had coordinates for a rectangular area on the image
567566
> > that contained the circle and the label,
568567
> > we could mask the area out easily by using techniques we learned in
569-
> > the [Drawing and Bitwise Operations]({{ page.root }}/04-drawing/) episode.
568+
> > [the _Drawing and Bitwise Operations_ episode]({{ page.root }}{% link _episodes/04-drawing.md %}).
570569
> >
571570
> > However, a closer inspection of the binary images raises some issues with
572571
> > that approach.

episodes/08-connected-components.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ keypoints:
1919

2020
## Objects
2121

22-
In the [thresholding episode]({{ page.root }}/07-thresholding) we have
23-
covered dividing an image into foreground and background pixels.
22+
In [the _Thresholding_ episode]({{ page.root }}{% link _episodes/07-thresholding.md %})
23+
we have covered dividing an image into foreground and background pixels.
2424
In the shapes example image,
2525
we considered the colored shapes as foreground _objects_ on a white background.
2626

@@ -236,7 +236,7 @@ def connected_components(filename, sigma=1.0, t=0.5, connectivity=2):
236236
Note the new import of `skimage.measure` in order to use the
237237
`skimage.measure.label` function that performs the CCA.
238238
The first four lines of code are familiar from
239-
the [Thresholding]({{ page.root }}/07-thresholding) episode.
239+
[the _Thresholding_ episode]({{ page.root }}{% link _episodes/07-thresholding.md %}).
240240
241241
<!-- Note: shapes image: with sigma=2.0, threshold=0.9 -> 11 objects; with sigma=5 -> 8 objects -->
242242
@@ -453,7 +453,7 @@ So we could use a minimum area as a criterion for when an object should be detec
453453
To apply such a criterion,
454454
we need a way to calculate the area of objects found by connected components.
455455
Recall how we determined the root mass in
456-
the [Thresholding]({{ page.root }}/07-thresholding)
456+
[the _Thresholding_ episode]({{ page.root }}{% link _episodes/07-thresholding.md %})
457457
by counting the pixels in the binary mask.
458458
But here we want to calculate the area of several objects in the labeled image.
459459
The skimage library provides the function `skimage.measure.regionprops`
@@ -483,7 +483,7 @@ This will produce the output
483483
> ## Plot a histogram of the object area distribution (10 min)
484484
>
485485
> Similar to how we determined a "good" threshold in
486-
> the [Thresholding]({{ page.root }}/07-thresholding) episode,
486+
> [the _Thresholding_ episode]({{ page.root }}{% link _episodes/07-thresholding.md %}),
487487
> it is often helpful to inspect the histogram of an object property.
488488
> For example, we want to look at the distribution of the object areas.
489489
>

0 commit comments

Comments
 (0)