Closed QiChen2014 closed 6 years ago
as to you many NaN, 0 and 1 values, that usually happens in case of a flat region (when the range of gray values inside the roi < binwidth).
binWidth: most firstorder features are not affected by this setting (only entropy and uniformity). binWidth mainly serves the required discretization for texture matrix calculation.
If you see a lot of strange and/or unexpected values, it may help to run PyRadiomics with logging enabled @ level DEBUG.
Thank you @JoostJM , I'll try it.
Hi @JoostJM , I have a big problem now. I used "batchprocessing.py" to process 473 cases, and 277 of them worked fine, but others failed with "MemoryError". The error information in the log file like this:
Then I processed it separately, and no error occurred. So, should I deal with these 473 cases separately? By the way, what value should be set to parameter "normalizeScale" to do normalization?
Thank you very much!
What kind of processor architecture do you have? In 32-bits, SimpleITK sometimes has these memory errors, which is why we advise to use PyRadiomics in 64-bits
It's 64-bits, windows 10 home edition, 8G RAM
Ah wait. I think I know the problem. You don't enable resampling or precrop, meaning that your entire image gets passed to the filter function. Especially in CT, one such image can be quite large. (e.g. ~50 -150 mb's or so). Wavelet filter is then the only filter that computes all of it's derived images immediatly, meaning that at one point, you have the original + 8 derivations in your memory, which can take up a lot of memory. Add the fact that when you get they numpy array, this increases even more, and you're left with the fact that 8GB of RAM is woefully short of what your computer would like to have available.
This is the reason the preCrop parameter exists, as this crops the image onto the bounding box (with additional padding to keep the filter output as close to the original (without cropping) as possible. for wavelet, I'd advise a padding of about 10 or so.
That being said, I saw you are extracting in 3D, but do not resample to an isotropic voxel size. This breaks the assumption that distances between neighbors (in infinity norm) is equal, as this requires isotropic voxels in 3D, which is usually not the case in medical imaging. I would advise to either enable resampling to a common spacing, only extract in 2D (force2D
parameter, still uses the entire volume, but does not consider voxels on adjoining slices to be neighbors) or enable matrix weighting (set weightingNorm
parameter)
Thank you @JoostJM ,I get it now. As you said, I set the parameters like this:
is it right? Sincere thanks to your help.
As you are enabling resampling to [3, 3, 3] you don't have to enable preCrop: False
(has no effect as resampling is enabled, and performs a similar action).
Also, this results in isotropic voxels, and you can extract features in 3D (set force2D
to False
). This is only needed when there are isotropic voxels in-plane, but have a different size out-of-plane.
Thanks very much for your help! I really appreciate it.
Hi everyone,I'm trying to extract radiomics features from some 3D CT images. I referred to the example file which named batchprocessing.py to handle our renal cancer images, and got more than 1000 features. But there are many NaN, 0 and 1 in the feature values. I have checked the voxelNum as the document said, the minimum value is 575, and the maximum value is 350221. In addition, I compared the range of gray values in the ROI (a First Order feature) with the value 1, 5, 10, 15, 20, 25 for the binWidth parameter respectively, then I got the same result. Why? How should I solve this problem? Could some body help me? Thanks!