public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Horea Christian" <horea.christ@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/sci:master commit in: sci-libs/simpleitk/files/, sci-libs/simpleitk/
Date: Sun,  3 Jan 2021 07:06:32 +0000 (UTC)	[thread overview]
Message-ID: <1609657580.a60da02d4be89f4e8dc338ffd488ef88dbe388a4.chymera@gentoo> (raw)

commit:     a60da02d4be89f4e8dc338ffd488ef88dbe388a4
Author:     Horea Christian <chr <AT> chymera <DOT> eu>
AuthorDate: Sun Jan  3 07:04:02 2021 +0000
Commit:     Horea Christian <horea.christ <AT> gmail <DOT> com>
CommitDate: Sun Jan  3 07:06:20 2021 +0000
URL:        https://gitweb.gentoo.org/proj/sci.git/commit/?id=a60da02d

sci-libs/simpleitk: new package

Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Horea Christian <chr <AT> chymera.eu>

 sci-libs/simpleitk/ChangeLog                       | 10 ++++
 .../simpleitk/files/simpleitk-1.2.4-int-cast.patch | 64 +++++++++++++++++++++
 .../simpleitk/files/simpleitk-1.2.4-module.patch   | 22 ++++++++
 sci-libs/simpleitk/metadata.xml                    | 19 +++++++
 sci-libs/simpleitk/simpleitk-1.2.4.ebuild          | 65 ++++++++++++++++++++++
 5 files changed, 180 insertions(+)

