Skip to content

Commit 81c0600

Browse files
committed
doc: MixingITKAndNumPy comment formatting
1 parent 5761200 commit 81c0600

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

‎docs/Quick_start_guide.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ A common use case for using ITK in Python is to mingle NumPy and ITK operations
8484
The following script shows how to integrate NumPy and ITK:
8585

8686
.. literalinclude:: code/MixingITKAndNumPy.py
87-
:lines: 8-32
87+
:lines: 8-33
8888

8989

9090
Similar functions are available to work with VNL vector and matrices:
9191

9292
.. literalinclude:: code/MixingITKAndNumPy.py
93-
:lines: 34-
93+
:lines: 35-
9494

9595

9696
Examples

‎docs/code/MixingITKAndNumPy.py‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,23 @@
1111
# Read input image
1212
itk_image = itk.imread(input_filename)
1313

14-
#run filters on itkImage
14+
# Run filters on itk.Image
1515

16-
#view only of itkImage, data is not copied
17-
np_view = itk.GetArrayViewFromImage( itk_image )
16+
# View only of itk.Image, data is not copied
17+
np_view = itk.GetArrayViewFromImage(itk_image)
1818

19-
#copy of itkImage, data is copied
20-
np_copy = itk.GetArrayFromImage( itk_image )
19+
# Copy of itk.Image, data is copied
20+
np_copy = itk.GetArrayFromImage(itk_image)
2121

2222

23-
#do numpy stuff
23+
# Do numpy stuff
2424

25-
#convert back to itk, view only, data is not copied
26-
itk_np_view = itk.GetImageViewFromArray( np_copy)
2725

28-
#convert back to itk, data is not copied
29-
itk_np_copy = itk.GetImageFromArray( np_copy)
26+
# Convert back to itk, view only, data is not copied
27+
itk_np_view = itk.GetImageViewFromArray(np_copy)
28+
29+
# Convert back to itk, data is not copied
30+
itk_np_copy = itk.GetImageFromArray(np_copy)
3031

3132
# Save result
3233
itk.imwrite(itk_np_view, output_filename)

0 commit comments

Comments
 (0)