Skip to content

Commit a21af16

Browse files
committed
Update the R setup.
Move from using the IRKernel (R 3.x) to RKernel (R 4.x) Jupyter kernel. Move from old style Python wrapping of code in R to new style, rPython replaced by reticulate.
1 parent 959533f commit a21af16

16 files changed

+695
-185
lines changed

R/00_Setup.ipynb

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,32 @@
3232
"cell_type": "code",
3333
"execution_count": null,
3434
"metadata": {
35-
"collapsed": false
35+
"collapsed": false,
36+
"jupyter": {
37+
"outputs_hidden": false
38+
},
39+
"vscode": {
40+
"languageId": "r"
41+
}
3642
},
3743
"outputs": [],
3844
"source": [
3945
"# check that all packages are installed (see requirements.txt file)\n",
40-
"required_packages <- c(\"SimpleITK\", \"rPython\", \"scatterplot3d\", \"tidyr\", \"ggplot2\", \"xtable\", \"purrr\")\n",
46+
"required_packages <- c(\"SimpleITK\", \"reticulate\", \"scatterplot3d\", \"tidyr\", \"ggplot2\", \"xtable\", \"purrr\")\n",
4147
"missing_packages <- required_packages[!unlist(lapply(required_packages, require, character.only = TRUE, quietly = TRUE))]"
4248
]
4349
},
4450
{
4551
"cell_type": "code",
4652
"execution_count": null,
4753
"metadata": {
48-
"collapsed": false
54+
"collapsed": false,
55+
"jupyter": {
56+
"outputs_hidden": false
57+
},
58+
"vscode": {
59+
"languageId": "r"
60+
}
4961
},
5062
"outputs": [],
5163
"source": [
@@ -67,8 +79,14 @@
6779
"cell_type": "code",
6880
"execution_count": null,
6981
"metadata": {
70-
"collapsed": false,
71-
"simpleitk_error_allowed": "Exception in SITK"
82+
"collapsed": false,
83+
"jupyter": {
84+
"outputs_hidden": false
85+
},
86+
"simpleitk_error_allowed": "Exception in SITK",
87+
"vscode": {
88+
"languageId": "r"
89+
}
7290
},
7391
"outputs": [],
7492
"source": [
@@ -91,7 +109,13 @@
91109
"cell_type": "code",
92110
"execution_count": null,
93111
"metadata": {
94-
"collapsed": true
112+
"collapsed": true,
113+
"jupyter": {
114+
"outputs_hidden": true
115+
},
116+
"vscode": {
117+
"languageId": "r"
118+
}
95119
},
96120
"outputs": [],
97121
"source": [
@@ -103,17 +127,17 @@
103127
"kernelspec": {
104128
"display_name": "R",
105129
"language": "R",
106-
"name": "ir"
130+
"name": "rkernel"
107131
},
108132
"language_info": {
109-
"codemirror_mode": "r",
110-
"file_extension": ".r",
133+
"codemirror_mode": "R",
134+
"file_extension": ".R",
111135
"mimetype": "text/x-r-source",
112136
"name": "R",
113137
"pygments_lexer": "r",
114-
"version": "3.2.3"
138+
"version": "4.5.1"
115139
}
116140
},
117141
"nbformat": 4,
118-
"nbformat_minor": 2
142+
"nbformat_minor": 4
119143
}

R/22_Transforms.ipynb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,10 @@
482482
{
483483
"cell_type": "markdown",
484484
"metadata": {
485-
"collapsed": true
485+
"collapsed": true,
486+
"jupyter": {
487+
"outputs_hidden": true
488+
}
486489
},
487490
"source": [
488491
"## Similarity to Affine [3D]\n",
@@ -935,7 +938,10 @@
935938
{
936939
"cell_type": "markdown",
937940
"metadata": {
938-
"collapsed": true
941+
"collapsed": true,
942+
"jupyter": {
943+
"outputs_hidden": true
944+
}
939945
},
940946
"source": [
941947
"## Writing and Reading\n",
@@ -1022,7 +1028,7 @@
10221028
"kernelspec": {
10231029
"display_name": "R",
10241030
"language": "R",
1025-
"name": "ir"
1031+
"name": "rkernel"
10261032
},
10271033
"language_info": {
10281034
"codemirror_mode": "r",
@@ -1034,5 +1040,5 @@
10341040
}
10351041
},
10361042
"nbformat": 4,
1037-
"nbformat_minor": 1
1043+
"nbformat_minor": 4
10381044
}

R/300_Segmentation_Overview.ipynb

Lines changed: 58 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
"cell_type": "code",
1616
"execution_count": null,
1717
"metadata": {
18-
"collapsed": false
18+
"collapsed": false,
19+
"jupyter": {
20+
"outputs_hidden": false
21+
}
1922
},
2023
"outputs": [],
2124
"source": [
@@ -36,6 +39,9 @@
3639
"execution_count": null,
3740
"metadata": {
3841
"collapsed": true,
42+
"jupyter": {
43+
"outputs_hidden": true
44+
},
3945
"simpleitk_error_allowed": "Exception in SITK"
4046
},
4147
"outputs": [],
@@ -62,6 +68,9 @@
6268
"execution_count": null,
6369
"metadata": {
6470
"collapsed": true,
71+
"jupyter": {
72+
"outputs_hidden": true
73+
},
6574
"simpleitk_error_allowed": "Exception in SITK"
6675
},
6776
"outputs": [],
@@ -77,6 +86,9 @@
7786
"execution_count": null,
7887
"metadata": {
7988
"collapsed": true,
89+
"jupyter": {
90+
"outputs_hidden": true
91+
},
8092
"simpleitk_error_allowed": "Exception in SITK"
8193
},
8294
"outputs": [],
@@ -101,6 +113,9 @@
101113
"execution_count": null,
102114
"metadata": {
103115
"collapsed": false,
116+
"jupyter": {
117+
"outputs_hidden": false
118+
},
104119
"simpleitk_error_allowed": "Exception in SITK"
105120
},
106121
"outputs": [],
@@ -137,6 +152,9 @@
137152
"execution_count": null,
138153
"metadata": {
139154
"collapsed": false,
155+
"jupyter": {
156+
"outputs_hidden": false
157+
},
140158
"simpleitk_error_allowed": "Exception in SITK"
141159
},
142160
"outputs": [],
@@ -165,6 +183,9 @@
165183
"execution_count": null,
166184
"metadata": {
167185
"collapsed": true,
186+
"jupyter": {
187+
"outputs_hidden": true
188+
},
168189
"simpleitk_error_allowed": "Exception in SITK"
169190
},
170191
"outputs": [],
@@ -188,6 +209,9 @@
188209
"execution_count": null,
189210
"metadata": {
190211
"collapsed": true,
212+
"jupyter": {
213+
"outputs_hidden": true
214+
},
191215
"simpleitk_error_allowed": "Exception in SITK"
192216
},
193217
"outputs": [],
@@ -213,6 +237,9 @@
213237
"execution_count": null,
214238
"metadata": {
215239
"collapsed": true,
240+
"jupyter": {
241+
"outputs_hidden": true
242+
},
216243
"simpleitk_error_allowed": "Exception in SITK"
217244
},
218245
"outputs": [],
@@ -242,6 +269,9 @@
242269
"execution_count": null,
243270
"metadata": {
244271
"collapsed": true,
272+
"jupyter": {
273+
"outputs_hidden": true
274+
},
245275
"simpleitk_error_allowed": "Exception in SITK"
246276
},
247277
"outputs": [],
@@ -265,6 +295,9 @@
265295
"execution_count": null,
266296
"metadata": {
267297
"collapsed": true,
298+
"jupyter": {
299+
"outputs_hidden": true
300+
},
268301
"simpleitk_error_allowed": "Exception in SITK"
269302
},
270303
"outputs": [],
@@ -292,6 +325,9 @@
292325
"execution_count": null,
293326
"metadata": {
294327
"collapsed": true,
328+
"jupyter": {
329+
"outputs_hidden": true
330+
},
295331
"simpleitk_error_allowed": "Exception in SITK"
296332
},
297333
"outputs": [],
@@ -324,7 +360,10 @@
324360
"cell_type": "code",
325361
"execution_count": null,
326362
"metadata": {
327-
"collapsed": true
363+
"collapsed": true,
364+
"jupyter": {
365+
"outputs_hidden": true
366+
}
328367
},
329368
"outputs": [],
330369
"source": [
@@ -347,7 +386,10 @@
347386
"cell_type": "code",
348387
"execution_count": null,
349388
"metadata": {
350-
"collapsed": false
389+
"collapsed": false,
390+
"jupyter": {
391+
"outputs_hidden": false
392+
}
351393
},
352394
"outputs": [],
353395
"source": [
@@ -365,7 +407,10 @@
365407
"cell_type": "code",
366408
"execution_count": null,
367409
"metadata": {
368-
"collapsed": false
410+
"collapsed": false,
411+
"jupyter": {
412+
"outputs_hidden": false
413+
}
369414
},
370415
"outputs": [],
371416
"source": [
@@ -376,7 +421,10 @@
376421
"cell_type": "code",
377422
"execution_count": null,
378423
"metadata": {
379-
"collapsed": false
424+
"collapsed": false,
425+
"jupyter": {
426+
"outputs_hidden": false
427+
}
380428
},
381429
"outputs": [],
382430
"source": [
@@ -397,6 +445,9 @@
397445
"execution_count": null,
398446
"metadata": {
399447
"collapsed": true,
448+
"jupyter": {
449+
"outputs_hidden": true
450+
},
400451
"simpleitk_error_allowed": "Exception in SITK"
401452
},
402453
"outputs": [],
@@ -410,7 +461,7 @@
410461
"kernelspec": {
411462
"display_name": "R",
412463
"language": "R",
413-
"name": "ir"
464+
"name": "rkernel"
414465
},
415466
"language_info": {
416467
"codemirror_mode": "r",
@@ -422,5 +473,5 @@
422473
}
423474
},
424475
"nbformat": 4,
425-
"nbformat_minor": 1
476+
"nbformat_minor": 4
426477
}

0 commit comments

Comments
 (0)