Skip to content

A Quick Fix for Incorrect Argument Name#943

Open
donglihe-hub wants to merge 11 commits into
AIM-Harvard:masterfrom
donglihe-hub:master
Open

A Quick Fix for Incorrect Argument Name#943
donglihe-hub wants to merge 11 commits into
AIM-Harvard:masterfrom
donglihe-hub:master

Conversation

@donglihe-hub

@donglihe-hub donglihe-hub commented Nov 18, 2025

Copy link
Copy Markdown

Summary

This PR fixes a mismatch in argument naming that causes voxel-based feature extraction to fail when using a progressReporter.

Currently, running voxel-based extraction raises the following error:

TypeError: _DummyProgressReporter.init() got an unexpected keyword argument 'total'

This happens because _getProgressReporter() passes a "total" argument, while the _DummyProgressReporter class expects "_total" instead.

Fix

Rename "_total" to "total" in _DummyProgressReporter.init().

Minimal Reproduction

import numpy as np
import SimpleITK as sitk
from radiomics import featureextractor

np.random.seed(0)
img_np = np.random.rand(32, 32, 32).astype(np.float32)
mask_np = np.ones_like(img_np, dtype=np.uint8)

img_sitk = sitk.GetImageFromArray(img_np)
mask_sitk = sitk.GetImageFromArray(mask_np)
img_sitk.SetSpacing((1.0, 1.0, 1.0))
mask_sitk.CopyInformation(img_sitk)

extractor = featureextractor.RadiomicsFeatureExtractor(voxelBased=True)
extractor.disableAllFeatures()
extractor.enableFeatureClassByName("firstorder")

result = extractor.execute(img_sitk, mask_sitk)
print("Returned keys:", list(result.keys())[:10])

Version:

pyradiomics: 0.1.dev1335+g8ed579383.d20251118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant