Skip to content

Commit

Permalink
Merge pull request #27 from MStarmans91/development
Browse files Browse the repository at this point in the history
Release 3.2.0
  • Loading branch information
MStarmans91 authored Jun 26, 2020
2 parents 1bc3fab + ade8e7d commit cea5939
Show file tree
Hide file tree
Showing 134 changed files with 1,601 additions and 784 deletions.
48 changes: 15 additions & 33 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,47 +20,29 @@ matrix:
- PATH=/c/Python37:/c/Python37/Scripts:$PATH
- WORCDEBUG=true
install:
- python setup.py -q install
- git clone --single-branch --branch develop https://github.com/MStarmans91/WORCTutorial
- python setup.py -q install
- git clone --single-branch --branch develop https://github.com/MStarmans91/WORCTutorial
# 'python' points to Python 2.7 on macOS but points to Python 3.8 on Linux and Windows
# 'python3' is a 'command not found' error on Windows but 'py' works on Windows only.
script: python WORCTutorial/WORCTutorialSimple.py
script:
- python WORCTutorial/WORCTutorialSimple.py
- name: "Linux"
before_install:
- sudo apt-get -qq update
- sudo apt-get -qq -y install git
- pip install numpy # Not doing so may give issues with PyRadiomics, as it depends on numpy upon installation
- pip install -r requirements.txt
- sudo apt-get -qq update
- sudo apt-get -qq -y install git
- pip install numpy # Not doing so may give issues with PyRadiomics, as it depends on numpy upon installation
- pip install -r requirements.txt
env:
- WORCDEBUG=true
install:
- python setup.py -q install
- git clone --single-branch --branch develop https://github.com/MStarmans91/WORCTutorial
# 'python' points to Python 2.7 on macOS but points to Python 3.8 on Linux and Windows
# 'python3' is a 'command not found' error on Windows but 'py' works on Windows only.
- python setup.py -q install
- git clone --single-branch --branch develop https://github.com/MStarmans91/WORCTutorial
# 'python' points to Python 2.7 on macOS but points to Python 3.8 on Linux and Windows
# 'python3' is a 'command not found' error on Windows but 'py' works on Windows only.
script:
- python WORCTutorial/WORCTutorialSimple.py
- fastr trace /tmp/WORC_Example_STWStrategyHN/__sink_data__.json --sinks features_train_CT_0_predict --samples HN1331
- fastr trace /tmp/WORC_Example_STWStrategyHN/__sink_data__.json --sinks features_train_CT_0_pyradiomics --samples HN1331
- fastr trace /tmp/WORC_Example_STWStrategyHN/__sink_data__.json --sinks classification --samples all
# - name: "MacOS"
# os: osx
# osx_image: xcode11.2 # Python 3.7.4 running on macOS 10.14.4
# language: shell
# before_install:
# - python3 --version
# - pip3 install -U pip
# - pip3 install numpy # Not doing so may give issues with PyRadiomics, as it depends on numpy upon installation
# env:
# - WORCDEBUG=true
# install:
# - python3 setup.py -q install
# - git clone --single-branch --branch develop https://github.com/MStarmans91/WORCTutorial
# # 'python' points to Python 2.7 on macOS but points to Python 3.8 on Linux and Windows
# # 'python3' is a 'command not found' error on Windows but 'py' works on Windows only.
# script:
# - python3 WORCTutorial/WORCTutorialSimple.py
# - fastr trace /var/folders/17/5mc7816d3mndxjqgplq6057w0000gn/T/WORC_Example_STWStrategyHN4/__sink_data__.json --sinks features_train_CT_0 --samples HN1331
- python WORCTutorial/WORCTutorialSimple.py
- fastr trace /tmp/WORC_Example_STWStrategyHN/__sink_data__.json --sinks features_train_CT_0_predict --samples HN1331
- fastr trace /tmp/WORC_Example_STWStrategyHN/__sink_data__.json --sinks classification --samples all

notifications:
slack:
Expand Down
31 changes: 29 additions & 2 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,40 @@ All notable changes to this project will be documented in this file.
The format is based on `Keep a Changelog <http://keepachangelog.com/>`_
and this project adheres to `Semantic Versioning <http://semver.org/>`_

3.1.4 - 2020-05-22
3.2.0 - 2020-06-26
------------------

Added
~~~~~~~
- Labelprocessing can now also handle having patient ID in the feature files.
Was required for ComBat.

Changed
~~~~~~~
- Output of plot_SVM function is better ordered.
- Several defaults, as we now have PyRadiomics fully embedded, resulting in
a large increase in features.
- No more overrides for the full config, as the default now is the full config.

Fixed
~~~~~
- Cardinality of decomposition tool was incorrect.
- ComBat integration in WORC network now works properly.
- Documentation didn't build due to C-extension dependencies of PyRadiomics,
and thus therefore also PREDICT. Fixed in setup.py and readthedocs files.
- Documentation building.
- Bugfix in segmentix test output url.
- Bugfix in SimpleWORC facade when using features.
- Warning when using Evaluation pipeline without images.


3.1.4 - 2020-05-26
------------------

Added
~~~~~~~
- Catch error if number of segmentations supplied does not match number of
images.
images.
- Add support in SimpleWORC and BasicWORC for multiple segmentations per
patient.
- Chi2 test in statistical testing.
Expand Down
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# WORC v3.1.4
# WORC v3.2.0
## Workflow for Optimal Radiomics Classification

## Information

| Linux | Windows | Documentation | PyPi |
|--------------------------------|-------------------------------|-------------------------------|-------------------------------|
| [![][tci-linx]][tci-linx-lnk] | [![][tci-wind]][tci-wind-lnk] | [![][doc]][doc-lnk] | [![][pypi]][pypi-lnk] |
| Linux | Windows | Documentation | PyPi |Citing WORC |
|--------------------------------|-------------------------------|-------------------------------|-------------------------------|---------------------|
| [![][tci-linx]][tci-linx-lnk] | [![][tci-wind]][tci-wind-lnk] | [![][doc]][doc-lnk] | [![][pypi]][pypi-lnk] | [![][DOI]][DOI-lnk] |

[tci-linx]: https://travis-ci.com/MStarmans91/WORC.svg?token=qyvaeq7Cpwu7hJGB98Gp&branch=master&job=1
[tci-linx-lnk]: https://travis-ci.com/MStarmans91/WORC
Expand All @@ -19,6 +19,9 @@
[pypi]: https://badge.fury.io/py/WORC.svg
[pypi-lnk]: https://badge.fury.io/py/WORC

[DOI]: https://zenodo.org/badge/DOI/10.5281/zenodo.3840534.svg
[DOI-lnk]: https://zenodo.org/badge/latestdoi/92295542

# Introduction

WORC is an open-source python package for the easy execution of full radiomics pipelines.
Expand Down Expand Up @@ -84,7 +87,7 @@ Besides a Jupyter notebook with instructions, we provide there also an example s
## License
This package is covered by the open source [APACHE 2.0 License](APACHE-LICENSE-2.0).

