Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vessel Deformation Bug #392

Open
faberno opened this issue Nov 6, 2024 · 0 comments · May be fixed by #394
Open

Vessel Deformation Bug #392

faberno opened this issue Nov 6, 2024 · 0 comments · May be fixed by #394
Labels
bug Something isn't working

Comments

@faberno
Copy link
Collaborator

faberno commented Nov 6, 2024

Describe the bug
Structure Deformation should only be along the z-axis but vessels are also deformed along the x and y axis.

Specify a priority (low, medium, high)
medium

To Reproduce
Run minimal optical example:
Current behaviour:
simpa_bug_old

Intended behaviour:
simpa_bug_new

The vessel should have the same thickness along the axis.

To increase visibility of the bug, increase maximum_z_elevation_mm in volume_creation_module_model_based_adapter.py

Environment (please complete the following information):

  • OS: Ubuntu 22.04
  • SIMPA 1.0

Additional context
The bug is caused by applying the deformation to all 3 axes in CircularTubularStructure:
deformation_values_mm = deformation_values_mm.reshape(self.volume_dimensions_voxels[0],
self.volume_dimensions_voxels[1], 1, 1)
deformation_values_mm = torch.tile(torch.as_tensor(
deformation_values_mm, dtype=torch.float, device=self.torch_device), (1, 1, self.volume_dimensions_voxels[2], 3))
deformation_values_mm /= self.voxel_spacing
target_vector += deformation_values_mm

Fix: only apply deformation to z axis
deformation_values_mm = deformation_values_mm.reshape(self.volume_dimensions_voxels[0],
self.volume_dimensions_voxels[1], 1)
deformation_values_mm = torch.tile(torch.as_tensor(
deformation_values_mm, dtype=torch.float, device=self.torch_device), (1, 1, self.volume_dimensions_voxels[2]))
deformation_values_mm /= self.voxel_spacing
target_vector[..., -1] += deformation_values_mm
del deformation_values_mm

@faberno faberno added the bug Something isn't working label Nov 6, 2024
@faberno faberno linked a pull request Nov 7, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant