Skip to content

Commit 28a5dde

Browse files
committed
use double-quotes for strings in code blocks
1 parent 35f5456 commit 28a5dde

File tree

6 files changed

+32
-32
lines changed

6 files changed

+32
-32
lines changed

episodes/03-skimage-images.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,14 @@ In this case, the `.tif` extension causes the image to be saved as a TIFF.
185185
> So, we could load in the chair image in the sample code above
186186
> using positional parameters like this:
187187
>
188-
> `image = skimage.io.imread('data/chair.jpg')`
188+
> `image = skimage.io.imread("data/chair.jpg")`
189189
>
190190
> Since the function expects the first argument to be the file name,
191-
> there is no confusion about what `'data/chair.jpg'` means.
191+
> there is no confusion about what `"data/chair.jpg"` means.
192192
>
193193
> The style we will use in this workshop is to name each parameters, like this:
194194
>
195-
> `image = skimage.io.imsave(fname='data/chair.jpg')`
195+
> `image = skimage.io.imsave(fname="data/chair.jpg")`
196196
>
197197
> This style will make it easier for you to learn how to use the variety of
198198
> functions we will cover in this workshop.
@@ -253,7 +253,7 @@ In this case, the `.tif` extension causes the image to be saved as a TIFF.
253253
> > import skimage.transform
254254
> >
255255
> > # read in image
256-
> > image = skimage.io.imread('data/chair.jpg')
256+
> > image = skimage.io.imread("data/chair.jpg")
257257
> >
258258
> > # resize the image
259259
> > new_shape = (image.shape[0] // 10, image.shape[1] // 10, image.shape[2])
@@ -310,7 +310,7 @@ We will start by reading the image and displaying it.
310310
import skimage.io
311311

312312
# read input image
313-
image = skimage.io.imread('data/maize-root-cluster.jpg')
313+
image = skimage.io.imread("data/maize-root-cluster.jpg")
314314

315315
# display original image
316316
fig, ax = plt.subplots()
@@ -362,7 +362,7 @@ import skimage.io
362362
import skimage.color
363363

364364
# read input image
365-
image = skimage.io.imread('data/chair.jpg')
365+
image = skimage.io.imread("data/chair.jpg")
366366

367367
# display original image
368368
fig, ax = plt.subplots()
@@ -371,7 +371,7 @@ plt.imshow(image)
371371
# convert to grayscale and display
372372
gray_image = skimage.color.rgb2gray(image)
373373
fig, ax = plt.subplots()
374-
plt.imshow(gray_image, cmap='gray')
374+
plt.imshow(gray_image, cmap="gray")
375375
~~~
376376
{: .language-python}
377377
@@ -386,11 +386,11 @@ import skimage.io
386386
import skimage.color
387387

388388
# read input image, based on filename parameter
389-
image = skimage.io.imread('data/chair.jpg', as_gray=True)
389+
image = skimage.io.imread("data/chair.jpg", as_gray=True)
390390

391391
# display grayscale image
392392
fig, ax = plt.subplots()
393-
plt.imshow(image, cmap='gray')
393+
plt.imshow(image, cmap="gray")
394394
~~~
395395
{: .language-python}
396396
@@ -421,7 +421,7 @@ plt.imshow(image, cmap='gray')
421421
> > ~~~
422422
> > import skimage.io
423423
> >
424-
> > image = skimage.io.imread(fname='data/sudoku.png', as_gray=True)
424+
> > image = skimage.io.imread(fname="data/sudoku.png", as_gray=True)
425425
> > ~~~
426426
> > {: .language-python }
427427
> >
@@ -436,7 +436,7 @@ plt.imshow(image, cmap='gray')
436436
> >
437437
> > ~~~
438438
> > fig, ax = plt.subplots()
439-
> > plt.imshow(image, cmap='gray')
439+
> > plt.imshow(image, cmap="gray")
440440
> > ~~~
441441
> > {: .language-python}
442442
> {: .solution}
@@ -540,7 +540,7 @@ as shown in the final image produced by the program:
540540
>
541541
> Using the techniques you just learned, write a script that
542542
> creates, displays, and saves a sub-image containing
543-
> only the plant and its roots from 'data/maize-root-cluster.jpg'
543+
> only the plant and its roots from "data/maize-root-cluster.jpg"
544544
>
545545
> > ## Solution
546546
> >

episodes/04-drawing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ mask[rr, cc] = False
117117
118118
# Display mask image
119119
fig, ax = plt.subplots()
120-
plt.imshow(mask, cmap='gray')
120+
plt.imshow(mask, cmap="gray")
121121
plt.show()
122122
~~~
123123
{: .language-python}

episodes/05-creating-histograms.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ import matplotlib.pyplot as plt
5252
%matplotlib widget
5353
5454
# read the image of a plant seedling as grayscale from the outset
55-
image = skimage.io.imread(fname='data/plant-seedling.jpg', as_gray=True)
55+
image = skimage.io.imread(fname="data/plant-seedling.jpg", as_gray=True)
5656
5757
# display the image
5858
fig, ax = plt.subplots()
59-
plt.imshow(image, cmap='gray')
59+
plt.imshow(image, cmap="gray")
6060
plt.show()
6161
~~~
6262
{: .language-python}
@@ -197,11 +197,11 @@ it produces this histogram:
197197
> > import skimage.draw
198198
> >
199199
> > # read the image as grayscale from the outset
200-
> > image = skimage.io.imread('data/plant-seedling.jpg', as_gray=True)
200+
> > image = skimage.io.imread("data/plant-seedling.jpg", as_gray=True)
201201
> >
202202
> > # display the image
203203
> > fig, ax = plt.subplots()
204-
> > plt.imshow(image, cmap='gray')
204+
> > plt.imshow(image, cmap="gray")
205205
> > plt.show()
206206
> >
207207
> > # create mask here, using np.zeros() and skimage.draw.rectangle()
@@ -211,7 +211,7 @@ it produces this histogram:
211211
> >
212212
> > # display the mask
213213
> > fig, ax = plt.subplots()
214-
> > plt.imshow(mask, cmap='gray')
214+
> > plt.imshow(mask, cmap="gray")
215215
> > plt.show()
216216
> >
217217
> > # mask the image and create the new histogram
@@ -247,7 +247,7 @@ A program to create color histograms starts in a familiar way:
247247
248248
~~~
249249
# read original image, in full color
250-
image = skimage.io.imread('data/plant-seedling.jpg')
250+
image = skimage.io.imread("data/plant-seedling.jpg")
251251

252252
# display the image
253253
fig, ax = plt.subplots()
@@ -376,7 +376,7 @@ Finally we label our axes and display the histogram, shown here:
376376
>
377377
> ~~~
378378
> # read the image
379-
> image = skimage.io.imread('data/wellplate-02.tif')
379+
> image = skimage.io.imread("data/wellplate-02.tif")
380380
>
381381
> # display the image
382382
> fig, ax = plt.subplots()

episodes/07-thresholding.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ gray_image = skimage.color.rgb2gray(image)
9494
blurred_image = skimage.filters.gaussian(gray_image, sigma=1.0)
9595
9696
fig, ax = plt.subplots()
97-
plt.imshow(blurred_image, cmap='gray')
97+
plt.imshow(blurred_image, cmap="gray")
9898
plt.show()
9999
~~~
100100
{: .language-python}
@@ -159,7 +159,7 @@ t = 0.8
159159
binary_mask = blurred_image < t
160160
161161
fig, ax = plt.subplots()
162-
plt.imshow(binary_mask, cmap='gray')
162+
plt.imshow(binary_mask, cmap="gray")
163163
plt.show()
164164
~~~
165165
{: .language-python}
@@ -265,7 +265,7 @@ plt.show()
265265
> > binary_mask = gray_image > t
266266
> >
267267
> > fig, ax = plt.subplots()
268-
> > plt.imshow(binary_mask, cmap='gray')
268+
> > plt.imshow(binary_mask, cmap="gray")
269269
> > plt.show()
270270
> > ~~~
271271
> > {: .language-python}
@@ -382,7 +382,7 @@ those below the threshold will be turned off.
382382
binary_mask = blurred_image > t
383383

384384
fig, ax = plt.subplots()
385-
plt.imshow(binary_mask, cmap='gray')
385+
plt.imshow(binary_mask, cmap="gray")
386386
plt.show()
387387
~~~
388388
{: .language-python}
@@ -720,7 +720,7 @@ data/trial-293.jpg,0.13607895611702128
720720
> > binary_mask = blurred_image < t
721721
> >
722722
> > fig, ax = plt.subplots()
723-
> > plt.imshow(binary_mask, cmap='gray')
723+
> > plt.imshow(binary_mask, cmap="gray")
724724
> > plt.show()
725725
> > ~~~
726726
> > {: .language-python}

episodes/08-connected-components.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ labeled_image, count = connected_components("data/shapes-01.jpg", sigma=2.0, t=0
296296

297297
fig, ax = plt.subplots()
298298
plt.imshow(labeled_image)
299-
plt.axis('off')
299+
plt.axis("off")
300300
plt.show()
301301
~~~
302302
{: .language-python}
@@ -356,7 +356,7 @@ colored_label_image = skimage.color.label2rgb(labeled_image, bg_label=0)
356356

357357
fig, ax = plt.subplots()
358358
plt.imshow(colored_label_image)
359-
plt.axis('off')
359+
plt.axis("off")
360360
plt.show()
361361
~~~
362362
{: .language-python}
@@ -689,7 +689,7 @@ This will produce the output
689689
> >
690690
> > fig, ax = plt.subplots()
691691
> > plt.imshow(colored_label_image)
692-
> > plt.axis('off')
692+
> > plt.axis("off")
693693
> > plt.show()
694694
> >
695695
> > print("Found", count, "objects in the image.")
@@ -734,8 +734,8 @@ This will produce the output
734734
> > fig, ax = plt.subplots()
735735
> > im = plt.imshow(colored_area_image)
736736
> > cbar = fig.colorbar(im, ax=ax, shrink=0.85)
737-
> > cbar.ax.set_title('Area')
738-
> > plt.axis('off')
737+
> > cbar.ax.set_title("Area")
738+
> > plt.axis("off")
739739
> > plt.show()
740740
> > ~~~
741741
> > {: .language-python}

episodes/09-challenges.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ and `data/colonies-03.tif`.
8383
> >
8484
> > # display the gray image
8585
> > fig, ax = plt.subplots()
86-
> > plt.imshow(gray_bacteria, cmap='gray')
86+
> > plt.imshow(gray_bacteria, cmap="gray")
8787
> > plt.show()
8888
> > ~~~
8989
> > {: .language-python}
@@ -116,7 +116,7 @@ and `data/colonies-03.tif`.
116116
> > ~~~
117117
> > mask = blurred_image < 0.2
118118
> > fig, ax = plt.subplots()
119-
> > plt.imshow(mask, cmap='gray')
119+
> > plt.imshow(mask, cmap="gray")
120120
> > plt.show()
121121
> > ~~~
122122
> > {: .language-python}

0 commit comments

Comments
 (0)