diff --git a/sci-libs/simpleitk/ChangeLog b/sci-libs/simpleitk/ChangeLog
new file mode 100644
index 000000000..308cd02b7
--- /dev/null
+++ b/sci-libs/simpleitk/ChangeLog
@@ -0,0 +1,10 @@
+  27 Nov 2020;  <chymera@gentoo.org> +files/0dfae3e_reversed.patch,
+  +files/77a3d89_reversed.patch, +files/simpleitk-1.2.4-int-cast.patch,
+  +files/simpleitk-1.2.4-module.patch, -simpleitk-1.2.3.ebuild,
+  simpleitk-1.2.4.ebuild, simpleitk-2.0.0.ebuild:
+  sci-libs/simpleitk: new package ahead of Gentoo Science
+
+*simpleitk-2.0.0 (25 Sep 2020)
+
+  25 Sep 2020;  <chymera@gentoo.org> +metadata.xml, +simpleitk-2.0.0.ebuild:
+  sci-libs/simpleitk: new package ahead of Gentoo Science

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
new file mode 100644
index 000000000..9477194c4
--- /dev/null
+++ b/sci-libs/simpleitk/files/simpleitk-1.2.4-int-cast.patch
@@ -0,0 +1,64 @@
+From 73caeaa545859cffd68f9aebe1e8b66de5ab812d Mon Sep 17 00:00:00 2001
+From: Bradley Lowekamp <blowekamp@mail.nih.gov>
+Date: Fri, 14 Feb 2020 09:35:29 -0500
+Subject: [PATCH] Explicitly cast int to ITK strongly typed enums
+
+---
+ Code/IO/src/sitkImageReaderBase.cxx | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/Code/IO/src/sitkImageReaderBase.cxx b/Code/IO/src/sitkImageReaderBase.cxx
+index b8c93a2ac..a5e6d9cd9 100644
+--- a/Code/IO/src/sitkImageReaderBase.cxx
++++ b/Code/IO/src/sitkImageReaderBase.cxx
+@@ -214,7 +214,7 @@ ::GetPixelIDFromImageIO( const ImageIOBase *iobase,
+   if (numberOfComponents == 1 &&
+       ( pixelType == itk::ImageIOBase::SCALAR || pixelType == itk::ImageIOBase::COMPLEX ) )
+     {
+-    outPixelType = this->ExecuteInternalReadScalar( componentType );
++    outPixelType = this->ExecuteInternalReadScalar( static_cast<int>(componentType) );
+     return;
+     }
+   // we try to load anything else into a VectorImage
+@@ -226,12 +226,12 @@ ::GetPixelIDFromImageIO( const ImageIOBase *iobase,
+             pixelType == itk::ImageIOBase::POINT ||
+             pixelType == itk::ImageIOBase::OFFSET )
+     {
+-    outPixelType = this->ExecuteInternalReadVector( componentType );
++    outPixelType = this->ExecuteInternalReadVector( static_cast<int>(componentType) );
+     return;
+     }
+   else if ( pixelType == itk::ImageIOBase::COMPLEX )
+     {
+-    outPixelType = this->ExecuteInternalReadComplex( componentType );
++    outPixelType = this->ExecuteInternalReadComplex( static_cast<int>(componentType) );
+     return;
+     }
+   else
+@@ -268,7 +268,7 @@ ::ExecuteInternalReadScalar( int componentType )
+ {
+   const unsigned int UnusedDimension = 2;
+ 
+-  switch(componentType)
++  switch(static_cast<ImageIOBase::IOComponentType>(componentType))
+     {
+     case itk::ImageIOBase::CHAR:
+       return ImageTypeToPixelIDValue< itk::Image<int8_t, UnusedDimension> >::Result;
+@@ -326,7 +326,7 @@ ::ExecuteInternalReadComplex( int componentType )
+ {
+   const unsigned int UnusedDimension = 2;
+ 
+-  switch(componentType)
++  switch(static_cast<ImageIOBase::IOComponentType>(componentType))
+     {
+     case itk::ImageIOBase::FLOAT:
+       return ImageTypeToPixelIDValue< itk::Image<std::complex<float>, UnusedDimension> >::Result;
+@@ -346,7 +346,7 @@ ::ExecuteInternalReadVector( int componentType )
+ {
+   const unsigned int UnusedDimension = 2;
+ 
+-  switch(componentType)
++  switch(static_cast<ImageIOBase::IOComponentType>(componentType))
+     {
+     case itk::ImageIOBase::CHAR:
+       return ImageTypeToPixelIDValue< itk::VectorImage<int8_t, UnusedDimension> >::Result;

diff --git a/sci-libs/simpleitk/files/simpleitk-1.2.4-module.patch b/sci-libs/simpleitk/files/simpleitk-1.2.4-module.patch
new file mode 100644
index 000000000..9b40d5e02
--- /dev/null
+++ b/sci-libs/simpleitk/files/simpleitk-1.2.4-module.patch
@@ -0,0 +1,22 @@
+From 9a9f67416683d69c1c8d2362ba6e50c4848803b2 Mon Sep 17 00:00:00 2001
+From: Bradley Lowekamp <blowekamp@mail.nih.gov>
+Date: Wed, 20 Nov 2019 15:30:50 -0500
+Subject: [PATCH] Update SLICImageFilter's module
+
+---
+ Code/BasicFilters/json/SLICImageFilter.json | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Code/BasicFilters/json/SLICImageFilter.json b/Code/BasicFilters/json/SLICImageFilter.json
+index 2ffba2f4c..0e9ced7d7 100644
+--- a/Code/BasicFilters/json/SLICImageFilter.json
++++ b/Code/BasicFilters/json/SLICImageFilter.json
+@@ -156,7 +156,7 @@
+       ]
+     }
+   ],
+-  "itk_module" : "SimpleITKFilters",
++  "itk_module" : "ITKSuperPixel",
+   "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
 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.",
+   "briefdescription" : "Simple Linear Iterative Clustering (SLIC) super-pixel segmentation."
+ }

diff --git a/sci-libs/simpleitk/metadata.xml b/sci-libs/simpleitk/metadata.xml
new file mode 100644
index 000000000..1d31afb55
--- /dev/null
+++ b/sci-libs/simpleitk/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="project">
+		<email>chr@chymera.eu</email>
+		<name>Horea Christian</name>
+	</maintainer>
+	<longdescription lang="en">
+		SimpleITK is an image analysis toolkit with a large number of components
+		supporting general filtering operations, image segmentation and registration.
+		It is built on top of the Insight Segmentation and Registration Toolkit ITK
+		with the intent of providing a simplified interface to ITK. SimpleITK itself
+		is written in C++ but is available for a large number of programming
+		languages.
+	</longdescription>
+	<upstream>
+		<remote-id type="github">SimpleITK/SimpleITK</remote-id>
+	</upstream>
+</pkgmetadata>

diff --git a/sci-libs/simpleitk/simpleitk-1.2.4.ebuild b/sci-libs/simpleitk/simpleitk-1.2.4.ebuild
new file mode 100644
index 000000000..331a5d23c
--- /dev/null
+++ b/sci-libs/simpleitk/simpleitk-1.2.4.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6..9} )
+LUA_COMPAT=( lua5-{1..3} )
+
+inherit lua-single toolchain-funcs cmake python-single-r1
+
+MY_PN="SimpleITK"
+
+DESCRIPTION="Layer on top of ITK for rapid prototyping, education and interpreted languages."
+HOMEPAGE="https://simpleitk.org/"
+SRC_URI="
+	https://github.com/SimpleITK/SimpleITK/releases/download/v${PV}/SimpleITK-${PV}.tar.gz
+	https://github.com/SimpleITK/SimpleITK/releases/download/v${PV}/SimpleITKData-${PV}.tar.gz
+"
+RESTRICT="primaryuri"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="python"
+
+RDEPEND="
+	dev-lang/lua:0
+	dev-cpp/gtest
+	sci-libs/itk
+	dev-python/virtualenv
+"
+DEPEND="
+	${RDEPEND}
+	dev-lang/swig
+"
+
+PATCHES=(
+	"${FILESDIR}/${P}-module.patch"
+	"${FILESDIR}/${P}-int-cast.patch"
+)
+
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+src_prepare() {
+	cmake_src_prepare
+	cp -rf "../${MY_PN}-${PV}/.ExternalData" "${BUILD_DIR}/" || die
+}
+
+src_configure() {
+	local mycmakeargs=(
+		-DUSE_SYSTEM_GTEST=ON
+		-DUSE_SYSTEM_ITK=ON
+		-DUSE_SYSTEM_LUA=ON
+		-DUSE_SYSTEM_SWIG=ON
+		-DUSE_SYSTEM_VIRTUALENV=ON
+		-DBUILD_TESTING:BOOL=OFF
+		-DSimpleITK_FORBID_DOWNLOADS=ON
+		-DSimpleITK_PYTHON_USE_VIRTUALENV:BOOL=OFF
+		-DSimpleITK_EXPLICIT_INSTANTIATION=OFF
+		-DModule_SimpleITKFilters:BOOL=ON
+		-DExternalData_OBJECT_STORES:STRING="${BUILD_DIR}/.ExternalData"
+		-DSimpleITK_INSTALL_LIBRARY_DIR=$(get_libdir)
+	)
+	cmake_src_configure
+}


                 reply	other threads:[~2021-01-03  7:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1609657580.a60da02d4be89f4e8dc338ffd488ef88dbe388a4.chymera@gentoo \
    --to=horea.christ@gmail.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox