Closed mattwarkentin closed 3 years ago
As a follow-up, even using the resampled image and mask does not match the bounding boxes:
# Resampling
img_rs, mask_rs = rio.resampleImage(img, lmap, resampledPixelSpacing = [1, 1, 1], interpolator = "sitkLinear")
lsif3 = sitk.LabelStatisticsImageFilter()
lsif3.Execute(img_rs, mask_rs)
lsif3.GetBoundingBox(1)
#> (6, 12, 6, 9, 6, 10)
chk = rio.checkMask(img_rs, mask_rs)
chk[0]
#> array([ 6, 12, 6, 9, 6, 10])
HI @mattwarkentin, sorry for the late reply.
The differences in the BoundingBoxes are mainly due to the use of 2 separate SimpleITK functions, which return a slightly different notation of the bounding box.
imageopration.CheckMask
uses SimpleITK.LabelStatisticsImageFilter
, returning the upper and lower bound indices (see docs)
generalInfo
(diagnostic features) use SimpleITK.LableShapeStatiscticsImageFilter
, returning the lower bound and size of the bounding box (see docs)
Taking this into account, your reported bounding boxes seem fine to me.
Describe the bug
Hi @JoostJM, I will try to keep this as simple as possible. I performed a feature extraction using a CT image and a mask/label map with only a single label (one tumour). I was looking over some of the reported diagnostic metrics and they looked odd to me, so I tried to reproduce them by using some of the lower-level functions that are used in the feature extracting process. In particular, the bounding boxes values confused me.
The numbers returned via
RadiomicsFeatureExtractor()
do not agree with either those returned by directly usingsitk.LabelStatisticsImageFilter()
orCheckMask()
. Please see below.PyRadiomics configuration
To Reproduce I can't share the specific image and mask, but I think this should be reproducible with any image-mask pair. Here is some code and results that present the issue:
Version: