Skip to content

Commit

Permalink
Merge pull request #207 from JoostJM/Update-README
Browse files Browse the repository at this point in the history
Update readme
  • Loading branch information
JoostJM authored Feb 22, 2017
2 parents ace3663 + 1b951cf commit 08a3365
Show file tree
Hide file tree
Showing 10 changed files with 371 additions and 383 deletions.
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

[![Travis CI](https://travis-ci.org/Radiomics/pyradiomics.svg?branch=master)](https://travis-ci.org/Radiomics/pyradiomics)

# pyradiomics v1.0
# pyradiomics v1.1.0

## Radiomics feature extraction in Python

Expand Down Expand Up @@ -54,10 +54,14 @@ Furthermore, an instruction video is available [here](http://radiomics.io/pyradi

### Installation

To install this package run the following commands from the root directory:
PyRadiomics is OS independent and compatible with both Python 2.7 and Python >=3.4.
To install this package on unix like systems run the following commands from the root directory:

python -m pip install -r requirements.txt
python setup.py install
sudo python -m pip install -r requirements.txt
sudo python setup.py install

Detailed installation instructions, as well as instructions for installing PyRadiomics on Windows are available in the
[documentation](http://pyradiomics.readthedocs.io/en/latest/installation.html).

### Usage

Expand Down Expand Up @@ -87,7 +91,6 @@ See also the [requirements file](requirements.txt).

### WIP
- Implementation of this package as an [extension](https://github.com/Radiomics/SlicerRadiomics) to [3D Slicer](slicer.org)
- Enhancing performance by implementation of C for computationally expensive code

### License
This package is covered by the [3D Slicer License](LICENSE.txt).
Expand Down
289 changes: 132 additions & 157 deletions bin/Notebooks/PyRadiomics Example.ipynb

Large diffs are not rendered by default.

405 changes: 203 additions & 202 deletions bin/Notebooks/helloFeatureClass.ipynb

Large diffs are not rendered by default.

27 changes: 14 additions & 13 deletions bin/Notebooks/helloRadiomics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -154,25 +154,25 @@
"output_type": "stream",
"text": [
"Enabled input images:\n",
"\toriginal\n"
"\tOriginal\n"
]
}
],
"source": [
"# By default, only 'original' (no filter applied) is enabled. Optionally enable some filters:\n",
"\n",
"# extractor.enableInputImageByName('wavelet')\n",
"# extractor.enableInputImageByName('log', customArgs={'sigma':[3.0]})\n",
"# extractor.enableInputImageByName('square')\n",
"# extractor.enableInputImageByName('squareroot')\n",
"# extractor.enableInputImageByName('exponential')\n",
"# extractor.enableInputImageByName('logarithm')\n",
"# extractor.enableInputImageByName('Wavelet')\n",
"# extractor.enableInputImageByName('LoG', customArgs={'sigma':[3.0]})\n",
"# extractor.enableInputImageByName('Square')\n",
"# extractor.enableInputImageByName('SquareRoot')\n",
"# extractor.enableInputImageByName('Exponential')\n",
"# extractor.enableInputImageByName('Logarithm')\n",
"\n",
"# Alternative; set filters in one operation \n",
"# This updates current enabled input images, i.e. overwrites custom settings. \n",
"# However, input images already enabled, but not passed in this call, are not disabled.\n",
"\n",
"# extractor.enableInputImages(wavelet={}, log={'sigma':[3.0]})\n",
"# extractor.enableInputImages(Wavelet={}, LoG={'sigma':[3.0]})\n",
"\n",
"print(\"Enabled input images:\")\n",
"for imageType in extractor.inputImages.keys():\n",
Expand Down Expand Up @@ -248,6 +248,7 @@
"\n",
" :math:`entropy = -\\displaystyle\\sum^{N_l}_{i=1}{p(i)\\log_2\\big(p(i)+\\epsilon\\big)}`\n",
"\n",
" Here, :math:`\\epsilon` is an arbitrarily small positive number (:math:`\\approx 2.2\\times10^{-16}`).\n",
" Entropy specifies the uncertainty/randomness in the\n",
" image values. It measures the average amount of\n",
" information required to encode the image values.\n",
Expand Down Expand Up @@ -423,12 +424,12 @@
"Calculating features\n",
"\t\tComputing firstorder\n",
"Computed general_info_BoundingBox: (162; 84; 11; 47; 70; 7)\n",
"Computed general_info_GeneralSettings: {'verbose': True; 'binWidth': 25; 'label': 1; 'interpolator': 'sitkBSpline'; 'resampledPixelSpacing': None; 'padDistance': 5}\n",
"Computed general_info_GeneralSettings: {'additionalInfo': True; 'verbose': True; 'binWidth': 25; 'enableCExtensions': True; 'label': 1; 'interpolator': 'sitkBSpline'; 'resampledPixelSpacing': None; 'padDistance': 5}\n",
"Computed general_info_ImageHash: 5c9ce3ca174f0f8324aa4d277e0fef82dc5ac566\n",
"Computed general_info_ImageSpacing: (0.7812499999999999; 0.7812499999999999; 6.499999999999998)\n",
"Computed general_info_InputImages: {'original': {}}\n",
"Computed general_info_InputImages: {'Original': {}}\n",
"Computed general_info_MaskHash: 9dc2c3137b31fd872997d92c9a92d5178126d9d3\n",
"Computed general_info_Version: v1.0.post11.dev0+g610dffc\n",
"Computed general_info_Version: v1.0.1.post69.dev0+gc00bfe2\n",
"Computed general_info_VolumeNum: 2\n",
"Computed general_info_VoxelNum: 4137\n",
"Computed original_firstorder_InterquartileRange: 253.0\n",
Expand Down Expand Up @@ -471,7 +472,7 @@
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
"version": 2.0
},
"file_extension": ".py",
"mimetype": "text/x-python",
Expand All @@ -483,4 +484,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}
3 changes: 2 additions & 1 deletion bin/batchExamples/batchprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,13 @@ def main():
kwargs['resampledPixelSpacing'] = None # [3,3,3]
kwargs['interpolator'] = sitk.sitkBSpline
kwargs['verbose'] = True
kwargs['enableCExtensions'] = False

logging.info('pyradiomics version: %s', radiomics.__version__)
logging.info('Extracting features with kwarg settings: %s', str(kwargs))

extractor = featureextractor.RadiomicsFeaturesExtractor(**kwargs)
extractor.enableInputImages(original={})
extractor.enableInputImages(Original={})
# extractor.enableInputImages(wavelet= {'level': 2})
for idx, entry in enumerate(flists, start=1):

Expand Down
4 changes: 2 additions & 2 deletions bin/helloFeatureClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
#
if applyLog:
sigmaValues = numpy.arange(5., 0., -.5)[::1]
for logImage, inputImageName, inputKwargs in imageoperations.applyFilterLoG(image, sigma=sigmaValues, verbose=True):
for logImage, inputImageName, inputKwargs in imageoperations.getLoGImage(image, sigma=sigmaValues, verbose=True):
logFirstorderFeatures = firstorder.RadiomicsFirstOrder(logImage, mask, **inputKwargs)
logFirstorderFeatures.enableAllFeatures()
logFirstorderFeatures.calculateFeatures()
Expand All @@ -160,7 +160,7 @@
# Show FirstOrder features, calculated on a wavelet filtered image
#
if applyWavelet:
for decompositionImage, decompositionName, inputKwargs in imageoperations.applyFilterWavelet(image):
for decompositionImage, decompositionName, inputKwargs in imageoperations.getWaveletImage(image):
waveletFirstOrderFeaturs = firstorder.RadiomicsFirstOrder(decompositionImage, mask, **inputKwargs)
waveletFirstOrderFeaturs.enableAllFeatures()
waveletFirstOrderFeaturs.calculateFeatures()
Expand Down
7 changes: 5 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,20 @@ Joost J.M. van Griethuysen et al, “Computational Radiomics System to Decode th
Installation
------------

PyRadiomics is OS independent and compatible with both Python 2.7 and Python >=3.4.

* Clone the repository

* ``git clone git://github.com/Radiomics/pyradiomics``

* Install on your system, with prerequisites:
* Install on your system (Linux, Mac OSX), with prerequisites:

* ``cd pyradiomics``
* ``sudo python -m pip install -r requirements.txt``
* ``sudo python setup.py install``

* For more detailed installation instructions see :ref:`Installation Details<installation-label>`
* For more detailed installation instructions and installation on Windows see
:ref:`Installation Details<installation-label>`

.. toctree::
:maxdepth: 2
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Get the code

* Ensure you have the version control system ``git`` installed on your machine.

* Ensure that you have ``python`` installed on your machine, at least version 2.7.
* Ensure that you have ``python`` installed on your machine, at least version 2.7 or 3.4.

* Clone the repository:

Expand Down
2 changes: 2 additions & 0 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ Interactive Use
* Import the necessary classes::

from radiomics import featureextractor
import six
import sys, os

* Set up a pyradiomics directory variable::
Expand Down Expand Up @@ -153,6 +154,7 @@ Using feature classes directly

from radiomics import firstorder, glcm, imageoperations, shape, glrlm, glszm
import SimpleITK as sitk
import six
import sys, os

* Set up a data directory variable::
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ def run_tests(self):
'Programming Language :: C',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Topic :: Scientific/Engineering :: Bio-Informatics',
],

Expand Down

0 comments on commit 08a3365

Please sign in to comment.