Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: DerThorsten/nifty
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.3
Choose a base ref
...
head repository: DerThorsten/nifty
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Feb 18, 2019

  1. Fixes for clang

    constantinpape committed Feb 18, 2019
    Copy the full SHA
    f9bde6d View commit details
  2. Another clang fix

    Constantin Pape committed Feb 18, 2019
    Copy the full SHA
    da4db4a View commit details
  3. Bump version

    constantinpape committed Feb 18, 2019
    Copy the full SHA
    d335f32 View commit details
  4. Copy the full SHA
    8f6c401 View commit details
  5. Bump version

    constantinpape committed Feb 18, 2019
    Copy the full SHA
    3f3ca55 View commit details

Commits on Feb 22, 2019

  1. Copy the full SHA
    080ed54 View commit details

Commits on Feb 26, 2019

  1. Copy the full SHA
    213a17d View commit details

Commits on Mar 6, 2019

  1. Copy the full SHA
    b05e7af View commit details
  2. Copy the full SHA
    446d2b0 View commit details
  3. Copy the full SHA
    7e64282 View commit details

Commits on Mar 7, 2019

  1. Copy the full SHA
    ec4d953 View commit details
  2. Copy the full SHA
    012f76c View commit details

Commits on Mar 10, 2019

  1. Remove unique impl

    constantinpape committed Mar 10, 2019
    Copy the full SHA
    6e2643f View commit details
  2. Copy the full SHA
    c3f5cf6 View commit details

Commits on Mar 29, 2019

  1. Copy the full SHA
    a9adb11 View commit details

Commits on Mar 30, 2019

  1. Debugging two-pass WIP

    constantinpape committed Mar 30, 2019
    Copy the full SHA
    9612eab View commit details

Commits on Apr 10, 2019

  1. Copy the full SHA
    ef83721 View commit details

Commits on Apr 19, 2019

  1. Copy the full SHA
    0aaf7d9 View commit details

Commits on Apr 25, 2019

  1. Use xt::zeros instead of pytensor constructor for 1d-tensors.

    To avoid issue where pytensor is initialized with shape (1,) instead of {size,}.
    Fixes #125.
    constantinpape committed Apr 25, 2019
    Copy the full SHA
    5178c66 View commit details
  2. Fix overloaded export

    constantinpape committed Apr 25, 2019
    Copy the full SHA
    1ccecb7 View commit details
  3. Merge pull request #126 from constantinpape/master

    Fix pybindings issues + stuff
    constantinpape authored Apr 25, 2019
    Copy the full SHA
    5c81edc View commit details

Commits on Apr 30, 2019

  1. Copy the full SHA
    96a9154 View commit details
  2. Copy the full SHA
    544a229 View commit details

Commits on May 9, 2019

  1. Copy the full SHA
    5d79e1e View commit details
  2. Copy the full SHA
    518e7fd View commit details
  3. Copy the full SHA
    04e7936 View commit details

Commits on May 17, 2019

  1. Copy the full SHA
    75d411c View commit details

Commits on Jun 3, 2019

  1. Copy the full SHA
    8fba4c7 View commit details

Commits on Jun 4, 2019

  1. Copy the full SHA
    8abb8a8 View commit details

Commits on Jun 11, 2019

  1. Update conda recipe

    constantinpape committed Jun 11, 2019
    Copy the full SHA
    cd3f7dc View commit details

Commits on Jun 14, 2019

  1. Update to new xtensor

    constantinpape committed Jun 14, 2019
    Copy the full SHA
    b5754b4 View commit details

Commits on Jun 16, 2019

  1. Copy the full SHA
    f46c8f1 View commit details

Commits on Jun 19, 2019

  1. Copy the full SHA
    0cc802a View commit details
  2. Copy the full SHA
    0029b42 View commit details

Commits on Jun 28, 2019

  1. Copy the full SHA
    2aceb26 View commit details

Commits on Jul 1, 2019

  1. Copy the full SHA
    901c56e View commit details

Commits on Jul 2, 2019

  1. Remove obsolete fixme

    constantinpape committed Jul 2, 2019
    Copy the full SHA
    99d1ea5 View commit details

