Skip to content

Commit 2df8533

Browse files
committed
BUG: Download data for SegmentWithGeodesicActiveContourLevelSet
1 parent ef97143 commit 2df8533

File tree

1 file changed

+31
-16
lines changed
  • src/Segmentation/LevelSets/SegmentWithGeodesicActiveContourLevelSet

1 file changed

+31
-16
lines changed

src/Segmentation/LevelSets/SegmentWithGeodesicActiveContourLevelSet/Code.ipynb

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 1,
5+
"execution_count": 11,
66
"id": "196c6071",
77
"metadata": {},
88
"outputs": [],
99
"source": [
1010
"import sys\n",
11+
"import os\n",
12+
"from urllib.request import urlretrieve\n",
1113
"\n",
1214
"import itk\n",
1315
"\n",
@@ -16,14 +18,27 @@
1618
},
1719
{
1820
"cell_type": "code",
19-
"execution_count": 2,
21+
"execution_count": 14,
22+
"id": "d6f35e01",
23+
"metadata": {},
24+
"outputs": [],
25+
"source": [
26+
"input_filename = 'BrainProtonDensitySlice.png'\n",
27+
"if not os.path.exists(input_filename):\n",
28+
" url = 'https://data.kitware.com/api/v1/file/57b5d8028d777f10f2694bbf/download'\n",
29+
" urlretrieve(url, input_filename)"
30+
]
31+
},
32+
{
33+
"cell_type": "code",
34+
"execution_count": 15,
2035
"id": "52104b31",
2136
"metadata": {},
2237
"outputs": [
2338
{
2439
"data": {
2540
"application/vnd.jupyter.widget-view+json": {
26-
"model_id": "f93f02adae4d47c7add2409a5f97b075",
41+
"model_id": "5c911f073d074ca5ab86bcc998be38ce",
2742
"version_major": 2,
2843
"version_minor": 0
2944
},
@@ -38,21 +53,21 @@
3853
"source": [
3954
"InputPixelType = itk.ctype('float')\n",
4055
"\n",
41-
"input_image = itk.imread('./BrainProtonDensitySlice.png', InputPixelType)\n",
56+
"input_image = itk.imread(input_filename, InputPixelType)\n",
4257
"\n",
4358
"view(input_image)"
4459
]
4560
},
4661
{
4762
"cell_type": "code",
48-
"execution_count": 3,
63+
"execution_count": 16,
4964
"id": "4297e2ac",
5065
"metadata": {},
5166
"outputs": [
5267
{
5368
"data": {
5469
"application/vnd.jupyter.widget-view+json": {
55-
"model_id": "ec1c09bacc97419f8da1825563aa36bc",
70+
"model_id": "48427848c38f4403a2e455f169e59503",
5671
"version_major": 2,
5772
"version_minor": 0
5873
},
@@ -74,14 +89,14 @@
7489
},
7590
{
7691
"cell_type": "code",
77-
"execution_count": 4,
92+
"execution_count": 17,
7893
"id": "99186583",
7994
"metadata": {},
8095
"outputs": [
8196
{
8297
"data": {
8398
"application/vnd.jupyter.widget-view+json": {
84-
"model_id": "dd0a1ba394ed4cab87b0c79e7b9a137d",
99+
"model_id": "387458e9005f493abba1faa10f5e6528",
85100
"version_major": 2,
86101
"version_minor": 0
87102
},
@@ -103,14 +118,14 @@
103118
},
104119
{
105120
"cell_type": "code",
106-
"execution_count": 5,
121+
"execution_count": 18,
107122
"id": "8a219f34",
108123
"metadata": {},
109124
"outputs": [
110125
{
111126
"data": {
112127
"application/vnd.jupyter.widget-view+json": {
113-
"model_id": "4839685882a04ed3a697f3e947458368",
128+
"model_id": "b8e81a5c3231401ba52272957a34700b",
114129
"version_major": 2,
115130
"version_minor": 0
116131
},
@@ -137,7 +152,7 @@
137152
},
138153
{
139154
"cell_type": "code",
140-
"execution_count": 6,
155+
"execution_count": 19,
141156
"id": "499443a8",
142157
"metadata": {},
143158
"outputs": [],
@@ -161,14 +176,14 @@
161176
},
162177
{
163178
"cell_type": "code",
164-
"execution_count": 7,
179+
"execution_count": 20,
165180
"id": "d2c5e205",
166181
"metadata": {},
167182
"outputs": [
168183
{
169184
"data": {
170185
"application/vnd.jupyter.widget-view+json": {
171-
"model_id": "8d762859e81a48698841081217638423",
186+
"model_id": "5a85dd6a06c24123b6f15ee9e3347c49",
172187
"version_major": 2,
173188
"version_minor": 0
174189
},
@@ -198,7 +213,7 @@
198213
},
199214
{
200215
"cell_type": "code",
201-
"execution_count": 8,
216+
"execution_count": 21,
202217
"id": "1269f1b4",
203218
"metadata": {},
204219
"outputs": [],
@@ -214,14 +229,14 @@
214229
},
215230
{
216231
"cell_type": "code",
217-
"execution_count": 9,
232+
"execution_count": 22,
218233
"id": "58bdf582",
219234
"metadata": {},
220235
"outputs": [
221236
{
222237
"data": {
223238
"application/vnd.jupyter.widget-view+json": {
224-
"model_id": "9c693a5687134f269fd009babaae2e29",
239+
"model_id": "c02ac62a77bb498c90c602398a5764ee",
225240
"version_major": 2,
226241
"version_minor": 0
227242
},

0 commit comments

Comments
 (0)