Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion opengate/bin/opengate_photon_attenuation_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def go(
)
if mm:
arr = itk.array_view_from_image(image)
arr = arr * 10
arr = arr / 10
new_image = itk.image_from_array(arr)
new_image.SetSpacing(image.GetSpacing())
new_image.SetOrigin(image.GetOrigin())
Expand Down
9 changes: 6 additions & 3 deletions opengate/contrib/root_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,11 @@ def root_split_tree_by_branch(
)

with uproot.recreate(high_val_path) as high_file:
high_file.mktree(tree_name, high_val_events)
# high_file.mktree(tree_name, high_val_events)
high_file[tree_name] = high_val_events
with uproot.recreate(low_val_path) as low_file:
low_file.mktree(tree_name, low_val_events)
# low_file.mktree(tree_name, low_val_events)
low_file[tree_name] = low_val_events

if verbose:
logger.info(f"Successfully wrote high-value events to '{high_val_path}'.")
Expand Down Expand Up @@ -287,7 +289,8 @@ def root_merge_trees(
merged_data = ak.concatenate(all_data_to_merge)

with uproot.recreate(output_path) as output_file:
output_file.mktree(tree_name, merged_data)
# output_file.mktree(tree_name, merged_data)
output_file[tree_name] = merged_data

if verbose:
logger.info(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
sim.run_timing_intervals = [
(i * interval_length, (i + 1) * interval_length) for i in range(n)
]
gantry_angles_deg = [i * 20 for i in range(n)]
gantry_angles_deg = [[i * 20] for i in range(n)]
(
dynamic_translations,
dynamic_rotations,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def print_face():
print("**** ^^^ ^^^ ****")
print("**** O O ****")
print("**** L ****")
print("**** \_____/ ****")
print("**** \\_____/ ****")
print("**** V ****")
print("*******************")

Expand Down Expand Up @@ -148,7 +148,8 @@ def apply_change(self, run_id):
sim.run_timing_intervals = [
(i * interval_length, (i + 1) * interval_length) for i in range(n)
]
gantry_angles_deg = [i * 20 for i in range(n)]
# Wrap in brackets to create shape (N, 1) for newer scipy
gantry_angles_deg = [[i * 20] for i in range(n)]
# use a helper function
(
dynamic_translations,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
sim.run_timing_intervals = [
(i * interval_length, (i + 1) * interval_length) for i in range(n)
]
gantry_angles_deg = [i * 20 for i in range(n)]
gantry_angles_deg = [[i * 20] for i in range(n)]
(
dynamic_translations,
dynamic_rotations,
Expand Down
Loading