Skip to content

Commit

Permalink
Merge pull request #1569 from dcoeurjo/rel1.2
Browse files Browse the repository at this point in the history
Release 1.2
  • Loading branch information
dcoeurjo authored Jun 2, 2021
2 parents bfe4363 + a74b1d9 commit 3a38775
Show file tree
Hide file tree
Showing 12 changed files with 161 additions and 20 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
set(DGtal_VERSION_MAJOR 1)
set(DGtal_VERSION_MINOR 2)
set(DGtal_VERSION_PATCH beta)
set(DGtal_VERSION_PATCH 0)
set(DGTAL_VERSION "${DGtal_VERSION_MAJOR}.${DGtal_VERSION_MINOR}.${DGtal_VERSION_PATCH}")
set(PROJECT_VERSION "${DGtal_VERSION_MAJOR}.${DGtal_VERSION_MINOR}.${DGtal_VERSION_PATCH}")
set(VERSION ${DGtal_VERSION_MAJOR}.${DGtal_VERSION_MINOR}.${DGtal_VERSION_PATCH})
Expand Down
7 changes: 6 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# DGtal 1.2 (dev)
# DGtal 1.2

## New Features / Critical Changes

- *New Feature*
- DGtal now has a python binding `pip install dgtal`! For all
details on the list of classes available in python, you can have a
look to: Pablo Hernandez-Cerdan [#1528](https://github.com/DGtal-team/DGtal/pull/1528)

- *Geometry Package*
- New normal vector estimation using plane-probing approaches.
(Jocelyn Meyron, Tristan Roussillon,
Expand Down
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ results and potential efficiency of the proposed work.
Quick Install
=============

* Linux:
* [Arch, CentOS, Fedora, openSUSE, RHEL, SL](http://software.opensuse.org//download.html?project=home%3Acopyme%3ADGtal&package=libDGtal)
* [Debian, Ubuntu, etc.](http://software.opensuse.org//download.html?project=home%3Acopyme%3ADGtal&package=dgtal)

* MacOS (using [homebrew](http://brew.sh)):

brew tap DGtal-team/DGtal
Expand All @@ -31,7 +27,7 @@ Quick Install

(```brew options dgtal``` to enable optional features)

* Windows: no binary package, please compile the library.
* Linux and windows: no binary package, please compile the library.


Additional instructions are available in the
Expand Down Expand Up @@ -68,5 +64,5 @@ More Information
* Release 0.9 [![DOI](https://zenodo.org/badge/doi/10.5281/zenodo.31884.svg)](http://dx.doi.org/10.5281/zenodo.31884)
* Release 0.8 [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.11586.svg)](https://doi.org/10.5281/zenodo.11586)
* Continuous Integration (Linux/MacOS) [![Build Status](https://travis-ci.org/DGtal-team/DGtal.svg?branch=master)](https://travis-ci.org/DGtal-team/DGtal)
* Continuous Integration (Windows) [![Build status](https://ci.appveyor.com/api/projects/status/7labe8ft0jf30ng7/branch/master?svg=true)](https://ci.appveyor.com/project/kerautret/dgtal-8op01/branch/master)
* Continuous Integration (Windows) [![Build status](https://ci.appveyor.com/api/projects/status/7labe8ft0jf30ng7/branch/master?svg=true)](https://ci.appveyor.com/project/kerautret/dgtal-8op01/branch/master)

4 changes: 2 additions & 2 deletions cmake/FetchExternalDeps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ if (BUILD_TESTING)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v2.13.3
GIT_TAG v2.13.6
)

message(STATUS " Catch2 (v2.13.3)")
message(STATUS " Catch2 (v2.13.6)")
FetchContent_MakeAvailable(Catch2)

list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/contrib)
Expand Down
8 changes: 7 additions & 1 deletion examples/doc-examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@ set(DGTAL_DOC_EX_SRC
kernelDomain
range
labelledMapBestParameters
exampleCatch
)


if (BUILD_TESTING)
add_executable(exampleCatch exampleCatch.cpp)
target_link_libraries (exampleCatch DGtal)
endif()


if( WITH_VISU3D_QGLVIEWER )
set(DGTAL_DOC_EX_SRC_QGL
)
Expand Down
3 changes: 1 addition & 2 deletions examples/tutorial-examples/volDTGranulo-template.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,13 @@
#include "DGtal/io/readers/VolReader.h"
#include "DGtal/io/writers/VolWriter.h"

#include "DGtal/images/imagesSetsUtils/SimpleThresholdForegroundPredicate.h"
#include "DGtal/images/SimpleThresholdForegroundPredicate.h"
#include "DGtal/geometry/volumes/distance/DistanceTransformation.h"
#include "DGtal/shapes/implicit/ImplicitBall.h"
#include "DGtal/base/BasicFunctors.h"
//! [volGranulo-basicIncludes]

//! [volGranulo-viewerIncludes]
#include <QtGui/qapplication.h>
#include "DGtal/io/viewers/Viewer3D.h"
#include "DGtal/io/colormaps/GradientColorMap.h"
//! [volGranulo-viewerIncludes]
Expand Down
4 changes: 4 additions & 0 deletions src/DGtal/base/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
// Inclusions

#ifdef WITH_VISU3D_QGLVIEWER
#ifdef APPLE
/* Defined before OpenGL and GLUT includes to avoid deprecation messages */
#define GL_SILENCE_DEPRECATION
#endif
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#pragma clang diagnostic push
Expand Down
2 changes: 1 addition & 1 deletion src/DGtal/doc/mainpage.dox
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ at the [DGtalTools online
documentation](https://dgtal-team.github.io/doctools-nightly) for additional
information.


@note From release 1.2, DGtal has a (partial) python binding. For more information, cf \ref packagePython


@section package_description DGtal Packages
Expand Down
109 changes: 109 additions & 0 deletions src/DGtal/doc/packagePython.dox
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
/**
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**/

/**
* @file packagePython.dox
* @author David Coeurjolly (\c [email protected] )
* Laboratoire d'InfoRmatique en Image et Systèmes d'information - LIRIS (CNRS, UMR 5205), CNRS, France
*
* @date 2021/06/01
*
* Documentation file for feature Introduction
*
* This file is part of the DGtal library.
*/

/*
* Useful to avoid writing DGtal:: in front of every class.
* Do not forget to add an entry in src/DGtal/base/Config.h.in !
*/
namespace DGtal {
//----------------------------------------
/*!
@page packagePython DGtal python binding


@managers Pablo Hernandez-Cerdan, David Coeurjolly
@since 1.2


@b Package @b Overview

Since release 1.2, DGtal has a partial python binding using
[pybind11](https://github.com/pybind/pybind11). To install the python
package, just use:
@code
pip install dgtal
@endcode

Then, you can import the module in python:

@code
import dgtal
....
@endcode

At this point, only a partial support is available (some base, kernel,
image, topology classes). For a complete review of the available
tools, have a look to this
[Pull-Request](https://github.com/DGtal-team/DGtal/pull/1528).

Just a quick example (Euler characteristics and simple point detection on random sets):

@code
import dgtal
import random

Point = dgtal.kernel.Point3D
Domain = dgtal.kernel.DomainZ3i
Set = dgtal._dgtal.kernel.DigitalSetZ3i

dom = Domain( Point(0,0,0), Point(10,10,10))
mySet = Set(dom)

# Random set
for i in range(50*50):
mySet.insert(Point(random.randint(0,10),random.randint(0,10),random.randint(0,10)))

# Digital Object (with topology)
Object = dgtal.topology.Object26_6
Topo = Object.TDigitalTopology
FAdj = Topo.TForegroundAdjacency
BAdj = Topo.TBackgroundAdjacency
fadj = FAdj()
badj = BAdj()
topo = Topo(fadj, badj)
obj = Object(topo,mySet)

#Counting the simple points
cptSimple=0
for p in mySet:
if obj.isSimple(p):
cptSimple += 1
print("Number of simple points: "+str(cptSimple)+ " / " + str(mySet.size()))

# Cubical Complex
kspace = dgtal.topology.KSpace3D()
ccomplex = dgtal.topology.CubicalComplex3D(kspace)
ccomplex.construct(mySet)

print("Euler characteristic: "+str(ccomplex.euler()))
@endcode


*/

}
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ DGtal::ArithmeticalDSSComputerOnSurfels<TKSpace,TIterator,TInteger,adjacency>::g
}
else if (p1 == linel2)
{
aPoint == p2;
aPoint = p2;
}
else if (p2 == linel1)
{
Expand Down
3 changes: 3 additions & 0 deletions src/DGtal/io/viewers/Viewer3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@
#ifdef WIN32
#include <windows.h>
#endif

#ifdef APPLE
/* Defined before OpenGL and GLUT includes to avoid deprecation messages */
#define GL_SILENCE_DEPRECATION
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#else
Expand Down
29 changes: 24 additions & 5 deletions tests/kernel/testIntegerConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,21 @@ SCENARIO( "IntegerConverter< 1, int32 >", "[integer_conversions]" )
typedef IntegerConverter< 1, DGtal::int32_t > Converter;
DGtal::int32_t small_int32 = 0x12345678;
DGtal::int64_t small_int64 = 0x12345678L;
#ifdef WITH_BIGINTEGER
DGtal::BigInteger small_bigint = 0x12345678;
#endif
WHEN( "Converting small integers" ) {
DGtal::int32_t a = Converter::cast( small_int32 );
DGtal::int32_t b = Converter::cast( small_int64 );
#ifdef WITH_BIGINTEGER
DGtal::int32_t c = Converter::cast( small_bigint );
#endif
THEN( "Their values are all identical" ) {
REQUIRE( a == small_int32 );
REQUIRE( a == b );
#ifdef WITH_BIGINTEGER
REQUIRE( a == c );
#endif
}
}
WHEN( "Converting medium integers" ) {
Expand All @@ -86,28 +92,40 @@ SCENARIO( "IntegerConverter< 1, int64 >", "[integer_conversions]" )
typedef IntegerConverter< 1, DGtal::int64_t > Converter;
DGtal::int32_t medium_int32 = DGtal::int32_t( 0x123456789ABCDEFL );
DGtal::int64_t medium_int64 = 0x123456789ABCDEFL;
DGtal::BigInteger medium_bigint = 0x123456789ABCDEFL;
#ifdef WITH_BIGINTEGER
DGtal::BigInteger medium_bigint = 0x123456789ABCDEFL;
#endif
WHEN( "Converting 64bits integers" ) {
DGtal::int64_t a = Converter::cast( medium_int32 );
DGtal::int64_t b = Converter::cast( medium_int64 );
DGtal::int64_t c = Converter::cast( medium_bigint );
THEN( "Only bigger integers are identical" ) {
#ifdef WITH_BIGINTEGER
DGtal::int64_t c = Converter::cast( medium_bigint );
#endif
THEN( "Only bigger integers are identical" ) {
REQUIRE( a == medium_int32 );
REQUIRE( a != b );
REQUIRE( b == medium_int64 );
REQUIRE( b == c );
}
#ifdef WITH_BIGINTEGER
REQUIRE( b == c );
#endif
}
THEN( "It gives the same results with NumberTraits" ) {
DGtal::int64_t ap = NumberTraits<DGtal::int32_t>::castToInt64_t( medium_int32 );
DGtal::int64_t bp = NumberTraits<DGtal::int64_t>::castToInt64_t( medium_int64 );
#ifdef WITH_BIGINTEGER
DGtal::int64_t cp = NumberTraits<DGtal::BigInteger>::castToInt64_t( medium_bigint );
#endif
REQUIRE( a == ap );
REQUIRE( b == bp );
#ifdef WITH_BIGINTEGER
REQUIRE( c == cp );
#endif
}
}
}


#ifdef WITH_BIGINTEGER
SCENARIO( "IntegerConverter< 1, BigInteger >", "[integer_conversions]" )
{
typedef IntegerConverter< 1, DGtal::BigInteger > Converter;
Expand All @@ -132,3 +150,4 @@ SCENARIO( "IntegerConverter< 1, BigInteger >", "[integer_conversions]" )
}
}
}
#endif

0 comments on commit 3a38775

Please sign in to comment.