When using WORC, please cite this repository using the following DOI: [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3840534.svg)](https://zenodo.org/badge/latestdoi/92295542)
When using WORC, please cite this repository using the following DOI: [![][DOI]][DOI-lnk].

## Contact
We are happy to help you with any questions. Please sent us a mail or place an issue on the Github.
Expand Down
20 changes: 13 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
WORC v3.1.4
WORC v3.2.0
===========

Workflow for Optimal Radiomics Classification
Expand All @@ -7,11 +7,12 @@ Workflow for Optimal Radiomics Classification
Information
-----------

+--------------------+-------------------+-------------------+-------------------+
| Linux | Windows | Documentation | PyPi |
+====================+===================+===================+===================+
| |image0| | |image1| | |image2| | |image3| |
+--------------------+-------------------+-------------------+-------------------+
+-----------------+-----------------+-----------------+-----------------+------------+
| Linux | Windows | Documentation | PyPi | Citing |
| | | | | WORC |
+=================+=================+=================+=================+============+
| |image0| | |image1| | |image2| | |image3| | |image4| |
+-----------------+-----------------+-----------------+-----------------+------------+

Introduction
============
Expand Down Expand Up @@ -114,7 +115,8 @@ License
This package is covered by the open source `APACHE 2.0
License <APACHE-LICENSE-2.0>`__.

When using WORC, please cite this repository.
When using WORC, please cite this repository using the following DOI:
|image5|.

Contact
-------
Expand Down Expand Up @@ -183,3 +185,7 @@ to input them on every request.
:target: https://worc.readthedocs.io/en/latest/?badge=latest
.. |image3| image:: https://badge.fury.io/py/WORC.svg
:target: https://badge.fury.io/py/WORC
.. |image4| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3840534.svg
:target: https://zenodo.org/badge/latestdoi/92295542
.. |image5| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3840534.svg
:target: https://zenodo.org/badge/latestdoi/92295542
48 changes: 43 additions & 5 deletions WORC/IOparser/file_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def load_data(featurefiles, patientinfo=None, label_names=None, modnames=[]):
# Read out all feature values and labels
image_features_temp = list()
feature_labels_all = list()
pids = list()
for i_patient in range(0, len(featurefiles[0])):
feature_values_temp = list()
feature_labels_temp = list()
Expand All @@ -67,6 +68,19 @@ def load_data(featurefiles, patientinfo=None, label_names=None, modnames=[]):
# Also make a list of all unique label names
feature_labels_all = feature_labels_all + list(set(feature_labels_temp) - set(feature_labels_all))

# If PID in feature file, use those
if 'patient' in list(feat_temp.keys()):
pids.append(feat_temp.patient)

# Check when we found patient ID's, if we did for all objects
if pids:
if len(pids) != len(image_features_temp):
raise WORCexceptions.WORCValueError(f'Length of pids {len(pids)}' +
'does not match' +
'number of objects ' +
str(len(image_features_temp)) +
f'Found {pids}.')

# If some objects miss certain features, we will identify these with NaN values
feature_labels_all.sort()
image_features = list()
Expand All @@ -90,11 +104,18 @@ def load_data(featurefiles, patientinfo=None, label_names=None, modnames=[]):
# We use the feature files of the first modality to match to patient name
pfiles = featurefiles[0]
try:
label_data, image_features =\
lp.findlabeldata(patientinfo,
label_names,
pfiles,
image_features)
if pids:
label_data, image_features =\
lp.findlabeldata(patientinfo,
label_names,
pids=pids,
objects=image_features)
else:
label_data, image_features =\
lp.findlabeldata(patientinfo,
label_names,
filenames=pfiles,
objects=image_features)
except ValueError as e:
message = str(e) + '. Please take a look at your labels' +\
' file and make sure it is formatted correctly. ' +\
Expand Down Expand Up @@ -178,6 +199,7 @@ def convert_config_pyradiomics(config):
outputconfig = dict()
outputconfig['imageType'] = dict()
outputconfig['setting'] = dict()
outputconfig['featureClass'] = dict()

# Take out the specific PyRadiomics values
outputconfig['setting']['geometryTolerance'] = float(config['PyRadiomics']['geometryTolerance'])
Expand Down Expand Up @@ -230,4 +252,20 @@ def convert_config_pyradiomics(config):
sigmas = [int(s) for s in sigmas]
outputconfig['imageType']['LoG']['sigma'] = sigmas

# Determine which features to extract:
if config['PyRadiomics']['extract_firstorder'] == 'True':
outputconfig['featureClass']['firstorder'] = None
if config['PyRadiomics']['extract_shape'] == 'True':
outputconfig['featureClass']['shape'] = None
if config['PyRadiomics']['texture_GLCM'] == 'True':
outputconfig['featureClass']['glcm'] = None
if config['PyRadiomics']['texture_GLRLM'] == 'True':
outputconfig['featureClass']['glrlm'] = None
if config['PyRadiomics']['texture_GLSZM'] == 'True':
outputconfig['featureClass']['glszm'] = None
if config['PyRadiomics']['texture_GLDM'] == 'True':
outputconfig['featureClass']['gldm'] = None
if config['PyRadiomics']['texture_NGTDM'] == 'True':
outputconfig['featureClass']['ngtdm'] = None

return outputconfig
Loading

0 comments on commit cea5939

Please sign in to comment.