Frequently Asked Questions

Installation

During setup, python is unable to compile the C extensions.

This can occur when no compiler is available for python. If you’re installing on Windows, you can find free compilers for python here.

Which python versions is PyRadiomics compatible with?

PyRadiomics is compatible with both python 2 and python 3. The automated testing uses python versions 2.7, 3.4 and 3.5 (both 32 and 64 bits). Python < 2.6 is not supported. Other python versions may be compatible with PyRadiomics, but this is not actively tested and therefore not guaranteed to work.

Input / Customization

I want to customize my extraction. How do I do that?

See also the Usage section. PyRadiomics can be customized in various ways, but it’s most easy to do this by providing a parameter file. In this yaml structured text file you can define your custom settings and which features and input image types to enable. Possible general settings, as well as possible image types are documented here, with additional feature class specific settings documented at the start of the feature class.

What file types are supported by PyRadiomics for input image and mask?

PyRadiomics uses SimpleITK for image loading and handling. Therefore, all image types supported by SimpleITK can be used as input for PyRadiomics. Please note that only one file location can be provided for image/mask. If you want to provide the image in DICOM format, load the DICOM images using SimpleITK functionality and pass the resultant image object instead.

What modalities does PyRadiomics support?

PyRadiomics is not developed for one specific modality. Multiple modalities can be processed by PyRadiomics, although the optimal settings may differ between modalities. There are some constraints on the input however:

  1. Gray scale volume: PyRadiomics currently does not provide extraction from color images or images with complex values
  2. 3D or slice: Although PyRadiomics supports single slice (2D) feature extraction, the input is still required to have 3 dimensions (where in case of 2D, a dimension may be of size 1).

Can I use DICOM-RT struct for the input mask?

PyRadiomics does not support DICOM-RT struct as input directly. We recommend to convert these using for example SlicerRT. We are working on providing support for DICOM-RT in the Slicer extension, but this is not thoroughly tested yet.

Usage

How should the input file for pyradiomicsbatch be structured?

Currently, the input file for pyradiomicsbatch is a csv file specifying the combinations of images and masks for which to extract features. It does not contain a header line, and each line represents one such combination. Each line has 5 elements: Patient, Image, Mask, Image location, Mask location. Only the last two elements are ‘active’ (used during extraction), the are the locations of the image and mask files on the computer. The first three elements are copied to the output and are there to enable easy clustering of the results or correlation to outcome. These three elements are chosen, because patients can have multiple scans (or multiple sequences, e.g. in MRI), and each image can be segmented by different readers. As they are not actively used by PyRadiomics, any value is valid, including empty values, as long as they are provided (e.g. ”,,,<path/to/image>,<path/to/mask>” is valid, “<path/to/image>,<path/to/mask>” is not).

I installed PyRadiomics, but when I run the jupyter notebook, I get ImportError: No module named radiomics

This can have two possible causes: 1) When installing PyRadiomics from the repository, your python path variable will be updated to enable python to find the package. However, this value is only updated in commandline windows when they are restarted. If your jupyter notebook was running during installation, you first need to restart it. 2) Multiple versions of python can be installed on your machine simultaneously. Ensure PyRadiomics is installed on the same version you are using in your Jupyter notebook.

When I try to extract features, I get an error stating that image and mask do not occupy the same space.

During extraction, SimpleITK checks whether the mask matches the image dimensions and physical space and raises an error when this is not the case. This is to prevent attempts to extract features from an image using a mask that does not match the image. If it is the correct mask, you can change the tolerance for differences in direction and origin between the image and mask by setting SimpleITK.ProcessObject.SetGlobalDefaultDirectionTolerance and SimpleITK.ProcessObject.SetGlobalDefaultDirectionTolerance, respectively. By default, these are set to 1e-6 mm. Alternatively, you can resample your mask with SimpleITK.ResampleImageFilter(), using the image as a reference image and Nearest Neighbour as interpolator. See the SimpleITK documentation for more information.

I’m missing features from my output. How can I see what went wrong?

If calculation of features or application of filters fails, a warning is logged. If you want to know exactly what happens inside the toolbox, PyRadiomics provides extensive debug logging. You can enable this to be printed to the out, or stored in a separate log file. The output is regulated by radiomics.setVerbosity() and the PyRadiomics logger can be accessed via radiomics.logger. See the examples included in the repository on how to set up logging.

I’m able to extract features, but many are NaN, 0 or 1. What happend?

It is possible that the segmentation was too small to extract a valid texture. Check the value of VoxelNum, which is part of the additional information in the output. This is the number of voxels in the ROI after pre processing and therefore the number of voxels that are used for feature calculation.

Another problem can be that you have to many or too few gray values after discretization. You can check this by comparing the range of gray values in the ROI (a First Order feature) with the value for your binWidth parameter. More bins capture smaller differences in gray values, but too many bins (compared to number of voxels) will yield low probabilities in the texture matrices, resulting in non-informative features. There is no definitive answer for the ideal number of discretized gray values, and this may differ between modalities. One study [1] assessed the number of bins in PET and found that in the range of 16 - 128 bins, texture features did not differ significantly.

Does PyRadiomics support voxel-wise feature extraction (for the generation of colormaps)?

No, currently PyRadiomics only supports lesion-based feature extraction. However, voxel-based feature extraction may be a good addition in the future. If you have thoughts or ideas on how to implement this, we’d welcome your input on the pyradiomics email list.

Miscellaneous

A new version of PyRadiomics is available! Where can I find out what changed?

When a new version is released, a changelog is included in the release statement. Between releases, changes are not explicitly documented, but all significant changes are implemented using pull requests. Check the merged pull request for the latest changes.

I have some ideas for PyRadiomics. How can I contribute?

We welcome suggestions and contributions to PyRadiomics. Check our guidelines to see how you can contribute to PyRadiomics. Signatures and code styles used in PyRadiomics are documented in the Developers section.

I found a bug! Where do I report it?

We strive to keep PyRadiomics as bug free as possible by thoroughly testing new additions before including them in the stable version. However, nothing is perfect, and some bugs may therefore exist. Report yours by opening an issue on the GitHub or contact us at the pyradiomics email list. If you want to help in fixing it, we’d welcome you to open up a pull request with your suggested fix.

My question is not listed here...

If you have a question that is not listed here, check the pyradiomics email list or the issues on GitHub. Feel free to post a new question or issue and we’ll try to get back to you ASAP.

[1]Tixier F, Cheze-Le Rest C, Hatt M, Albarghach NM, Pradier O, Metges J-P, et al. Intratumor Heterogeneity Characterized by Textural Features on Baseline 18F-FDG PET Images Predicts Response to Concomitant Radiochemotherapy in Esophageal Cancer. J Nucl Med. 2011;52:369–78.