Skip to content

Commit 00e9e5d

Browse files
authored
Merge pull request #185 from JoostJM/references
Update documentation
2 parents 7b0d14b + c4c1b06 commit 00e9e5d

17 files changed

+511
-549
lines changed

README.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ Aside from the feature classes, there are also some built-in optional filters:
3131
- Logarithm
3232
- Exponential
3333

34-
Most of the provided features and filters are based on methods described in the following publications:
35-
36-
HJWL Aerts, ER Velazquez, RTH Leijenaar, et al., "Decoding tumour phenotype by noninvasive imaging using a quantitative radiomics approach", vol. 5, Nat Communication, 2014. Available [here](http://www.nature.com/ncomms/2014/140603/ncomms5006/full/ncomms5006.html).
37-
38-
Specifically, the formulation of the individual feature calculation is covered in this [supplement](http://www.nature.com/ncomms/2014/140603/ncomms5006/extref/ncomms5006-s1.pdf)
39-
4034
### Supporting reproducible extraction
4135
Aside from calculating features, the pyradiomics package includes provenance information in the
4236
output. This information contains information on used image and mask, as well as applied settings
@@ -59,6 +53,14 @@ To install this package run the following commands from the root directory:
5953
python -m pip install -r requirements.txt
6054
python setup.py install
6155

56+
### Usage
57+
58+
PyRadiomics can be easily used in a Python script through the `featureextractor`
59+
module. Furthermore, PyRadiomics provides two commandline scripts, `pyradiomics`
60+
and `pyradiomicsbatch`, for single image extraction and batchprocessing, respectively.
61+
Finally, a convenient front-end interface is provided as the 'Radiomics'
62+
extension for 3D Slicer, available [here](https://github.com/Radiomics/SlicerRadiomics).
63+
6264
### Citation
6365
If you publish any work which uses this package, please cite the following publication:
6466

@@ -102,3 +104,14 @@ This package is covered by the [3D Slicer License](LICENSE.txt).
102104
<sup>4</sup>GROW-School for Oncology and Developmental Biology, Maastricht University Medical Center, Maastricht, The Netherlands,
103105
<sup>5</sup>Kitware,
104106
<sup>6</sup>Isomics
107+
108+
### General references
109+
110+
- HJWL Aerts, ER Velazquez, RTH Leijenaar, et al., "Decoding tumour phenotype by noninvasive imaging using a
111+
quantitative radiomics approach", vol. 5, Nat Communication, 2014.
112+
Available [here](http://www.nature.com/ncomms/2014/140603/ncomms5006/full/ncomms5006.html).
113+
Specifically, the formulation of the individual feature calculation is covered in this
114+
[supplement](http://www.nature.com/ncomms/2014/140603/ncomms5006/extref/ncomms5006-s1.pdf).
115+
- Zwanenburg A, Leger S, Vallières M, Löck S., "Image biomarker standardisation initiative - feature definitions",
116+
arXiv:161207003. 2016. Available [here](http://arxiv.org/abs/1612.07003).
117+

bin/Notebooks/helloFeatureClass.ipynb

Lines changed: 162 additions & 206 deletions
Large diffs are not rendered by default.

bin/Notebooks/helloRadiomics.ipynb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,10 @@
2525
"outputs": [],
2626
"source": [
2727
"import sys\n",
28-
"stdout = sys.stdout # This workaround is needed, as pykwalify reloads the sys package, resetting the stdout\n",
29-
"stderr = sys.stderr\n",
30-
"\n",
3128
"import os\n",
3229
"import logging\n",
3330
"from radiomics import featureextractor\n",
34-
"import radiomics\n",
35-
"\n",
36-
"sys.stdout = stdout # Force the output back to the jupyter console\n",
37-
"sys.stderr = stderr"
31+
"import radiomics"
3832
]
3933
},
4034
{

bin/Params.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ setting:
2828
# Input images to use: original for unfiltered image and/or any other filters, see documentation of featureextractor.py
2929
# for possible values
3030
inputImage:
31-
original: {} # for dictionaries / mappings, None values are not allowed, '{}' is interpreted as an empty dictionary
31+
Original: {} # for dictionaries / mappings, None values are not allowed, '{}' is interpreted as an empty dictionary
3232

3333
# Featureclasses, from which features must be calculated. If a featureclass is not mentioned, no features are calculated
3434
# for that class. Otherwise, the specified features are calculated, or, if none are specified, all are calculated.

bin/helloFeatureClass.py

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
if kwargs['interpolator'] != None and kwargs['resampledPixelSpacing'] != None:
4040
image, mask = imageoperations.resampleImage(image, mask, kwargs['resampledPixelSpacing'], kwargs['interpolator'])
4141
else:
42-
image, mask = imageoperations.cropToTumorMask(image, mask)
42+
image, mask, bb = imageoperations.cropToTumorMask(image, mask)
4343

4444
#
4545
# Show the first order feature calculations
@@ -143,35 +143,22 @@
143143
#
144144
if applyLog:
145145
sigmaValues = numpy.arange(5., 0., -.5)[::1]
146-
for sigma in sigmaValues:
147-
logImage = imageoperations.applyLoG(image, sigmaValue=sigma)
148-
logFirstorderFeatures = firstorder.RadiomicsFirstOrder(logImage, mask, **kwargs)
146+
for logImage, inputImageName, inputKwargs in imageoperations.applyFilterLoG(image, sigma=sigmaValues, verbose=True):
147+
logFirstorderFeatures = firstorder.RadiomicsFirstOrder(logImage, mask, **inputKwargs)
149148
logFirstorderFeatures.enableAllFeatures()
150149
logFirstorderFeatures.calculateFeatures()
151-
print 'Calculated firstorder features with LoG sigma ', sigma
152150
for (key, val) in logFirstorderFeatures.featureValues.iteritems():
153-
laplacianFeatureName = 'LoG-sigma-%s_%s' % (str(sigma), key)
151+
laplacianFeatureName = '%s_%s' % (inputImageName, key)
154152
print ' ', laplacianFeatureName, ':', val
155153
#
156154
# Show FirstOrder features, calculated on a wavelet filtered image
157155
#
158156
if applyWavelet:
159-
ret, approx = imageoperations.swt3(image)
160-
161-
for idx, wl in enumerate(ret, start=1):
162-
for decompositionName, decompositionImage in wl.items():
163-
waveletFirstOrderFeaturs = firstorder.RadiomicsFirstOrder(decompositionImage, mask, **kwargs)
164-
waveletFirstOrderFeaturs.enableAllFeatures()
165-
waveletFirstOrderFeaturs.calculateFeatures()
166-
print 'Calculated firstorder features with wavelet ', decompositionName
167-
for (key, val) in waveletFirstOrderFeaturs.featureValues.iteritems():
168-
waveletFeatureName = 'wavelet-%s_%s' % (str(decompositionName), key)
169-
print ' ', waveletFeatureName, ':', val
170-
171-
waveletFirstOrderFeaturs = firstorder.RadiomicsFirstOrder(approx, mask, **kwargs)
172-
waveletFirstOrderFeaturs.enableAllFeatures()
173-
waveletFirstOrderFeaturs.calculateFeatures()
174-
print 'Calculated firstorder features with approximation of wavelt (= LLL decomposition)'
175-
for (key, val) in waveletFirstOrderFeaturs.featureValues.iteritems():
176-
waveletFeatureName = 'wavelet-LLL_%s' % (key)
177-
print ' ', waveletFeatureName, ':', val
157+
for decompositionImage, decompositionName, inputKwargs in imageoperations.applyFilterWavelet(image):
158+
waveletFirstOrderFeaturs = firstorder.RadiomicsFirstOrder(decompositionImage, mask, **inputKwargs)
159+
waveletFirstOrderFeaturs.enableAllFeatures()
160+
waveletFirstOrderFeaturs.calculateFeatures()
161+
print 'Calculated firstorder features with wavelet ', decompositionName
162+
for (key, val) in waveletFirstOrderFeaturs.featureValues.iteritems():
163+
waveletFeatureName = 'wavelet-%s_%s' % (str(decompositionName), key)
164+
print ' ', waveletFeatureName, ':', val

bin/helloRadiomics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
extractor = featureextractor.RadiomicsFeaturesExtractor(**kwargs)
2929

3030
# By default, only original is enabled. Optionally enable some filters:
31-
# extractor.enableInputImages(original={}, log={}, wavelet={})
31+
# extractor.enableInputImages(Original={}, LoG={}, Wavelet={})
3232

3333
# Disable all classes except firstorder
3434
extractor.disableAllFeatures()

data/paramSchema.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ mapping:
6464
inputImage:
6565
type: map
6666
mapping:
67-
# possible image filters, it's value be adictionary that follows the rules in setting
68-
original: *settings
69-
log: *settings
70-
wavelet: *settings
71-
square: *settings
72-
squareroot: *settings
73-
logarithm: *settings
74-
exponential: *settings
67+
# possible image filters, it's value is a dictionary that follows the rules in setting
68+
Original: *settings
69+
LoG: *settings
70+
Wavelet: *settings
71+
Square: *settings
72+
SquareRoot: *settings
73+
Logarithm: *settings
74+
Exponential: *settings

docs/index.rst

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@ Aside from the feature classes, there are also some built-in optional filters:
3636
* Logarithm
3737
* Exponential
3838

39-
Most of the provided features and filters are based on methods described in the following publications:
40-
41-
HJWL Aerts, ER Velazquez, RTH Leijenaar, et al., "Decoding tumour phenotype by noninvasive imaging using a quantitative radiomics approach", vol. 5, Nat Communication, 2014. Available `here <http://www.nature.com/ncomms/2014/140603/ncomms5006/full/ncomms5006.html>`_.
42-
43-
Specifically, the formulation of the individual feature calculation is covered in this `supplement <http://www.nature.com/ncomms/2014/140603/ncomms5006/extref/ncomms5006-s1.pdf>`_
44-
45-
4639
Supporting reproducible extraction
4740
----------------------------------
4841

@@ -124,3 +117,13 @@ Developers
124117
:sup:`4`\ GROW-School for Oncology and Developmental Biology, Maastricht University Medical Center, Maastricht, The Netherlands,
125118
:sup:`5`\ Kitware,
126119
:sup:`6`\ Isomics
120+
121+
General references
122+
------------------
123+
* HJWL Aerts, ER Velazquez, RTH Leijenaar, et al., "Decoding tumour phenotype by noninvasive imaging using a
124+
quantitative radiomics approach", vol. 5, Nat Communication, 2014.
125+
Available `here <http://www.nature.com/ncomms/2014/140603/ncomms5006/full/ncomms5006.html>`_.
126+
Specifically, the formulation of the individual feature calculation is covered in this
127+
`supplement <http://www.nature.com/ncomms/2014/140603/ncomms5006/extref/ncomms5006-s1.pdf>`_.
128+
* Zwanenburg A, Leger S, Vallières M, Löck S., "Image biomarker standardisation initiative - feature definitions",
129+
arXiv:161207003. 2016. Available `here <http://arxiv.org/abs/1612.07003>`_.

docs/installation.rst

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,17 @@ Installation on your system
2323
* For unix like systems (MacOSX, linux):
2424

2525
* ``cd pyradiomics``
26+
* ``sudo python -m pip install -r requirements.txt``
2627
* ``sudo python setup.py install``
2728

28-
* If you don't have sudo/admin rights on your machine, you need to locally install numpy, nose, tqdm, PyWavelets, SimpleITK. In a bash shell::
29+
* If you don't have sudo/admin rights on your machine, you need to locally install numpy, nose, tqdm, PyWavelets, SimpleITK (specified in requirements.txt). In a bash shell::
2930

3031
pip install --user --upgrade pip
3132
export PATH=$HOME/.local/bin:$PATH
32-
pip install --user numpy
33-
pip install --user nose
34-
pip install --user nose-parameterized
35-
pip install --user tqdm
33+
pip install --user -r requirements.txt
3634
export PYTHONPATH=$HOME/.local/lib64/python2.7/site-packages
37-
git clone https://github.com/nigma/pywt.git && cd pywt && python setup.py install --prefix=$HOME/.local && cd ..
38-
pip install --user SimpleITK
3935

40-
* If the installation of SimpleITK fails (newer versions not available on the default servers, you can get it manually from `sourceforge <https://sourceforge.net/projects/simpleitk/files/SimpleITK/>`_
36+
* If the installation of SimpleITK fails (newer versions not available on the default servers), you can get it manually from `sourceforge <https://sourceforge.net/projects/simpleitk/files/SimpleITK/>`_
4137

4238
* For linux::
4339

@@ -48,3 +44,13 @@ Installation on your system
4844

4945
wget 'https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.10.0/Python/SimpleITK-0.10.0-cp27-cp27m-macosx_10_6_intel.whl'
5046
pip install --user 'SimpleITK-0.10.0-cp27-cp27m-macosx_10_6_intel.whl'
47+
48+
* For Windows:
49+
50+
* ``cd pyradiomics``
51+
* ``python -m pip install -r requirements.txt``
52+
* ``python setup.py install``
53+
54+
* If the installation of SimpleITK fails (newer versions not available on the default servers), you can install it manually::
55+
56+
pip install --trusted-host www.simpleitk.org -f https://sourceforge.net/projects/simpleitk/files/SimpleITK/0.10.0/Python/ SimpleITK==0.10.0

docs/usage.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ Interactive Use
8787

8888
* See the :ref:`feature extractor class<radiomics-featureextractor-label>` for more information on using this core class.
8989

90+
------------------------
91+
PyRadiomics in 3D Slicer
92+
------------------------
93+
94+
A convenient front-end interface is provided as the 'Radiomics' extension for 3D Slicer. It is available
95+
`here <https://github.com/Radiomics/SlicerRadiomics>`_.
96+
9097
------------------------------
9198
Using feature classes directly
9299
------------------------------

0 commit comments

Comments
 (0)