@@ -127,7 +127,7 @@ Here is what our constructed mask looks like:
127
127
128
128
The parameters of the ` rectangle() ` function ` (357, 44) ` and ` (740, 720) ` ,
129
129
are the coordinates of the upper-left (` start ` ) and lower-right (` end ` ) corners
130
- of a rectangle in * (y, x )* order.
130
+ of a rectangle in * (ry, cx )* order.
131
131
The function returns the rectangle as row (` rr ` ) and column (` cc ` ) coordinate arrays.
132
132
133
133
> ## Check the documentation!
@@ -169,16 +169,16 @@ The function returns the rectangle as row (`rr`) and column (`cc`) coordinate ar
169
169
>
170
170
> Circles can be drawn with the ` skimage.draw.disk() ` function,
171
171
> which takes two parameters:
172
- > the (y, x ) point of the centre of the circle,
172
+ > the (ry, cx ) point of the centre of the circle,
173
173
> and the radius of the circle.
174
174
> There is an optional ` shape ` parameter that can be supplied to this function.
175
175
> It will limit the output coordinates for cases where the circle
176
176
> dimensions exceed the ones of the image.
177
177
>
178
178
> Lines can be drawn with the ` skimage.draw.line() ` function,
179
179
> which takes four parameters:
180
- > the (y, x ) coordinate of one end of the line,
181
- > and the (y, x ) coordinate of the other end of the line.
180
+ > the (ry, cx ) coordinate of one end of the line,
181
+ > and the (ry, cx ) coordinate of the other end of the line.
182
182
>
183
183
> Other drawing functions supported by skimage can be found in
184
184
> [ the skimage reference pages] ( https://scikit-image.org/docs/dev/api/skimage.draw.html?highlight=draw#module-skimage.draw ) .
@@ -200,7 +200,7 @@ The function returns the rectangle as row (`rr`) and column (`cc`) coordinate ar
200
200
> > Drawing a circle:
201
201
> >
202
202
> > ~~~
203
- > > # Draw a blue circle with centre (200, 300) in (y, x ) coordinates, and radius 100
203
+ > > # Draw a blue circle with centre (200, 300) in (ry, cx ) coordinates, and radius 100
204
204
> > rr, cc = skimage.draw.disk(center=(200, 300), radius=100, shape=image.shape[0:2])
205
205
> > image[rr, cc] = (0, 0, 255)
206
206
> > ~~~
@@ -209,7 +209,7 @@ The function returns the rectangle as row (`rr`) and column (`cc`) coordinate ar
209
209
> > Drawing a line:
210
210
> >
211
211
> > ~~~
212
- > > # Draw a green line from (400, 200) to (500, 700) in (y, x ) coordinates
212
+ > > # Draw a green line from (400, 200) to (500, 700) in (ry, cx ) coordinates
213
213
> > rr, cc = skimage.draw.line(r0=400, c0=200, r1=500, c1=700)
214
214
> > image[rr, cc] = (0, 255, 0)
215
215
> > ~~~
@@ -438,7 +438,7 @@ The resulting masked image should look like this:
438
438
> Your task is to write some code that will produce a mask that will
439
439
> mask out everything except for the wells.
440
440
> To help with this, you should use the text file `data/centers.txt` that contains
441
- > the (x, y ) coordinates of the centre of each of the 96 wells in this image.
441
+ > the (cx, ry ) coordinates of the centre of each of the 96 wells in this image.
442
442
> You may assume that each of the wells has a radius of 16 pixels.
443
443
>
444
444
> Your program should produce output that looks like this:
@@ -459,11 +459,11 @@ The resulting masked image should look like this:
459
459
> > for line in center_file:
460
460
> > # ... getting the coordinates of each well...
461
461
> > coordinates = line.split()
462
- > > x = int(coordinates[0])
463
- > > y = int(coordinates[1])
462
+ > > cx = int(coordinates[0])
463
+ > > ry = int(coordinates[1])
464
464
> >
465
465
> > # ... and drawing a circle on the mask
466
- > > rr, cc = skimage.draw.disk(center=(y, x ), radius=16, shape=image.shape[0:2])
466
+ > > rr, cc = skimage.draw.disk(center=(ry, cx ), radius=16, shape=image.shape[0:2])
467
467
> > mask[rr, cc] = False
468
468
> >
469
469
> > # apply the mask
@@ -491,9 +491,9 @@ The resulting masked image should look like this:
491
491
> we could produce our well plate mask without having to
492
492
> read in the coordinates of the centres of each well.
493
493
> Assume that the centre of the upper left well in the image is at
494
- > location x = 91 and y = 108, and that there are
495
- > 70 pixels between each centre in the x dimension and
496
- > 72 pixels between each centre in the y dimension.
494
+ > location cx = 91 and ry = 108, and that there are
495
+ > 70 pixels between each centre in the cx dimension and
496
+ > 72 pixels between each centre in the ry dimension.
497
497
> Each well still has a radius of 16 pixels.
498
498
> Write a Python program that produces the same output image as in the previous challenge,
499
499
> but *without* having to read in the `centers.txt` file.
@@ -512,28 +512,28 @@ The resulting masked image should look like this:
512
512
> > mask = np.ones(shape=image.shape[0:2], dtype="bool")
513
513
> >
514
514
> > # upper left well coordinates
515
- > > x0 = 91
516
- > > y0 = 108
515
+ > > cx0 = 91
516
+ > > ry0 = 108
517
517
> >
518
518
> > # spaces between wells
519
- > > deltaX = 70
520
- > > deltaY = 72
519
+ > > deltaCX = 70
520
+ > > deltaRY = 72
521
521
> >
522
- > > x = x0
523
- > > y = y0
522
+ > > cx = cx0
523
+ > > ry = ry0
524
524
> >
525
525
> > # iterate each row and column
526
526
> > for row in range(12):
527
- > > # reset x to leftmost well in the row
528
- > > x = x0
527
+ > > # reset cx to leftmost well in the row
528
+ > > cx = cx0
529
529
> > for col in range(8):
530
530
> >
531
531
> > # ... and drawing a circle on the mask
532
- > > rr, cc = skimage.draw.disk(center=(y, x ), radius=16, shape=image.shape[0:2])
532
+ > > rr, cc = skimage.draw.disk(center=(ry, cx ), radius=16, shape=image.shape[0:2])
533
533
> > mask[rr, cc] = False
534
- > > x += deltaX
534
+ > > cx += deltaCX
535
535
> > # after one complete row, move to next row
536
- > > y += deltaY
536
+ > > ry += deltaRY
537
537
> >
538
538
> > # apply the mask
539
539
> > image[mask] = 0
0 commit comments