Skip to content

Commit 11cc8e6

Browse files
jgreweachilleas-k
authored andcommitted
[docs] remove lenna image add new example img
1 parent 55113ff commit 11cc8e6

File tree

6 files changed

+21
-53
lines changed

6 files changed

+21
-53
lines changed

docs/source/examples/boats.png

435 KB
Loading

docs/source/examples/imageData.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434

3535
def load_image():
36-
image = img.open('lenna.png')
36+
image = img.open('boats.png')
3737
pix = np.array(image)
3838
channels = list(image.mode)
3939
return pix, channels

docs/source/examples/imageWithMetadata.py

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,6 @@
1111
1212
Author: Jan Grewe <[email protected]>
1313
14-
See https://github.com/G-node/nix/wiki for more information.
15-
16-
We use the "Lenna" image in this tutorial.
17-
18-
"Lenna" by Original full portrait: "Playmate of the Month". Playboy
19-
Magazine. November 1972, photographed by Dwight Hooker.This 512x512
20-
electronic/mechanical scan of a section of the full portrait:
21-
Alexander Sawchuk and two others[1] - The USC-SIPI image
22-
database. Via Wikipedia -
23-
http://en.wikipedia.org/wiki/File:Lenna.png#mediaviewer/File:Lenna.png
24-
2514
"""
2615
import numpy as np
2716
import nixio as nix
@@ -58,7 +47,7 @@ def print_metadata_table(section, ax):
5847

5948

6049
def load_image():
61-
image = img.open('lenna.png')
50+
image = img.open('boats.png')
6251
pix = np.array(image)
6352
channels = list(image.mode)
6453
return pix, channels
@@ -86,14 +75,11 @@ def plot_data(data_array):
8675

8776
def add_image_information(nix_file):
8877
section = nix_file.create_section('Image metadata', 'image_source')
89-
section['Original name'] = 'Lenna'
90-
section['Journal'] = 'Playboy Magazine'
91-
section['Year'] = 1972
92-
section['Month'] = 'November'
93-
section['Author'] = 'Dwight Hooker'
94-
section['Source'] = 'http://en.wikipedia.org/wiki/File:Lenna.png#mediaviewer/File:Lenna.png'
95-
section['Comment'] = '512x512 electronic/mechanical scan of a section of the full portrait: Alexander Sawchuk and two others[1] - The USC-SIPI image database.'
96-
section['Model'] = 'Lena Soederberg'
78+
section['Original name'] = 'Boats'
79+
section['Location'] = 'Port Louis'
80+
section['Year'] = 2014
81+
section['Month'] = 'August'
82+
section['Author'] = 'Self'
9783
return section
9884

9985

docs/source/examples/lenna.png

-463 KB
Binary file not shown.

docs/source/examples/multipleROIs.py

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,6 @@
1313
1414
See https://github.com/G-node/nix/wiki for more information.
1515
16-
We use the "Lenna" image in this tutorial.
17-
18-
"Lenna" by Original full portrait: "Playmate of the Month". Playboy
19-
Magazine. November 1972, photographed by Dwight Hooker.This 512x512
20-
electronic/mechanical scan of a section of the full portrait:
21-
Alexander Sawchuk and two others[1] - The USC-SIPI image
22-
database. Via Wikipedia -
23-
http://en.wikipedia.org/wiki/File:Lenna.png#mediaviewer/File:Lenna.png
24-
2516
"""
2617

2718
import nixio
@@ -33,7 +24,7 @@
3324

3425

3526
def load_image():
36-
image = img.open('lenna.png')
27+
image = img.open('boats.png')
3728
pix = np.array(image)
3829
channels = list(image.mode)
3930
return pix, channels
@@ -71,7 +62,7 @@ def plot_roi_data(tag):
7162

