Skip to content

Commit 671557c

Browse files
committed
Updated examples with breaking changes
1 parent df915aa commit 671557c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

doc/pages/Download-stats.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ PyPi (pip) Downloads
1212
GitHub Downloads
1313
--------------------
1414

15+
* ![](https://shields.io/github/downloads/smistad/fast/v4.13.0/total)
1516
* ![](https://shields.io/github/downloads/smistad/fast/v4.12.0/total)
1617
* ![](https://shields.io/github/downloads/smistad/fast/v4.11.0/total)
1718
* ![](https://shields.io/github/downloads/smistad/fast/v4.10.0/total)

source/FAST/Examples/Python/create_rotating_3D_gif.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
iterations = 28 # Number of frames in GIF
1414
size = 384 # Output size
1515

16+
1617
class Rotate(fast.PythonProcessObject):
1718
def __init__(self, iterations):
1819
super().__init__()
@@ -27,12 +28,12 @@ def execute(self):
2728
spacing = input.getSpacing()
2829
transform = fast.Transform.create()
2930
# Rotate volume the right way first
30-
transform.addRotation(3.14/2, np.array([1, 0, 0], dtype=np.float32))
31-
transform.addRotation(3.14, np.array([0, 1, 0], dtype=np.float32))
31+
transform.addRotation(3.14/2, [1, 0, 0])
32+
transform.addRotation(3.14, [0, 1, 0])
3233
# Do the rotation:
33-
transform.addRotation(self.angle, np.array([0, 0, 1], dtype=np.float32))
34+
transform.addRotation(self.angle, [0, 0, 1])
3435
# To rotate around the center, we have to move to volume so its center is at origo:
35-
transform.addTranslation(np.array([-input.getWidth()*spacing[0,0]/2, -input.getHeight()*spacing[1,0]/2, -input.getDepth()*spacing[2,0]/2], dtype=np.float32))
36+
transform.addTranslation([-input.getWidth()*spacing[0]/2, -input.getHeight()*spacing[1]/2, -input.getDepth()*spacing[2]/2])
3637
input.setTransform(transform)
3738

3839
self.angle += 2*math.pi/iterations # Increment angle to have it rotate over time

0 commit comments

Comments
 (0)