Commits on Aug 7, 2019

  1. Copy the full SHA
    c20df90 View commit details
  2. Copy the full SHA
    7d3537e View commit details
  3. Copy the full SHA
    99afc88 View commit details
  4. Merge pull request #127 from constantinpape/master

    Optional boost filesystem
    constantinpape authored Aug 7, 2019
    Copy the full SHA
    117b6ef View commit details
  5. Copy the full SHA
    dc02ac6 View commit details

Commits on Aug 9, 2019

  1. Copy the full SHA
    8a25ddb View commit details
  2. Copy the full SHA
    b53e730 View commit details

Commits on Aug 13, 2019

  1. Copy the full SHA
    ef09a10 View commit details
  2. Copy the full SHA
    296e756 View commit details
  3. Copy the full SHA
    09636a9 View commit details
  4. Update conda recipe

    constantinpape committed Aug 13, 2019
    Copy the full SHA
    efbab45 View commit details
  5. Copy the full SHA
    38fbb1a View commit details

Commits on Aug 14, 2019

  1. Update paintera hack

    constantinpape committed Aug 14, 2019
    Copy the full SHA
    c1e6646 View commit details
Showing with 8,773 additions and 3,762 deletions.
  1. +53 −0 .github/workflows/build.yaml
  2. +21 −0 .github/workflows/build_unix.sh
  3. +18 −0 .github/workflows/build_win.bat
  4. +14 −0 .github/workflows/environment.yaml
  5. +3 −0 .gitignore
  6. +0 −67 .travis.yml
  7. +47 −41 CMakeLists.txt
  8. +26 −13 README.md
  9. +0 −42 appveyor.yml
  10. +1 −1 build_conda.sh
  11. +83 −42 cmake/modules/FindNUMPY.cmake
  12. +1 −1 conda-recipe/bld.bat
  13. +11 −210 conda-recipe/build.sh
  14. +233 −0 conda-recipe/build.sh.old
  15. +25 −65 conda-recipe/meta.yaml
  16. +13 −0 environment.yaml
  17. +27 −7 include/nifty/distributed/distributed_graph.hxx
  18. +74 −56 include/nifty/distributed/distributed_utils.hxx
  19. +271 −0 include/nifty/distributed/edge_morphology.hxx
  20. +375 −209 include/nifty/distributed/graph_extraction.hxx
  21. +207 −124 include/nifty/distributed/graph_tools.hxx
  22. +116 −42 include/nifty/distributed/lifted_utils.hxx
  23. +303 −164 include/nifty/distributed/mergeable_features.hxx
  24. +14 −9 include/nifty/distributed/morphology.hxx
  25. +81 −0 include/nifty/filters/nonmaximum_suppression.hxx
  26. +14 −14 include/nifty/graph/agglo/agglomerative_clustering.hxx
  27. +188 −12 include/nifty/graph/agglo/cluster_policies/detail/merge_rules.hxx
  28. +0 −327 include/nifty/graph/agglo/cluster_policies/fixation_cluster_policy.hxx
  29. +636 −0 include/nifty/graph/agglo/cluster_policies/gasp_cluster_policy.hxx
  30. +2 −2 include/nifty/graph/components.hxx
  31. +3 −3 include/nifty/graph/detail/search_impl.hxx
  32. +9 −12 include/nifty/graph/edge_contraction_graph.hxx
  33. +13 −18 include/nifty/graph/edge_weighted_watersheds.hxx
  34. +126 −0 include/nifty/graph/label_propagation.hxx
  35. +8 −18 include/nifty/graph/opt/common/logging_visitor.hxx
  36. +35 −49 include/nifty/graph/opt/multicut/cgc.hxx
  37. +2 −4 include/nifty/graph/opt/multicut/kernighan_lin.hxx
  38. +103 −140 include/nifty/graph/opt/multicut/multicut_decomposer.hxx
  39. +24 −27 include/nifty/graph/opt/multicut/multicut_greedy_additive.hxx
  40. +367 −0 include/nifty/graph/opt/multicut/multicut_greedy_fixation.hxx
  41. +5 −5 include/nifty/graph/opt/multicut/multicut_objective.hxx
  42. +3 −2 include/nifty/graph/rag/detail_rag/compute_grid_rag.hxx
  43. +7 −7 include/nifty/graph/rag/feature_accumulation/grid_rag_accumulate_filters_stacked.hxx
  44. +3 −3 include/nifty/graph/rag/feature_accumulation/grid_rag_accumulate_stacked.hxx
  45. +66 −66 include/nifty/graph/rag/feature_accumulation/grid_rag_affinity_features.hxx
  46. +66 −0 include/nifty/graph/rag/get_lifted_edges_from_rag_and_offsets.hxx
  47. +0 −2 include/nifty/graph/rag/grid_rag_accumulate.hxx
  48. +8 −7 include/nifty/graph/rag/grid_rag_coordinates.hxx
  49. +576 −113 include/nifty/graph/undirected_grid_graph.hxx
  50. +6 −17 include/nifty/graph/undirected_list_graph.hxx
  51. +0 −338 include/nifty/graph/undirected_long_range_grid_graph.hxx
  52. +12 −9 include/nifty/ground_truth/overlap.hxx
  53. +8 −0 include/nifty/hdf5/hdf5_array.hxx
  54. +2 −2 include/nifty/nifty_config.hxx
  55. +1 −1 include/nifty/python/converter.hxx
  56. +6 −5 include/nifty/python/graph/agglo/export_agglomerative_clustering.hxx
  57. +6 −6 include/nifty/python/graph/opt/common/py_proposal_generator_factory_base.hxx
  58. +5 −5 include/nifty/python/graph/undirected_grid_graph.hxx
  59. +0 −35 include/nifty/python/graph/undirected_long_range_grid_graph.hxx
  60. +49 −40 include/nifty/skeletons/evaluation.hxx
  61. +1 −1 include/nifty/tools/block_access.hxx
  62. +1 −3 include/nifty/tools/blocking.hxx
  63. +1 −7 include/nifty/tools/for_each_coordinate.hxx
  64. +422 −0 include/nifty/tools/label_multiset.hxx
  65. +142 −0 include/nifty/tools/label_multiset_wrapper.hxx
  66. +1 −1 include/nifty/tools/nodes_to_blocks.hxx
  67. +37 −0 include/nifty/tools/rle.hxx
  68. +109 −0 include/nifty/transformation/coordinate_transformation.hxx
  69. +178 −0 include/nifty/transformation/coordinate_transformation_chunked.hxx
  70. +65 −0 include/nifty/transformation/transformation_functions.hxx
  71. +5 −5 include/nifty/xtensor/xtensor.hxx
  72. +0 −199 include/nifty/z5/upsampling.hxx
  73. +6 −13 include/nifty/z5/z5.hxx
  74. +7 −49 src/python/CMakeLists.txt
  75. +2 −1 src/python/examples/cgp/plot_cgp_introduction.py
  76. +1 −1 src/python/examples/graph/plot_undirected_grid_graph.py
  77. +4 −1 src/python/lib/CMakeLists.txt
  78. +1 −2 src/python/lib/carving/CMakeLists.txt
  79. +1 −1 src/python/lib/cgp/bounds.cxx
  80. +2 −2 src/python/lib/distributed/CMakeLists.txt
  81. +2 −0 src/python/lib/distributed/distributed.cxx
  82. +46 −7 src/python/lib/distributed/distributed_graph.cxx
  83. +32 −18 src/python/lib/distributed/distributed_utils.cxx
  84. +52 −0 src/python/lib/distributed/edge_morphology.cxx
  85. +69 −44 src/python/lib/distributed/graph_extraction.cxx
  86. +46 −9 src/python/lib/distributed/lifted_utils.cxx
  87. +33 −20 src/python/lib/distributed/mergeable_features.cxx
  88. +11 −4 src/python/lib/distributed/morphology.cxx
  89. +1 −0 src/python/lib/filters/CMakeLists.txt
  90. +2 −0 src/python/lib/filters/filters.cxx
  91. +1 −1 src/python/lib/filters/gaussian_curvature.cxx
  92. +47 −0 src/python/lib/filters/nonmaximum_suppression.cxx
  93. +3 −2 src/python/lib/graph/CMakeLists.txt
  94. +244 −0 src/python/lib/graph/accumulate_long_range_affinities.cxx
  95. +1 −1 src/python/lib/graph/agglo/CMakeLists.txt
  96. +2 −2 src/python/lib/graph/agglo/agglo.cxx
  97. +4 −4 src/python/lib/graph/agglo/agglomerative_clustering.cxx
  98. +0 −151 src/python/lib/graph/agglo/fixation_agglomerative_clustering.cxx
  99. +180 −0 src/python/lib/graph/agglo/gasp_agglomerative_clustering.cxx
  100. +0 −1 src/python/lib/graph/agglo/lifted_agglomerative_clustering.cxx
  101. +14 −0 src/python/lib/graph/agglo/merge_rules.cxx
  102. +3 −3 src/python/lib/graph/connected_components.cxx
  103. +1 −1 src/python/lib/graph/edge_weighted_watersheds.cxx
  104. +19 −6 src/python/lib/graph/export_shortest_path_dijkstra.cxx
  105. +18 −16 src/python/lib/graph/export_undirected_graph_class_api.hxx
  106. +5 −2 src/python/lib/graph/graph.cxx
  107. +66 −0 src/python/lib/graph/label_propagation.cxx
  108. +1 −1 src/python/lib/graph/long_range_adjacency/CMakeLists.txt
  109. +1 −0 src/python/lib/graph/long_range_adjacency/adjacency.cxx
  110. +2 −2 src/python/lib/graph/opt/common/export_solver_base.hxx
  111. +2 −2 src/python/lib/graph/opt/lifted_multicut/lifted_multicut_base.cxx
  112. +1 −1 src/python/lib/graph/opt/lifted_multicut/lifted_multicut_objective.cxx
  113. +2 −2 src/python/lib/graph/opt/minstcut/minstcut_base.cxx
  114. +1 −0 src/python/lib/graph/opt/multicut/CMakeLists.txt
  115. +10 −11 src/python/lib/graph/opt/multicut/cc_fusion_move_based.cxx
  116. +2 −0 src/python/lib/graph/opt/multicut/multicut.cxx
  117. +2 −2 src/python/lib/graph/opt/multicut/multicut_base.cxx
  118. +14 −7 src/python/lib/graph/opt/multicut/multicut_decomposer.cxx
  119. +7 −7 src/python/lib/graph/opt/multicut/multicut_greedy_additive.cxx
  120. +76 −0 src/python/lib/graph/opt/multicut/multicut_greedy_fixation.cxx
  121. +4 −5 src/python/lib/graph/opt/multicut/multicut_visitor_base.cxx
  122. +1 −1 src/python/lib/graph/opt/multicut/perturb_and_map.cxx
  123. +2 −2 src/python/lib/graph/rag/CMakeLists.txt
  124. +10 −3 src/python/lib/graph/rag/accumulate_affinities.cxx
  125. +101 −0 src/python/lib/graph/rag/get_lifted_edges_from_rag_and_offsets.cxx
  126. +4 −4 src/python/lib/graph/rag/grid_rag_coordinates.cxx
  127. +4 −114 src/python/lib/graph/rag/project_to_pixels.cxx
  128. +2 −0 src/python/lib/graph/rag/rag.cxx
  129. +321 −107 src/python/lib/graph/undirected_grid_graph.cxx
  130. +14 −3 src/python/lib/graph/undirected_list_graph.cxx
  131. +0 −114 src/python/lib/graph/undirected_long_range_grid_graph.cxx
  132. +1 −3 src/python/lib/skeletons/CMakeLists.txt
  133. +9 −6 src/python/lib/skeletons/evaluation.cxx
  134. +3 −2 src/python/lib/tools/CMakeLists.txt
  135. +69 −0 src/python/lib/tools/blocking.cxx
  136. +1 −1 src/python/lib/tools/edge_mapping.cxx
  137. +149 −0 src/python/lib/tools/label_multiset.cxx
  138. +40 −0 src/python/lib/tools/rle.cxx
  139. +42 −24 src/python/lib/tools/take.cxx
  140. +6 −0 src/python/lib/tools/tools.cxx
  141. +15 −0 src/python/lib/transformation/CMakeLists.txt
  142. +262 −0 src/python/lib/transformation/affine_transformation.cxx
  143. +267 −0 src/python/lib/transformation/coordinate_transformation.cxx
  144. +49 −0 src/python/lib/transformation/transformation.cxx
  145. +1 −3 src/python/lib/z5/CMakeLists.txt
  146. +2 −3 src/python/lib/z5/dataset_wrapper.cxx
  147. +0 −45 src/python/lib/z5/upsampling.cxx
  148. +0 −2 src/python/lib/z5/z5.cxx
  149. +18 −18 src/python/module/nifty/cgp/__init__.py
  150. +162 −15 src/python/module/nifty/graph/__init__.py
  151. +54 −64 src/python/module/nifty/graph/agglo/__init__.py
  152. +3 −0 src/python/module/nifty/graph/long_range_adjacency/__init__.py
  153. +123 −175 src/python/module/nifty/graph/opt/multicut/__init__.py
  154. +13 −2 src/python/module/nifty/graph/rag/__init__.py
  155. +1 −1 src/python/module/nifty/segmentation/__init__.py
  156. +14 −4 src/python/module/nifty/tools/__init__.py
  157. +74 −0 src/python/module/nifty/transformation/__init__.py
  158. 0 src/python/test/carving/__init__.py
  159. +65 −0 src/python/test/graph/agglo/test_GASP.py
  160. +10 −0 src/python/test/graph/rag/test_accumulate.py
  161. +19 −30 src/python/test/graph/rag/test_accumulate_stacked.py
  162. +48 −0 src/python/test/graph/rag/test_compute_lifted_edges_from_rag_and_offsets.py
  163. +1 −1 src/python/test/graph/rag/test_hdf5_serialization.py
  164. +9 −4 src/python/test/graph/rag/test_rag_stacked.py
  165. +41 −0 src/python/test/graph/test_accumulate_affinities_mean_and_length.py
  166. +4 −4 src/python/test/graph/test_grid_graph.py
  167. +54 −0 src/python/test/graph/test_label_propagation.py
  168. +2 −2 src/python/test/hdf5/test_hdf5.py
  169. +7 −5 src/python/test/skeletons/test_eval.py
  170. +104 −0 test_two_pass.py
  171. +183 −0 two_pass_agglomeration.py
53 changes: 53 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: build-and-test

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
name: ${{ matrix.os }} ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
python-version: [3.10, 3.11]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: .github/workflows/environment.yaml
python-version: ${{ matrix.python-version }}

# this will set the system compiler;
# I don't know how to set the conda compilers for windows
- name: Set windows env
if: matrix.os == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1

- name: Build linux
if: matrix.os == 'ubuntu-latest'
shell: bash -l {0}
run: .github/workflows/build_unix.sh

- name: Build mac
if: matrix.os == 'macos-latest'
shell: bash -l {0}
run: .github/workflows/build_unix.sh

- name: Build win
if: matrix.os == 'windows-latest'
shell: bash -l {0}
run: .github/workflows/build_win.bat

- name: Run tests
shell: bash -l {0}
run: python -m unittest discover -s src/python/test -v
21 changes: 21 additions & 0 deletions .github/workflows/build_unix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

export PY_BIN="$CONDA_PREFIX/bin/python"
cmake . \
-DWITHIN_TRAVIS=ON \
-DWITH_QPBO=OFF \
-DWITH_HDF5=ON \
-DWITH_Z5=ON \
-DWITH_ZLIB=ON \
-DWITH_BLOSC=ON \
-DWITH_GLPK=OFF \
-DWITH_CPLEX=OFF \
-DWITH_GUROBI=OFF \
-DBUILD_CPP_TEST=OFF \
-DCMAKE_PREFIX_PATH="$CONDA_PREFIX" \
-DPYTHON_EXECUTABLE="$PY_BIN" \
-DCMAKE_CXX_FLAGS="-std=c++17" \
-DCMAKE_INSTALL_PREFIX="$CONDA_PREFIX" \
-DBUILD_NIFTY_PYTHON=ON
make -j 4
make install
18 changes: 18 additions & 0 deletions .github/workflows/build_win.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
REM https://stackoverflow.com/questions/6832666/lnk2019-when-including-asio-headers-solution-generated-with-cmake
cmake . -G "NMake Makefiles" ^
-DWITH_QPBO=OFF ^
-DWITH_HDF5=OFF ^
-DWITH_GLPK=OFF ^
-DWITH_CPLEX=OFF ^
-DWITH_GUROBI=OFF ^
-DBUILD_CPP_TEST=OFF ^
-DCMAKE_PREFIX_PATH="%CONDA_PREFIX%" ^
-DCMAKE_INSTALL_PREFIX="%CONDA_PREFIX%" ^
-DCMAKE_CXX_FLAGS="/std:c++17 /EHsc" ^
-DBUILD_NIFTY_PYTHON=ON ^
-DWITH_HDF5=OFF ^
-DWITH_Z5=ON ^
-DWITH_ZLIB=ON ^
-DWITH_BLOSC=ON

cmake --build . --target INSTALL --config Release -j 4
14 changes: 14 additions & 0 deletions .github/workflows/environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: nifty-build-env
channels:
- conda-forge
dependencies:
- boost-cpp>=1.63
- cmake
- compilers
- h5py
- nlohmann_json
- scikit-image
- xtensor
- xtensor-python
- vigra
- z5py
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -57,3 +57,6 @@ docsrc/python/refs.bib
# autogenerated from sphinx
docsrc/python/sections/gen_modules/


# bld folder
bld/
67 changes: 0 additions & 67 deletions .travis.yml

This file was deleted.

88 changes: 47 additions & 41 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -27,26 +27,20 @@ include(CheckCXXCompilerFlag)

include_directories(${${PROJECT_NAME}_INCLUDE_DIR})

option(USE_OLD_ABI OFF)
# Old ABI to be compatible with boost
if(USE_OLD_ABI)
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
endif()

option(WITH_GUROBI OFF)
option(WITH_CPLEX OFF)
option(WITH_GLPK OFF)
option(WITH_HDF5 OFF)
option(WITH_FASTFILTERS OFF)
option(WITH_LP_MP OFF)
option(WITH_QPBO ON)
option(WITH_Z5 OFF)

option(BUILD_PYTHON_TEST OFF)
option(BUILD_CPP_TEST ON)
option(BUILD_NIFTY_PYTHON OFF)
option(BUILD_DOCS ON)
option(BUILD_CPP_EXAMPLES ON)
option(WITH_GUROBI "Build with gurobi" OFF)
option(WITH_CPLEX "Build with cplex" OFF)
option(WITH_GLPK "Build with glpk" OFF)
option(WITH_HDF5 "Build with hdf5 support" OFF)
option(WITH_FASTFILTERS "Build with fastfilters" OFF)
option(WITH_LP_MP "Build with lpmp" OFF)
option(WITH_QPBO "Build with qpbo" OFF)
option(WITH_Z5 "Build with z5" OFF)

option(BUILD_PYTHON_TEST "Build python tests" OFF)
option(BUILD_CPP_TEST "Build c++ tests" OFF)
option(BUILD_NIFTY_PYTHON "Build the python bindings" ON)
option(BUILD_DOCS "Build the docs" OFF)
option(BUILD_CPP_EXAMPLES "Build the c++ examples" OFF)
option(BUILD_PYTHON_DOCS "Build the Python documentation with Sphinx" OFF)

option(REMOVE_SOME_WARNINGS "Remove some annoying warnings" ON)
@@ -58,6 +52,7 @@ find_package(Threads REQUIRED)
if(MSVC)
# Disable autolinking on MSVC.
add_definitions(-DBOOST_ALL_NO_LIB)
add_definitions(-DNOMINMAX)
endif()

# from externals..
@@ -83,25 +78,19 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
endif()

#-------------------------------------------------------------------------------------------------------------------
# check for c++ 14 / 17 support
# check for c++ 17 support
#-------------------------------------------------------------------------------------------------------------------

message(STATUS "CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
if (NOT "${CMAKE_CXX_FLAGS}" MATCHES "-std=c\\+\\+17")
message(STATUS "Using c++ 14")
set(CMAKE_CXX_STANDARD 14)
else()
message(STATUS "Using c++ 17")
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)


