Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
pchlap committed Dec 4, 2023
1 parent d95b1c3 commit dac6f70
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions platipy/imaging/generation/augment.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ def augment_data(args):
)

dvf = None
augmented_cmap = None

if len(augmentation) == 0:
logger.debug(
Expand Down Expand Up @@ -411,13 +412,14 @@ def augment_data(args):
sitk.WriteImage(ct_image_original, str(augmented_image_path))

# Save off context map if we have one
augmented_cmap_path = augmented_case_path.joinpath("context_map.nii.gz")
cmap_original[
index[0] : index[0] + size[0],
index[1] : index[1] + size[1],
index[2] : index[2] + size[2],
] = augmented_cmap
sitk.WriteImage(cmap_original, str(augmented_cmap_path))
if augmented_cmap:
augmented_cmap_path = augmented_case_path.joinpath("context_map.nii.gz")
cmap_original[
index[0] : index[0] + size[0],
index[1] : index[1] + size[1],
index[2] : index[2] + size[2],
] = augmented_cmap
sitk.WriteImage(cmap_original, str(augmented_cmap_path))

vis = ImageVisualiser(image=ct_image, figure_size_in=6)
vis.add_comparison_overlay(augmented_image)
Expand Down

0 comments on commit dac6f70

Please sign in to comment.