Skip to content

Commit

Permalink
BUG: Fix bug in firstorder voxel-based calculation
Browse files Browse the repository at this point in the history
In firstorder, there was an incorrect call in `_initCalculation`, calling the `_initSegmentBasedCalculation` function. When extracting features in segment-based mode, this did not change the output, it only represented a redundant call.
However, when features are extracted in voxel-based mode, the coordinates used to build up the target voxel array was incorrectly reset to all voxels inside the ROI, instead of just the voxels in the current kernel mask. This caused all voxels in the parameter map to have the identical value (and equal to the value from segment-based extraction).
  • Loading branch information
JoostJM committed Jan 31, 2019
1 parent e0fdbdc commit 81e713a
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion radiomics/firstorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def __init__(self, inputImage, inputMask, **kwargs):
self.voxelArrayShift = kwargs.get('voxelArrayShift', 0)

def _initCalculation(self):
super(RadiomicsFirstOrder, self)._initSegmentBasedCalculation()
self.targetVoxelArray = self.imageArray[self.labelledVoxelCoordinates].astype('float')
self.discretizedTargetVoxelArray = None # Lazy instantiation

Expand Down

0 comments on commit 81e713a

Please sign in to comment.