# WITH_LP_MP needs special treatment since
# it requires C++ 14 and used OpenMP
# it requires C++ 14 and uses OpenMP
if(WITH_LP_MP)
find_package(OpenMP)
if (OPENMP_FOUND)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
endif()

@@ -166,9 +155,26 @@ endif()
#-------------------------------------------------------------------------------------------------------------------
# find boost
#-------------------------------------------------------------------------------------------------------------------
find_package(Boost 1.63.0 COMPONENTS system filesystem serialization REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
MESSAGE(STATUS ${Boost_INCLUDE_DIRS})
find_package(Boost 1.63.0 REQUIRED)

# see this issue for discussions about the filesystem lib in CMake
# https://gitlab.kitware.com/cmake/cmake/issues/17834
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
SET(FILESYSTEM_LIBRARIES "stdc++fs")
endif()

# on clang, we need to enable libc++experimental, see
# https://stackoverflow.com/a/45332844
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# see https://libcxx.llvm.org/docs/UsingLibcxx.html#id3
if(${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "7.0")
SET(FILESYSTEM_LIBRARIES "c++experimental")
elseif(${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "9.0")
SET(FILESYSTEM_LIBRARIES "c++fs")
endif()
# nothing required for clang>=9.0
endif()
include_directories(${Boost_INCLUDE_DIR})


if(WITHIN_TRAVIS)
@@ -228,16 +234,16 @@ endif()
# find z5
#-------------------------------------------------------------------------------------------------------------------
if(WITH_Z5)
find_package(z5 REQUIRED)
include_directories(${z5_INCLUDE_DIRS})
add_definitions(-DWITH_Z5)
option(WITH_BLOSC ON)
option(WITH_BZIP2 ON)
option(WITH_ZLIB ON)

# TODO need to do this for conda package or add necessary things to cmake modules here
# set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/externals/z5/cmake")
option(WITH_BLOSC "Build z5 with blosc compression" ON)
option(WITH_BZIP2 "Build z5 with bzip2 compression" ON)
option(WITH_ZLIB "Build z5 with zlib compression" ON)

# z5 compression libraries
SET(Z5_COMPRESSION_LIBRARIES "")

if(WITH_BLOSC)
find_package(BLOSC REQUIRED)
include_directories(${BLOSC_INCLUDE_DIR})
39 changes: 26 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
Travis (Ubuntu builds)
Github Workflow builds
---------------------------------
Master: [![Build Status master](https://travis-ci.org/constantinpape/nifty.svg?branch=master)](https://travis-ci.org/DerThorsten/nifty)

Appveyor (Windows builds)
---------------------------------
Master:
[![Build status](https://ci.appveyor.com/api/projects/status/u6nfcpfhpyya5mk8/branch/master?svg=true)](https://ci.appveyor.com/project/DerThorsten/nifty-5sb8n/branch/master)
Dev:
[![Build status](https://ci.appveyor.com/api/projects/status/u6nfcpfhpyya5mk8/branch/dev?svg=true)](https://ci.appveyor.com/project/DerThorsten/nifty-5sb8n/branch/dev)
[![Build Status](https://github.com/DerThorsten/nifty/workflows/build/badge.svg)](https://github.com/DerThorsten/nifty/actions)


Nifty
========




A nifty library for 2D and 3D image segmentation,
graph based segmentation an opt.
This library provided building blocks for segmentation
@@ -100,12 +91,34 @@ Almost any class / function in the Python API is calling into C++ via pybind11.
Install:
========

The easiest way to install this version is via conda (right now only available with gurobi, cplex version coming soon):

Conda:
======

The easiest way to install this version is via conda (right now it is not available with gurobi or cplex, you will need to build from source for this):
```
$ GUROBI_ROOT_DIR=/path/to/gurobi conda install -c cpape nifty-with-gurobi
conda install -c conda-forge nifty
```

From Source:
============

To build nifty from source, you will need to set up an environment with all necessary dependencies.
We recommend to use conda for this as well and provide the file environment.yaml` for this.
You can set up this environment and build nifty with the following commands:

```sh
$ conda env create -f environment.yaml
$ conda activate nifty-dev
$ mkdir bld
$ cd bld
$ cmake -DCMAKE_PREFIX_PATH=/path/to/conda/envs/nifty-dev -DWITH_Z5=ON -DWITH_HDF5=ON -DWITH_ZLIB=ON -DBUILD_NIFTY_PYTHON=ON ..
$ make
```

This would build nifty with additional hdf5 and z5 dependencies; and add zlib support for z5.
You can find all build options in [CMakeLists.txt](https://github.com/DerThorsten/nifty/blob/master/CMakeLists.txt#L36-L50);
note that you may need to install additional dependencies.


Troubleshooting:
Loading