Skip to content

Commit 9bb1dec

Browse files
committed
DOC: Update documentation files
1 parent 4151f1b commit 9bb1dec

File tree

4 files changed

+41
-76
lines changed

4 files changed

+41
-76
lines changed

src/Bridge/NumPy/ConvertNumPyArrayToitkImage/ConvertNumPyArrayToitkImage.ipynb

Lines changed: 18 additions & 68 deletions
Large diffs are not rendered by default.

src/Bridge/NumPy/ConvertNumPyArrayToitkImage/Documentation.rst

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
11
:name: ConvertNumPyArrayToitkImage
22

33
Interface ITK with NumPy Array
4-
=============================
4+
===============================
55

66
.. index::
77
single: Image
8-
single: instantiate
98

109
Synopsis
1110
--------
1211

13-
This example illustrates interfacing ITK Image data with NumPy array. While doing this, there are two key issues to
14-
to keep in mind. One, the order of indexes is different between ITK image data class and NumPy array.
15-
Second, there are two ways to access ITK image data as a NumPy array. i) Get direct access to memory with the data called
16-
"View" functions (array_view_from_image and image_view_from_array), or ii) Copy the data (array_from_image and image_from_array).
17-
If the view functions are used, the data can't be modified.
12+
This example illustrates interfacing ITK Image data with NumPy array.
13+
While doing this, there are two key issues to keep in mind. One, the order of
14+
indexes is different between ITK image data class and NumPy array.
15+
Second, there are two ways to access ITK image data as a NumPy array.
16+
i) Get direct access to memory with the data called"View" functions, or
17+
ii) Copy the data using array_from_image function. If the view functions are used,
18+
the data can't be modified.
1819

1920
Results
2021
-------
22+
The size of the ITK image data read from the input file = itkSize2 ([221, 257])
2123

22-
NA
24+
The size of the NumPy array viewed from itk::Image = (257, 221)
25+
The size of the NumPy array copied from itk::Image = (257, 221)
26+
ITK image data size after convesion from NumPy = itkSize2 ([221, 257])
27+
28+
ITK image data pixel value at [2,1] = 6
29+
NumPy array pixel value at [2,1] = 8
2330

2431

2532
Code

src/Bridge/NumPy/index.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
NumPy
2+
======
3+
4+
.. toctree::
5+
:maxdepth: 1
6+
7+
ConvertNumPyArrayToitkImage/Documentation.rst

src/Bridge/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ Bridge
55
:maxdepth: 2
66

77
VtkGlue/index.rst
8+
NumPy/index.rst

0 commit comments

Comments
 (0)