InsightSoftwareConsortium / InsightSoftwareConsortium/ITK

TubeSpatialObject bounding box includes rounded ends even after they are turned off

Open
#4,657 5 comments 0 reactions 1 assignee Claimed by @aylward View on GitHub
type:Bug
Dominant language
C++
Stars
1.7k
Forks
748
Avg merge
1d 1h
Merged PRs (30d)
64

Description

### Description

The bounding box for TubeSpatialObject always includes rounded ends.

### Steps to Reproduce

```python
tso = itk.TubeSpatialObject.x3.New()
tso.SetEndRounded(False)
for z in (-1, 1):
tsop = itk.TubeSpatialObjectPoint.x3()
tsop.SetPositionInObjectSpace((0, 0, z))
tsop.SetRadiusInObjectSpace(1)
tso.AddPoint(tsop)
tso.Update()
bbox = tso.GetMyBoundingBoxInWorldSpace()
print(bbox.GetMinimum(), bbox.GetMaximum())
```

### Expected behavior

```python
itkPointD3 ([-1, -1, -1]) itkPointD3 ([1, 1, 1])
```

### Actual behavior

```python
itkPointD3 ([-1, -1, -2]) itkPointD3 ([1, 1, 2])
```
The results do not change when `EndRounded` is toggled, though they should. Moreover, the bounding box extent in z increases when `RadiusInObjectSpace` is increased, which should only be expected when `EndRounded` is True.

### Reproducibility

Happens every time.

### Versions

Tested on v5.3 and v5.4rc4.

### Environment

### Additional Information

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.