[171cba]: / talk / DiseaseGroup.py

Download this file

389 lines (231 with data), 7.3 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn
from matplotlib import rcParams
rcParams["figure.figsize"] = (14, 8)
rcParams["xtick.labelsize"] = 12
rcParams["ytick.labelsize"] = 12
rcParams["font.size"] = 14
rcParams["axes.titlesize"] = 16
#rcParams["text.usetex"] = False
rcParams["font.family"] = "Serif"
rcParams["figure.dpi"] = 600
a = pd.read_csv("../data/villagebay_population.csv")
b = pd.read_csv("../data/exposure.csv")
fig, (ax, ax2) = plt.subplots(2, 1, sharex=True)
#ax = plt.subplot(211)
ax.plot(a.Year, a.VillageBay, c=seaborn.color_palette("deep", 8)[0], lw=3)
ax.scatter(a.Year, a.VillageBay, c=seaborn.color_palette("deep", 8)[0], s=50)
ax.set_title("Village Bay Population")
ax.set_ylim([180, 700])
#ax2 = plt.subplot(212, sharex=ax)
ax2.plot(b.BirthYear, b.AvgOfLambWS, c=seaborn.color_palette("deep", 8)[2], lw=3)
ax2.scatter(b.BirthYear, b.AvgOfLambWS, c=seaborn.color_palette("deep", 8)[2], s=50)
ax2.set_title("Lamb Winter Survival")
ax2.set_xlim([1984.5, 2013.5])
ax2.set_ylim([0, 0.8])
plt.savefig("figures/population2.jpg", dpi=300, jpeg_quality=100)
# <headingcell level=1>
# Robust Extraction of Quantitative Information from Histology Images
# <headingcell level=4>
# Quentin Caudron
# <headingcell level=2>
# The Soay Sheep
# <markdowncell>
# <img src="figures/graphics/soay.jpg" />
# <markdowncell>
# <img src="figures/graphics/population2.jpg" />
# <markdowncell>
# <img src="figures/graphics/lit1.jpg" />
# <markdowncell>
# <img src="figures/graphics/lit2.jpg" />
# <markdowncell>
# <img src="figures/graphics/lit4.jpg" />
# <headingcell level=2>
# Outline
# <markdowncell>
# - Methods and data collection
# - Image processing
# - Extracted measures
# - Preliminary analysis
# - Future directions
# <headingcell level=2>
# Data
# <markdowncell>
# **In the field, winter of 2011 - 2012 :**
#
# - Daily study area monitoring for deaths
# - 143 liver samples collected within a day of death
# <markdowncell>
# **In the lab :**
#
# - Sectioning after paraffin treatment
# - H&E staining of about 1000 slides
# <markdowncell>
# **Analysis :**
#
# - Pathology standard : semi-quantitative scoring
# - Image processing
# <headingcell level=3>
# The Field &copy;
# <markdowncell>
# Sweat-and-blood-collected in cold, cold Scotland.
# <markdowncell>
# Eight physical measurements :
# - Age at death
# - Weight
# - Sex
# - Limb length
# - Environmental "stress"
# <headingcell level=3>
# Clinical Pathology
# <markdowncell>
# Operator-driven visual analysis of 98 slides under microscopy.
# <markdowncell>
# Eleven discrete and continuous measures :
#
# - Inflammation
# - Necrosis
# - Apoptosis
# - Hyperplasia
# - Fibrosis
# - Hepatitis
# <headingcell level=3>
# Image Processing
# <markdowncell>
# Automated analysis of 4430 images of slides representing 143 sheep.
# <markdowncell>
# Seven structural and textural measures with varying levels of biological interpretation :
#
# - Inflammation
# - Hyperplasia / tissue density
# - Best-guess proxies for "generic degeneration"
# <headingcell level=2>
# Image Processing
# <markdowncell>
# <img src="figures/graphics/sheep.jpg"></img>
# <markdowncell>
# <img src="figures/graphics/processed.jpg"></img>
# <headingcell level=3>
# The Challenge
# <markdowncell>
# **Information extraction must be**
# - automagical - no operator input
# - reasonably quick - restricted computing time
# - robust - invariant to slicing, staining, field-related variation
# - unbiased - same algorithms for everyone
# <markdowncell>
# ![image](figures/graphics/robust3.jpg)
# <markdowncell>
# ![image](figures/graphics/robust4.jpg)
# <markdowncell>
# ![image](figures/graphics/robust1.jpg)
# <markdowncell>
# ![image](figures/graphics/robust2.jpg)
# <markdowncell>
# <img src="figures/graphics/gif.gif"></img>
# <headingcell level=2>
# Structural and Textural Measures
# <markdowncell>
# - characteristic **scale** of sinusoid widths
# - **directional** amplitude of preferred sinusoid alignment
# - **tissue to sinusoid** ratio
# - **count** of inflammatory foci per image
# - **mean size** of inflammatory foci per image
# - information **entropy** of sinusoid distribution
# - **lacunarity** ( clustering ) of sinusoids
# <markdowncell>
# ![image](figures/graphics/intra.png)
# <markdowncell>
# ![image](figures/graphics/inter2.png)
# <headingcell level=2>
# Exploratory Analysis
# <headingcell level=3>
# by individual
# <markdowncell>
# <img src="figures/regressions/BDHyperplasia/lm-0.png" />
# <markdowncell>
# <img src="figures/regressions/PortalInflammation/lm-0.png" />
# <markdowncell>
# <img src="figures/regressions/PortalInflammation/lm-1.png" />
# <headingcell level=2>
# Exploratory Analysis
# <headingcell level=3>
# controlled for age / cohort
# <markdowncell>
# <img src="figures/regressions/PortalInflammation/mm_0.png" />
# <markdowncell>
# <img src="figures/regressions/BDHyperplasia/mm_0.png" />
# <markdowncell>
# <img src="figures/regressions/BDHyperplasia/mm_1.png" />
# <markdowncell>
# <img src="figures/regressions/TawfikTotal/mm_0.png" />
# <markdowncell>
# <img src="figures/regressions/Fibrosis/mm_0.png" />
# <markdowncell>
# <img src="figures/regressions/PortalInflammation/mm_0.png" />
# <markdowncell>
# <img src="figures/regressions/Hindleg/mm_0.png" />
# <markdowncell>
# <img src="figures/regressions/Weight/mm_0.png" />
# <headingcell level=2>
# Further analysis
# <headingcell level=3>
# Age or cohort effect ?
# <markdowncell>
# <img src="figures/regressions/BDHyperplasia/mm_coefs_color_E.png" />
# <markdowncell>
# <img src="figures/regressions/BDHyperplasia/mm_coefs_color_CES.png" />
# <markdowncell>
# <img src="figures/regressions/BDHyperplasia/mm_coefs_color_RES.png" />
# <headingcell level=2>
# Conclusions
# <markdowncell>
# - our image measures capture **relevant** and **useful** information
# - a number of correlations can be **explained** biologically
# - underlying **structure** in the data needs thought
# - still no **map** from image or histological measures to condition of individual
# <headingcell level=2>
# Future directions
# <headingcell level=3>
# Further exploration of the dataset
# <markdowncell>
# - 145 sheep ( 89 females )
# - 12 age classes
# - potential redundancy in various measures
# <markdowncell>
# - 4460 entries across 27 variables
# - 3330 with full image and histological information
# - 1196 for which **complete** information is available
# <headingcell level=3>
# More data
# <markdowncell>
# - nutritional information
# - immunity data
# <headingcell level=3>
# Narrow-field images
# <markdowncell>
# - 12536 images
# - spatial distribution of nuclei
# <markdowncell>
# ![image](figures/graphics/10.jpg)
# <markdowncell>
# ![image](figures/graphics/Processed2.jpg)
# <markdowncell>
# ![image](figures/graphics/Segmented.jpg)
# <markdowncell>
# <img src="figures/graphics/10x.png" width=100%></src>
# <headingcell level=2>
# With thanks to
# <markdowncell>
# Romain Garnier
#
# Andrea Graham
#
# Tawfik Aboellail (CSU)
#
# Bryan Grenfell