Gentoo Archives: gentoo-commits

From: Horea Christian <horea.christ@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: sci-libs/simpleitk/files/, sci-libs/simpleitk/
Date: Sun, 03 Jan 2021 07:06:36
Message-Id: 1609657580.a60da02d4be89f4e8dc338ffd488ef88dbe388a4.chymera@gentoo
1 commit: a60da02d4be89f4e8dc338ffd488ef88dbe388a4
2 Author: Horea Christian <chr <AT> chymera <DOT> eu>
3 AuthorDate: Sun Jan 3 07:04:02 2021 +0000
4 Commit: Horea Christian <horea.christ <AT> gmail <DOT> com>
5 CommitDate: Sun Jan 3 07:06:20 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=a60da02d
7
8 sci-libs/simpleitk: new package
9
10 Package-Manager: Portage-3.0.12, Repoman-3.0.2
11 Signed-off-by: Horea Christian <chr <AT> chymera.eu>
12
13 sci-libs/simpleitk/ChangeLog | 10 ++++
14 .../simpleitk/files/simpleitk-1.2.4-int-cast.patch | 64 +++++++++++++++++++++
15 .../simpleitk/files/simpleitk-1.2.4-module.patch | 22 ++++++++
16 sci-libs/simpleitk/metadata.xml | 19 +++++++
17 sci-libs/simpleitk/simpleitk-1.2.4.ebuild | 65 ++++++++++++++++++++++
18 5 files changed, 180 insertions(+)
19
20 diff --git a/sci-libs/simpleitk/ChangeLog b/sci-libs/simpleitk/ChangeLog
21 new file mode 100644
22 index 000000000..308cd02b7
23 --- /dev/null
24 +++ b/sci-libs/simpleitk/ChangeLog
25 @@ -0,0 +1,10 @@
26 + 27 Nov 2020; <chymera@g.o> +files/0dfae3e_reversed.patch,
27 + +files/77a3d89_reversed.patch, +files/simpleitk-1.2.4-int-cast.patch,
28 + +files/simpleitk-1.2.4-module.patch, -simpleitk-1.2.3.ebuild,
29 + simpleitk-1.2.4.ebuild, simpleitk-2.0.0.ebuild:
30 + sci-libs/simpleitk: new package ahead of Gentoo Science
31 +
32 +*simpleitk-2.0.0 (25 Sep 2020)
33 +
34 + 25 Sep 2020; <chymera@g.o> +metadata.xml, +simpleitk-2.0.0.ebuild:
35 + sci-libs/simpleitk: new package ahead of Gentoo Science
36
37 diff --git a/sci-libs/simpleitk/files/simpleitk-1.2.4-int-cast.patch b/sci-libs/simpleitk/files/simpleitk-1.2.4-int-cast.patch
38 new file mode 100644
39 index 000000000..9477194c4
40 --- /dev/null
41 +++ b/sci-libs/simpleitk/files/simpleitk-1.2.4-int-cast.patch
42 @@ -0,0 +1,64 @@
43 +From 73caeaa545859cffd68f9aebe1e8b66de5ab812d Mon Sep 17 00:00:00 2001
44 +From: Bradley Lowekamp <blowekamp@××××××××.gov>
45 +Date: Fri, 14 Feb 2020 09:35:29 -0500
46 +Subject: [PATCH] Explicitly cast int to ITK strongly typed enums
47 +
48 +---
49 + Code/IO/src/sitkImageReaderBase.cxx | 12 ++++++------
50 + 1 file changed, 6 insertions(+), 6 deletions(-)
51 +
52 +diff --git a/Code/IO/src/sitkImageReaderBase.cxx b/Code/IO/src/sitkImageReaderBase.cxx
53 +index b8c93a2ac..a5e6d9cd9 100644
54 +--- a/Code/IO/src/sitkImageReaderBase.cxx
55 ++++ b/Code/IO/src/sitkImageReaderBase.cxx
56 +@@ -214,7 +214,7 @@ ::GetPixelIDFromImageIO( const ImageIOBase *iobase,
57 + if (numberOfComponents == 1 &&
58 + ( pixelType == itk::ImageIOBase::SCALAR || pixelType == itk::ImageIOBase::COMPLEX ) )
59 + {
60 +- outPixelType = this->ExecuteInternalReadScalar( componentType );
61 ++ outPixelType = this->ExecuteInternalReadScalar( static_cast<int>(componentType) );
62 + return;
63 + }
64 + // we try to load anything else into a VectorImage
65 +@@ -226,12 +226,12 @@ ::GetPixelIDFromImageIO( const ImageIOBase *iobase,
66 + pixelType == itk::ImageIOBase::POINT ||
67 + pixelType == itk::ImageIOBase::OFFSET )
68 + {
69 +- outPixelType = this->ExecuteInternalReadVector( componentType );
70 ++ outPixelType = this->ExecuteInternalReadVector( static_cast<int>(componentType) );
71 + return;
72 + }
73 + else if ( pixelType == itk::ImageIOBase::COMPLEX )
74 + {
75 +- outPixelType = this->ExecuteInternalReadComplex( componentType );
76 ++ outPixelType = this->ExecuteInternalReadComplex( static_cast<int>(componentType) );
77 + return;
78 + }
79 + else
80 +@@ -268,7 +268,7 @@ ::ExecuteInternalReadScalar( int componentType )
81 + {
82 + const unsigned int UnusedDimension = 2;
83 +
84 +- switch(componentType)
85 ++ switch(static_cast<ImageIOBase::IOComponentType>(componentType))
86 + {
87 + case itk::ImageIOBase::CHAR:
88 + return ImageTypeToPixelIDValue< itk::Image<int8_t, UnusedDimension> >::Result;
89 +@@ -326,7 +326,7 @@ ::ExecuteInternalReadComplex( int componentType )
90 + {
91 + const unsigned int UnusedDimension = 2;
92 +
93 +- switch(componentType)
94 ++ switch(static_cast<ImageIOBase::IOComponentType>(componentType))
95 + {
96 + case itk::ImageIOBase::FLOAT:
97 + return ImageTypeToPixelIDValue< itk::Image<std::complex<float>, UnusedDimension> >::Result;
98 +@@ -346,7 +346,7 @@ ::ExecuteInternalReadVector( int componentType )
99 + {
100 + const unsigned int UnusedDimension = 2;
101 +
102 +- switch(componentType)
103 ++ switch(static_cast<ImageIOBase::IOComponentType>(componentType))
104 + {
105 + case itk::ImageIOBase::CHAR:
106 + return ImageTypeToPixelIDValue< itk::VectorImage<int8_t, UnusedDimension> >::Result;
107
108 diff --git a/sci-libs/simpleitk/files/simpleitk-1.2.4-module.patch b/sci-libs/simpleitk/files/simpleitk-1.2.4-module.patch
109 new file mode 100644
110 index 000000000..9b40d5e02
111 --- /dev/null
112 +++ b/sci-libs/simpleitk/files/simpleitk-1.2.4-module.patch
113 @@ -0,0 +1,22 @@
114 +From 9a9f67416683d69c1c8d2362ba6e50c4848803b2 Mon Sep 17 00:00:00 2001
115 +From: Bradley Lowekamp <blowekamp@××××××××.gov>
116 +Date: Wed, 20 Nov 2019 15:30:50 -0500
117 +Subject: [PATCH] Update SLICImageFilter's module
118 +
119 +---
120 + Code/BasicFilters/json/SLICImageFilter.json | 2 +-
121 + 1 file changed, 1 insertion(+), 1 deletion(-)
122 +
123 +diff --git a/Code/BasicFilters/json/SLICImageFilter.json b/Code/BasicFilters/json/SLICImageFilter.json
124 +index 2ffba2f4c..0e9ced7d7 100644
125 +--- a/Code/BasicFilters/json/SLICImageFilter.json
126 ++++ b/Code/BasicFilters/json/SLICImageFilter.json
127 +@@ -156,7 +156,7 @@
128 + ]
129 + }
130 + ],
131 +- "itk_module" : "SimpleITKFilters",
132 ++ "itk_module" : "ITKSuperPixel",
133 + "detaileddescription" : "The Simple Linear Iterative Clustering (SLIC) algorithm groups pixels into a set of labeled regions or super-pixels. Super-pixels follow natural image boundaries, are compact, and are nearly uniform regions which can be used as a larger primitive for more efficient computation. The SLIC algorithm can be viewed as a spatially constrained iterative k-means method.\n\nThe original algorithm was designed to cluster on the joint domain of the images index space and it's CIELAB color space. This implementation works with images of arbitrary dimension as well as scalar, single channel, images and most multi-component image types including ITK's arbitrary length VectorImage .\n\nThe distance between a pixel and a cluster is the sum of squares of the difference between their joint range and domains ( index and value ). The computation is done in index space with scales provided by the SpatialProximityWeight parameters.\n\nThe output is a label image with each labe
134 l representing a superpixel cluster. Every pixel in the output is labeled, and the starting label id is zero.\n\nThis code was contributed in the Insight Journal paper: \"Scalable Simple Linear Iterative Clustering (SSLIC) Using a\nGeneric and Parallel Approach\" by Lowekamp B. C., Chen D. T., Yaniv Z.",
135 + "briefdescription" : "Simple Linear Iterative Clustering (SLIC) super-pixel segmentation."
136 + }
137
138 diff --git a/sci-libs/simpleitk/metadata.xml b/sci-libs/simpleitk/metadata.xml
139 new file mode 100644
140 index 000000000..1d31afb55
141 --- /dev/null
142 +++ b/sci-libs/simpleitk/metadata.xml
143 @@ -0,0 +1,19 @@
144 +<?xml version="1.0" encoding="UTF-8"?>
145 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
146 +<pkgmetadata>
147 + <maintainer type="project">
148 + <email>chr@×××××××.eu</email>
149 + <name>Horea Christian</name>
150 + </maintainer>
151 + <longdescription lang="en">
152 + SimpleITK is an image analysis toolkit with a large number of components
153 + supporting general filtering operations, image segmentation and registration.
154 + It is built on top of the Insight Segmentation and Registration Toolkit ITK
155 + with the intent of providing a simplified interface to ITK. SimpleITK itself
156 + is written in C++ but is available for a large number of programming
157 + languages.
158 + </longdescription>
159 + <upstream>
160 + <remote-id type="github">SimpleITK/SimpleITK</remote-id>
161 + </upstream>
162 +</pkgmetadata>
163
164 diff --git a/sci-libs/simpleitk/simpleitk-1.2.4.ebuild b/sci-libs/simpleitk/simpleitk-1.2.4.ebuild
165 new file mode 100644
166 index 000000000..331a5d23c
167 --- /dev/null
168 +++ b/sci-libs/simpleitk/simpleitk-1.2.4.ebuild
169 @@ -0,0 +1,65 @@
170 +# Copyright 1999-2021 Gentoo Authors
171 +# Distributed under the terms of the GNU General Public License v2
172 +
173 +EAPI=7
174 +
175 +PYTHON_COMPAT=( python3_{6..9} )
176 +LUA_COMPAT=( lua5-{1..3} )
177 +
178 +inherit lua-single toolchain-funcs cmake python-single-r1
179 +
180 +MY_PN="SimpleITK"
181 +
182 +DESCRIPTION="Layer on top of ITK for rapid prototyping, education and interpreted languages."
183 +HOMEPAGE="https://simpleitk.org/"
184 +SRC_URI="
185 + https://github.com/SimpleITK/SimpleITK/releases/download/v${PV}/SimpleITK-${PV}.tar.gz
186 + https://github.com/SimpleITK/SimpleITK/releases/download/v${PV}/SimpleITKData-${PV}.tar.gz
187 +"
188 +RESTRICT="primaryuri"
189 +
190 +LICENSE="Apache-2.0"
191 +SLOT="0"
192 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
193 +IUSE="python"
194 +
195 +RDEPEND="
196 + dev-lang/lua:0
197 + dev-cpp/gtest
198 + sci-libs/itk
199 + dev-python/virtualenv
200 +"
201 +DEPEND="
202 + ${RDEPEND}
203 + dev-lang/swig
204 +"
205 +
206 +PATCHES=(
207 + "${FILESDIR}/${P}-module.patch"
208 + "${FILESDIR}/${P}-int-cast.patch"
209 +)
210 +
211 +S="${WORKDIR}/${MY_PN}-${PV}"
212 +
213 +src_prepare() {
214 + cmake_src_prepare
215 + cp -rf "../${MY_PN}-${PV}/.ExternalData" "${BUILD_DIR}/" || die
216 +}
217 +
218 +src_configure() {
219 + local mycmakeargs=(
220 + -DUSE_SYSTEM_GTEST=ON
221 + -DUSE_SYSTEM_ITK=ON
222 + -DUSE_SYSTEM_LUA=ON
223 + -DUSE_SYSTEM_SWIG=ON
224 + -DUSE_SYSTEM_VIRTUALENV=ON
225 + -DBUILD_TESTING:BOOL=OFF
226 + -DSimpleITK_FORBID_DOWNLOADS=ON
227 + -DSimpleITK_PYTHON_USE_VIRTUALENV:BOOL=OFF
228 + -DSimpleITK_EXPLICIT_INSTANTIATION=OFF
229 + -DModule_SimpleITKFilters:BOOL=ON
230 + -DExternalData_OBJECT_STORES:STRING="${BUILD_DIR}/.ExternalData"
231 + -DSimpleITK_INSTALL_LIBRARY_DIR=$(get_libdir)
232 + )
233 + cmake_src_configure
234 +}