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