Skip to content
Snippets Groups Projects
Commit eae0f83f authored by Simon Wittl's avatar Simon Wittl
Browse files

add example 5

parent 5b27a608
No related branches found
No related tags found
No related merge requests found
from artist_pythonlib import API
from artist_pythonlib.trajectory import circular_trajectory
from pathlib import Path
import numpy as np
NUMBER_OF_PROJECTIONS = 200
def main():
# Initialize the api.
artist_api = API()
# Save Folder
save_folder = Path('./workspace')
save_folder.mkdir(exist_ok=True)
# Save image / Save images and load them is fastern than to send the images via the rc connection.
trajectory = circular_trajectory(500., 1000., NUMBER_OF_PROJECTIONS)
api = API()
for i in range(NUMBER_OF_PROJECTIONS):
source, detector, rotation_matrix = trajectory[0][i], trajectory[1][i], trajectory[2][i]
api.translate('S', *source + 3 * (0.5 - np.random.random(3)))
api.translate('D', *detector + 3 * (0.5 - np.random.random(3)))
api.rotate_from_rotation_matrix('S', rotation_matrix)
api.rotate_from_rotation_matrix('D', rotation_matrix)
artist_api.save_hdf5(save_folder / 'smurf.h5')
if __name__ == '__main__':
main()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment