Vessel Deformation Bug
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:
Intended behaviour:
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