7263
fig = plt.figure(figsize=(5.5, 5.5))
7364
for p in range(position_count):
74-
roi_data = tag.tagged_data(p, "lenna")[:]
65+
roi_data = tag.tagged_data(p, "boats")[:]
7566
roi_data = np.array(roi_data, dtype='uint8')
7667
ax = fig.add_subplot(position_count, 1, p + 1)
7768
image = img.fromarray(roi_data)
@@ -96,7 +87,7 @@ def main():
9687

9788
# create a 'DataArray' to take the sinewave, add some information about
9889
# the signal
99-
data = block.create_data_array("lenna", "nix.image.rgb", data=img_data)
90+
data = block.create_data_array("boats", "nix.image.rgb", data=img_data)
10091
# add descriptors for width, height and channels
10192
data.append_sampled_dimension(1, label="height")
10293
data.append_sampled_dimension(1, label="width")
@@ -105,14 +96,14 @@ def main():
10596
num_regions = 3
10697
num_dimensions = len(data.dimensions)
10798
roi_starts = np.zeros((num_regions, num_dimensions), dtype=int)
108-
roi_starts[0, :] = [250, 245, 0]
109-
roi_starts[1, :] = [250, 315, 0]
110-
roi_starts[2, :] = [340, 260, 0]
99+
roi_starts[0, :] = [170, 50, 0]
100+
roi_starts[1, :] = [250, 310, 0]
101+
roi_starts[2, :] = [120, 425, 0]
111102

112103
roi_extents = np.zeros((num_regions, num_dimensions), dtype=int)
113-
roi_extents[0, :] = [30, 45, 3]
114-
roi_extents[1, :] = [30, 40, 3]
115-
roi_extents[2, :] = [25, 65, 3]
104+
roi_extents[0, :] = [240, 175, 3]
105+
roi_extents[1, :] = [60, 135, 3]
106+
roi_extents[2, :] = [170, 125, 3]
116107

117108
# create the positions DataArray
118109
positions = block.create_data_array("ROI positions", "nix.positions", data=roi_starts)

docs/source/examples/singleROI.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,6 @@
1111
1212
Author: Jan Grewe <[email protected]>
1313
14-
We use the "Lenna" image in this tutorial.
15-
16-
"Lenna" by Original full portrait: "Playmate of the Month". Playboy
17-
Magazine. November 1972, photographed by Dwight Hooker.This 512x512
18-
electronic/mechanical scan of a section of the full portrait:
19-
Alexander Sawchuk and two others[1] - The USC-SIPI image
20-
database. Via Wikipedia -
21-
http://en.wikipedia.org/wiki/File:Lenna.png#mediaviewer/File:Lenna.png
22-
2314
"""
2415

2516
import nixio as nix
@@ -30,7 +21,7 @@
3021

3122

3223
def load_image():
33-
image = img.open('lenna.png')
24+
image = img.open('boats.png')
3425
pix = np.array(image)
3526
channels = list(image.mode)
3627
return pix, channels
@@ -69,16 +60,16 @@ def main():
6960
block = f.create_block("block name", "nix.session")
7061

7162
# create a 'DataArray' to take the sinewave, add some information about the signal
72-
data = block.create_data_array("lenna", "nix.image.rgb", data=img_data)
63+
data = block.create_data_array("boats", "nix.image.rgb", data=img_data)
7364
# add descriptors for width, height and channels
7465
data.append_sampled_dimension(1, label="height")
7566
data.append_sampled_dimension(1, label="width")
7667
data.append_set_dimension(labels=channels)
7768

7869
# create a Tag, position and extent must be 3-D since the data is 3-D
79-
position = [250, 250, 0]
80-
extent = [30, 100, 3]
81-
tag = block.create_tag('Region of interest', 'nix.roi', position)
70+
position = [170, 50, 0]
71+
extent = [240, 175, 3]
72+
tag = block.create_tag('Sailing boat', 'nix.roi', position)
8273
tag.extent = extent
8374
tag.references.append(data)
8475

0 commit comments

Comments
 (0)