Skip to content

Commit

Permalink
ENH: Add CI.
Browse files Browse the repository at this point in the history
- Add `*.yml` configuration files for CI.
- Add Python wrapping files.
- Update the `README.rst` file to reflect the CI status and Python
  installation steps.
- Modify the current `CTestConfig.cmake` file to make the build results be
  sent to the **Insight** project in **open.cdash.org**.
  • Loading branch information
jhlegarreta committed Oct 13, 2018
1 parent 459d226 commit 2cd3cf4
Show file tree
Hide file tree
Showing 50 changed files with 463 additions and 39 deletions.
63 changes: 63 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
version: 2
jobs:
build-and-test:
working_directory: /LesionSizingToolkit-build
docker:
- image: insighttoolkit/module-ci:latest
steps:
- checkout:
path: /LesionSizingToolkit
- run:
name: Fetch CTest driver script
command: |
curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITK/dashboard/itk_common.cmake -O
- run:
name: Configure CTest script
command: |
SHASNIP=$(echo $CIRCLE_SHA1 | cut -c1-7)
cat > dashboard.cmake << EOF
set(CTEST_SITE "CircleCI")
set(CTEST_BUILD_NAME "External-LesionSizingToolkit-${CIRCLE_BRANCH}-${CIRCLE_BUILD_NUM}-${SHASNIP}")
set(CTEST_BUILD_CONFIGURATION "MinSizeRel")
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
set(CTEST_BUILD_FLAGS: "-j5")
set(CTEST_SOURCE_DIRECTORY /LesionSizingToolkit)
set(CTEST_BINARY_DIRECTORY /LesionSizingToolkit-build)
set(dashboard_model Experimental)
set(dashboard_no_clean 1)
set(dashboard_cache "
ITK_DIR:PATH=/ITK-build
BUILD_TESTING:BOOL=ON
")
include(\${CTEST_SCRIPT_DIRECTORY}/itk_common.cmake)
EOF
- run:
name: Build and Test
no_output_timeout: 1.0h
command: |
ctest -j 2 -VV -S dashboard.cmake
package:
working_directory: ~/LesionSizingToolkit
machine: true
steps:
- checkout
- run:
name: Fetch build script
command: |
curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O
chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh
- run:
name: Build Python packages
no_output_timeout: 1.0h
command: |
./dockcross-manylinux-download-cache-and-build-module-wheels.sh
- store_artifacts:
path: dist
destination: dist

workflows:
version: 2
build-test-package:
jobs:
- build-and-test
- package
15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
sudo: true
language: cpp
os:
- osx
compiler:
- gcc
cache:
directories:
- "$HOME/Library/Caches/Homebrew"
script:
- curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O
- chmod u+x macpython-download-cache-and-build-module-wheels.sh
- ./macpython-download-cache-and-build-module-wheels.sh
- tar -zcvf dist.tar.gz dist/
- curl --upload-file dist.tar.gz https://transfer.sh/dist.tar.gz
14 changes: 4 additions & 10 deletions CTestConfig.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
## This file should be placed in the root directory of your project.
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
## # The following are required to uses Dart and the Cdash dashboard
## ENABLE_TESTING()
## INCLUDE(CTest)
set(CTEST_PROJECT_NAME "LesionSizing")
set(CTEST_NIGHTLY_START_TIME "2:00:00 UTC")
set(CTEST_PROJECT_NAME "ITK")
set(CTEST_NIGHTLY_START_TIME "1:00:00 UTC")

set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "my.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=LesionSizingToolkit")
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=Insight")
set(CTEST_DROP_SITE_CDASH TRUE)
27 changes: 27 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
The Lesion Sizing Toolkit (LSTK)
================================

.. |CircleCI| image:: https://circleci.com/gh/InsightSoftwareConsortium/LesionSizingToolkit.svg?style=shield
:target: https://circleci.com/gh/InsightSoftwareConsortium/LesionSizingToolkit

.. |TravisCI| image:: https://travis-ci.org/InsightSoftwareConsortium/LesionSizingToolkit.svg?branch=master
:target: https://travis-ci.org/InsightSoftwareConsortium/LesionSizingToolkit

.. |AppVeyor| image:: https://img.shields.io/appveyor/ci/InsightSoftwareConsortium/lesionsizingtoolkit.svg
:target: https://ci.appveyor.com/project/InsightSoftwareConsortium/lesionsizingtoolkit

=========== =========== ===========
Linux macOS Windows
=========== =========== ===========
|CircleCI| |TravisCI| |AppVeyor|
=========== =========== ===========

Overview
--------

Expand All @@ -17,6 +32,18 @@ For more information, see the `Insight Journal article <http://hdl.handle.net/10
http://hdl.handle.net/10380/3369
http://www.insight-journal.org/browse/publication/869

Installation
------------

Python
^^^^^^

Binary `Python packages <https://pypi.python.org/pypi/itk-lesionsizingtoolkit>`_
are available for Linux, macOS, and Windows. They can be installed with::

python -m pip install --upgrade pip
python -m pip install itk-lesionsizingtoolkit

Data
----
The project has extensively used the CT lesion data assembled by NIST for the
Expand Down
21 changes: 21 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
branches:
only:
- master

version: "0.0.1.{build}"

install:

- curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/windows-download-cache-and-build-module-wheels.ps1 -O
- ps: .\windows-download-cache-and-build-module-wheels.ps1

build: off

test: off

artifacts:

# pushing entire folder as a zip archive
- path: dist\*

deploy: off
64 changes: 35 additions & 29 deletions itk-module.cmake
Original file line number Diff line number Diff line change
@@ -1,32 +1,38 @@
set(DOCUMENTATION "This module contains a collection of classes for performing
measurement of lesions. Its clinical motivation is the study of cancerous lung
lesions. However, the functionalities developed here are usable in a wider
range of applications. The Lesion Sizing Toolkit is built upon ITK and adds to
it specific classes for computing image features that are then combined into a
detection and measurement layer.")
# the top-level README is used for describing this module, just
# re-used it for documentation here
get_filename_component(MY_CURRENT_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
file(READ "${MY_CURRENT_DIR}/README.rst" DOCUMENTATION)

# itk_module() defines the module dependencies in LesionSizingToolkit
# The testing module in LesionSizingToolkit depends on ITKTestKernel
# By convention those modules outside of ITK are not prefixed with
# ITK.

# define the dependencies of the include module and the tests
itk_module(LesionSizingToolkit
DEPENDS
ITKImageFeature
ITKLevelSets
ITKStatistics
ITKIOSpatialObjects
ITKRegionGrowing
ITKLabelVoting
ITKMathematicalMorphology
ITKIOBruker
ITKIOGDCM
ITKIOMeta
ITKIOMINC
ITKIOGE
ITKIOBioRad
ITKIOHDF5
ITKIOLSM
ITKIOMRC
ITKIOStimulate
ITKVtkGlue
ITKTestKernel #to handle IO in src
EXCLUDE_FROM_DEFAULT
DESCRIPTION
"${DOCUMENTATION}"
DEPENDS
ITKImageFeature
ITKLevelSets
ITKStatistics
ITKIOSpatialObjects
ITKRegionGrowing
ITKLabelVoting
ITKMathematicalMorphology
ITKIOBruker
ITKIOGDCM
ITKIOMeta
ITKIOMINC
ITKIOGE
ITKIOBioRad
ITKIOHDF5
ITKIOLSM
ITKIOMRC
ITKIOStimulate
ITKVtkGlue
ITKTestKernel #to handle IO in src
TEST_DEPENDS
ITKTestKernel
EXCLUDE_FROM_DEFAULT
DESCRIPTION
"${DOCUMENTATION}"
)
56 changes: 56 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# -*- coding: utf-8 -*-
from __future__ import print_function
from os import sys

try:
from skbuild import setup
except ImportError:
print('scikit-build is required to build from source.', file=sys.stderr)
print('Please run:', file=sys.stderr)
print('', file=sys.stderr)
print(' python -m pip install scikit-build')
sys.exit(1)

setup(
name='lesionsizingtoolkit',
version='0.0.1',
author='Xiao Xiao Liu',
author_email='[email protected]',
packages=['itk'],
package_dir={'itk': 'itk'},
download_url=r'https://github.com/InsightSoftwareConsortium/LesionSizingToolkit',
description=r'A generic and extensible ITK module for lesion segmentation',
long_description='LesionSizingToolkit (LSTK) provides a generic, modular, '
'and extensible architecture for lesion sizing'
'algorithms in medical images as well as a reference'
'algorithm for lung solid lesion segmentation in CT images.\n'
'Please refer to:'
'Liu X., Helba B., Krishnan K., Reynolds P., McCormick M., Turner W., Ibáñez L., Yankelevitz D., Avila R.,'
'“Fostering Open Science in Lung Cancer Lesion Sizing with ITK module LSTK”, '
'Insight Journal, http://hdl.handle.net/10380/3369, 2012.',
classifiers=[
"License :: OSI Approved :: BSD 2-Clause \"Simplified\" License",
"Programming Language :: Python",
"Programming Language :: C++",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Healthcare Industry",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Medical Science Apps.",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Software Development :: Libraries",
"Operating System :: Android",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: Unix",
"Operating System :: MacOS"
],
license='BSD',
keywords='ITK InsightToolkit',
url=r'https://itk.org/',
install_requires=[
r'itk'
]
)
48 changes: 48 additions & 0 deletions wrapping/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
itk_wrap_module(LesionSizingToolkit)

set(WRAPPER_SUBMODULE_ORDER
itkBinaryThresholdFeatureGenerator
itkCannyEdgeDetectionRecursiveGaussianImageFilter
itkCannyEdgesDistanceAdvectionFieldFeatureGenerator
itkCannyEdgesDistanceFeatureGenerator
itkCannyEdgesFeatureGenerator
itkConfidenceConnectedSegmentationModule
itkConnectedreoldSegmentationModule
itkDescoteauxeetnessFeatureGenerator
itkDescoteauxeetnessImageFilter
itkFastMaringAndGeodesicActiveContourLevelSetSegmentationModule
itkFastMaringAndapeDetectionLevelSetSegmentationModule
itkFastMaringSegmentationModule
itkFeatureAggregator
itkFeatureGenerator
itkFrangiTubularnessFeatureGenerator
itkFrangiTubularnessImageFilter
itkGeodesicActiveContourLevelSetSegmentationModule
itkGradientMagnitudeSigmoidFeatureGenerator
itkGrayscaleImageSegmentationVolumeEstimator
itkIsotropicResampler
itkIsotropicResamplerImageFilter
itkLandmarksReader
itkLesionSegmentationImageFilter8
itkLesionSegmentationMeod
itkLocalStructureImageFilter
itkLungWallFeatureGenerator
itkMaximumFeatureAggregator
itkMinimumFeatureAggregator
itkMorologicalOpenningFeatureGenerator
itkRegionCompetitionImageFilter
itkRegionGrowingSegmentationModule
itkSatoLocalStructureFeatureGenerator
itkSatoVesselnessFeatureGenerator
itkSatoVesselnessSigmoidFeatureGenerator
itkSegmentationModule
itkSegmentationVolumeEstimator
itkapeDetectionLevelSetSegmentationModule
itkSigmoidFeatureGenerator
itkSingleaseLevelSetSegmentationModule
itkVesselEancingDiffusion3DImageFilter
itkVotingBinaroleFillFloodingImageFilter
itkWeitedSumFeatureAggregator)

itk_auto_load_submodules()
itk_end_wrap_module()
5 changes: 5 additions & 0 deletions wrapping/itkBinaryThresholdFeatureGenerator.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
itk_wrap_class("itk::BinaryThresholdFeatureGenerator" POINTER)
foreach(d ${ITK_WRAP_IMAGE_DIMS})
itk_wrap_template(${d} ${d})
endforeach()
itk_end_wrap_class()
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
itk_wrap_class("itk::CannyEdgeDetectionRecursiveGaussianImageFilter" POINTER)
itk_wrap_image_filter("${WRAP_ITK_SCALAR}" 2+)
itk_end_wrap_class()
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
itk_wrap_class("itk::CannyEdgesDistanceAdvectionFieldFeatureGenerator" POINTER)
foreach(d ${ITK_WRAP_IMAGE_DIMS})
itk_wrap_template(${d} ${d})
endforeach()
itk_end_wrap_class()
5 changes: 5 additions & 0 deletions wrapping/itkCannyEdgesDistanceFeatureGenerator.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
itk_wrap_class("itk::CannyEdgesDistanceFeatureGenerator" POINTER)
foreach(d ${ITK_WRAP_IMAGE_DIMS})
itk_wrap_template(${d} ${d})
endforeach()
itk_end_wrap_class()
5 changes: 5 additions & 0 deletions wrapping/itkCannyEdgesFeatureGenerator.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
itk_wrap_class("itk::CannyEdgesFeatureGenerator" POINTER)
foreach(d ${ITK_WRAP_IMAGE_DIMS})
itk_wrap_template(${d} ${d})
endforeach()
itk_end_wrap_class()
5 changes: 5 additions & 0 deletions wrapping/itkConfidenceConnectedSegmentationModule.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
itk_wrap_class("itk::ConfidenceConnectedSegmentationModule" POINTER)
foreach(d ${ITK_WRAP_IMAGE_DIMS})
itk_wrap_template(${d} ${d})
endforeach()
itk_end_wrap_class()
5 changes: 5 additions & 0 deletions wrapping/itkConnectedThresholdSegmentationModule.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
itk_wrap_class("itk::ConnectedThresholdSegmentationModule" POINTER)
foreach(d ${ITK_WRAP_IMAGE_DIMS})
itk_wrap_template(${d} ${d})
endforeach()
itk_end_wrap_class()
5 changes: 5 additions & 0 deletions wrapping/itkDescoteauxSheetnessFeatureGenerator.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
itk_wrap_class("itk::DescoteauxSheetnessFeatureGenerator" POINTER)
foreach(d ${ITK_WRAP_IMAGE_DIMS})
itk_wrap_template(${d} ${d})
endforeach()
itk_end_wrap_class()
3 changes: 3 additions & 0 deletions wrapping/itkDescoteauxSheetnessImageFilter.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
itk_wrap_class("itk::DescoteauxSheetnessImageFilter" POINTER)
itk_wrap_image_filter("${WRAP_ITK_SCALAR}" 2+)
itk_end_wrap_class()
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
itk_wrap_class("itk::FastMarchingAndGeodesicActiveContourLevelSetSegmentationModule" POINTER)
foreach(d ${ITK_WRAP_IMAGE_DIMS})
itk_wrap_template(${d} ${d})
endforeach()
itk_end_wrap_class()
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
itk_wrap_class("itk::FastMarchingAndShapeDetectionLevelSetSegmentationModule" POINTER)
foreach(d ${ITK_WRAP_IMAGE_DIMS})
itk_wrap_template(${d} ${d})
endforeach()
itk_end_wrap_class()
Loading

0 comments on commit 2cd3cf4

Please sign in to comment.