diff mbox series

[bug#60640] Gnu: Add gdcm

Message ID 877cxyp1wf.fsf@gmail.com
State New
Headers show
Series [bug#60640] Gnu: Add gdcm | expand

Commit Message

Tor-björn Claesson Jan. 7, 2023, 7:40 p.m. UTC
gnu/packages/image-processing.scm | 72 +++++++++++++++++++++++++++++++
 1 file changed, 72 insertions(+)

Comments

Tor-björn Claesson Jan. 8, 2023, 7:59 a.m. UTC | #1
Hi!

This patch adds GDCM (a nice C++ library for DICOM, as in medical imaging),
with a few wharts:
1. I have not yet been able to build the bin output,
which consists of utilities for manipulating DICOM data. 

2. It does not build pdf-documentation, since that would require
texlive as a native input.

3. It does not perform tests.

4. It uses socketxx, ljpeg and papyrus3 from the gdcm sources. 

5. I'm not sure how to specify util-linux:bin as an input?

Cheers,
Tor-björn Claesson

help-debbugs@gnu.org (GNU bug Tracking System) writes:

> Thank you for filing a new bug report with debbugs.gnu.org.
>
> This is an automatically generated reply to let you know your message
> has been received.
>
> Your message is being forwarded to the package maintainers and other
> interested parties for their attention; they will reply in due course.
>
> Your message has been sent to the package maintainer(s):
>  guix-patches@gnu.org
>
> If you wish to submit further information on this problem, please
> send it to 60640@debbugs.gnu.org.
>
> Please do not send mail to help-debbugs@gnu.org unless you wish
> to report a problem with the Bug-tracking system.
Tor-björn Claesson Jan. 8, 2023, 8:04 a.m. UTC | #2
Den sön 8 jan. 2023 kl 10:00 skrev Tor-björn Claesson <tclaesson@gmail.com>:

>
> 5. I'm not sure how to specify util-linux:bin as an input?
>
I mean util-linux:lib...
Tobias Geerinckx-Rice Jan. 9, 2023, 8:28 a.m. UTC | #3
Hi Tor-björn,

On 8 January 2023 08:04:40 UTC, "Tor-björn Claesson" <tclaesson@gmail.com> wrote:
>Den sön 8 jan. 2023 kl 10:00 skrev Tor-björn Claesson <tclaesson@gmail.com>:
>
>>
>> 5. I'm not sure how to specify util-linux:bin as an input?
>>
>I mean util-linux:lib...

Exactly like you did.  Are you seeing util-linux-related failures?


Kind regards,

T G-R

Sent on the go.  Excuse or enjoy my brevity.
Tor-björn Claesson Jan. 9, 2023, 10:50 a.m. UTC | #4
Hi Tobias,
thanks for taking the time to comment!

Tobias Geerinckx-Rice <me@tobias.gr> writes:
> Hi Tor-björn,
>
> On 8 January 2023 08:04:40 UTC, "Tor-björn Claesson" <tclaesson@gmail.com> wrote:
>>Den sön 8 jan. 2023 kl 10:00 skrev Tor-björn Claesson <tclaesson@gmail.com>:
>>
>>>
>>> 5. I'm not sure how to specify util-linux:bin as an input?
>>>
>>I mean util-linux:lib...
>
> Exactly like you did.  Are you seeing util-linux-related failures?
>
>
> Kind regards,
>
> T G-R
>
> Sent on the go.  Excuse or enjoy my brevity.

No failures, only guix lint tells me "gdcm@3.0.20: label 'util-linux'
does not match package name 'util-linux:lib'", so I thought I might be
doing something wrong. If not then all fine on that front.
\( Jan. 10, 2023, 7:01 a.m. UTC | #5
On Mon Jan 9, 2023 at 10:50 AM GMT, Tor-björn Claesson wrote:
> No failures, only guix lint tells me "gdcm@3.0.20: label 'util-linux'
> does not match package name 'util-linux:lib'", so I thought I might be
> doing something wrong. If not then all fine on that front.

Oh, that's fine.  I don't think there's a way to fix that at the moment.

    -- (
Tobias Geerinckx-Rice Jan. 10, 2023, 2:40 p.m. UTC | #6
Hi again,

Tor-björn Claesson 写道:
> This patch adds GDCM (a nice C++ library for DICOM, as in 
> medical imaging),
> with a few wharts:

I'll answer your questions later, but have started the build 
before I go out.

The build appears to be running something like

  until fc-something; do :; done

in an infinite loop, spamming the build log at best and slowing 
down the build at worst.

Did you notice that too?

Kind regards,

T G-R
Tor-björn Claesson Jan. 10, 2023, 3:10 p.m. UTC | #7
Hi!


I'll answer your questions later, but have started the build
> before I go out.
>
> The build appears to be running something like
>
>   until fc-something; do :; done
>
> in an infinite loop, spamming the build log at best and slowing
> down the build at worst.
>
> Did you notice that too?
>

I get a lot of "Fontconfig error: No writable cache directories" which
appeared after adding graphviz as a native input for building
documentation. Is this what you are meaning?

Thanks=)
Tor-björn
Ludovic Courtès Jan. 12, 2023, 10:17 p.m. UTC | #8
Hi!

Tor-björn Claesson <tclaesson@gmail.com> skribis:

> This patch adds GDCM (a nice C++ library for DICOM, as in medical imaging),
> with a few wharts:

Commit 15caeb745c5d77b69905d38d43b4d09742bc71b6, pushed a couple of days
ago, adds GDCM (although the patch was much older).

Could you check if anything’s missing compared to your version?

Thanks,
Ludo’.
Tor-björn Claesson Jan. 13, 2023, 10:45 a.m. UTC | #9
Hi!

Ludovic Courtès <ludo@gnu.org> writes:

>
> Commit 15caeb745c5d77b69905d38d43b4d09742bc71b6, pushed a couple of days
> ago, adds GDCM (although the patch was much older).
>
> Could you check if anything’s missing compared to your version?
>
> Thanks,
> Ludo’.

Yes, that was great!
The pushed patch is version 2.8, whereas my patch is version 3.0. I was
able to port my application to 2.8 in 3 minutes, so I don't notice big
functional differences=)

Also it does tests, which I did not get to work yet, but it does not
specify system libraries.

Cheers,
Tor-björn Claesson
Ludovic Courtès Jan. 13, 2023, 11:50 p.m. UTC | #10
Hi,

Tor-björn Claesson <tclaesson@gmail.com> skribis:

> The pushed patch is version 2.8, whereas my patch is version 3.0. I was
> able to port my application to 2.8 in 3 minutes, so I don't notice big
> functional differences=)
>
> Also it does tests, which I did not get to work yet, but it does not
> specify system libraries.

Could you send (in this issue) one patch that updates to 3.0, and
another one to use system libraries?

That’d be perfect!

Thanks in advance,
Ludo’.
Tor-björn Claesson Jan. 14, 2023, 8:19 a.m. UTC | #11
Hi,
Den lör 14 jan. 2023 kl 01:50 skrev Ludovic Courtès <ludo@gnu.org>:

>
> Could you send (in this issue) one patch that updates to 3.0, and
> another one to use system libraries?
>

I have a working update to 3.0.20. Except for other possible differences,
GDCM changes the name of the include directory between versions; I have to
e.g. #include <gdcm-2.8/gdcmImage.h> vs. <gdcm-3.0/gdcmImage.h>. How should
we deal with this? Would it make sense to leave a gdcm-2.8 package, to
cater for users of the older version, or should we expect people to follow
along?

Best regards!
Tor-björn
Sharlatan Hellseher Feb. 19, 2024, 10:41 p.m. UTC | #12
Hi,

GDCM was added back in 2022 by the commit 15caeb745c5d77b69905d38d43b4d09742bc71b6.

--8<---------------cut here---------------start------------->8---
15caeb745c5d77b69905d38d43b4d09742bc71b6
Author:     Antero Mejr <antero@mailbox.org>
AuthorDate: Wed Jun 15 15:39:53 2022 +0000
Commit:     Ludovic Courtès <ludo@gnu.org>
CommitDate: Sun Jan 8 16:11:45 2023 +0100

gnu: Add gdcm.

* gnu/packages/bioinformatics.scm (gdcm): New variable.
--8<---------------cut here---------------end--------------->8---

And it's on the 3.0.20.

Closing as already availale.

Thanks,
Oleg
diff mbox series

Patch

diff --git a/gnu/packages/image-processing.scm b/gnu/packages/image-processing.scm
index 70c820e76b..271593b5f9 100644
--- a/gnu/packages/image-processing.scm
+++ b/gnu/packages/image-processing.scm
@@ -99,6 +99,7 @@  (define-module (gnu packages image-processing)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages version-control)
   #:use-module (gnu packages video)
+  #:use-module (gnu packages web)
   #:use-module (gnu packages xiph)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xorg)
@@ -1776,3 +1777,74 @@  (define-public charls
  to have them encoded to JPEG-LS, or JPEG-LS streams, which CharLS will decode
 to images.")
     (license license:bsd-3)))
+
+(define-public gdcm
+  (package
+    (name "gdcm")
+    (version "3.0.20")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/malaterre/GDCM/")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1w78cmm9q7aavs7svdkl4dgilcqk4yazci9m6x7icrssb7cj991i"))))
+    (build-system cmake-build-system)
+    (outputs '("out" "doc"))
+    (arguments
+     (list #:tests? #f
+           #:phases #~(modify-phases %standard-phases
+                        (add-before 'configure 'set-LDFLAGS
+                          (lambda* (#:key inputs outputs #:allow-other-keys)
+                            (setenv "LDFLAGS"
+                                    (string-append "-Wl,-rpath="
+                                                   #$output "/lib"))))
+                        (add-before 'build 'patch-gdcm-charls.h
+                          (lambda _
+                            (substitute* "../source/Utilities/gdcm_charls.h"
+                              (("# include <CharLS/charls.h>")
+                               "# include <charls/charls.h>")) #t)))
+           #:configure-flags #~(list "-DCMAKE_SKIP_RPATH:BOOL=YES"
+                                     "-DCMAKE_BUILD_TYPE:STRING=Release"
+                                     "-DCMAKE_C_FLAGS=-fvisibility=hidden"
+                                     "-DCMAKE_CXX_FLAGS=-fvisibility=hidden"
+                                     "-DGDCM_BUILD_SHARED_LIBS:BOOL=ON"
+                                     "-DGDCM_DOCUMENTATION:BOOL=ON"
+                                     "-DGDCM_USE_SYSTEM_EXPAT:BOOL=ON"
+                                     "-DGDCM_USE_SYSTEM_ZLIB:BOOL=ON"
+                                     "-DGDCM_USE_SYSTEM_CHARLS:BOOL=ON"
+                                     "-DGDCM_USE_SYSTEM_POPPLER:BOOL=ON"
+                                     "-DGDCM_USE_SYSTEM_LIBXML2:BOOL=ON"
+                                     "-DGDCM_USE_SYSTEM_JSON:BOOL=ON"
+                                     "-DGDCM_USE_SYSTEM_UUID:BOOL=ON"
+                                     "-DGDCM_USE_SYSTEM_OPENJPEG:BOOL=ON"
+                                     "-DGDCM_USE_SYSTEM_OPENSSL:BOOL=ON"
+                                     "-DGDCM_PDF_DOCUMENTATION:BOOL=OFF"
+                                     "-DGCM_BUILD_TESTING:BOOL=OFF"
+                                     "-DGDCM_BUILD_APPLICATIONS:BOOL=OFF"
+                                     "-DGDCM_USE_SYSTEM_PAPYRUS3:BOOL=OFF"
+                                     "-DGDCM_USE_SYSTEM_SOCKETXX:BOOL=OFF"
+                                     "-DGDCM_USE_SYSTEM_LJPEG:BOOL=OFF")))
+    (inputs (list openssl
+                  expat
+                  charls
+                  poppler
+                  libxml2
+                  json-c
+                  openjpeg
+                  `(,util-linux "lib")
+                  zlib))
+    (native-inputs (list git pkg-config doxygen graphviz))
+    (home-page "https://gdcm.sourceforge.net")
+    (synopsis
+     "C++ library dedicated to reading/parsing and writing DICOM medical files")
+    (description
+     "Grassroots DICOM (GDCM) is an implementation of the DICOM standard
+designed to be open source so that researchers may access clinical data
+directly.  GDCM includes a file format definition and a network communications
+protocol, both of which should be extended to provide a full set of tools for
+a researcher or small medical imaging vendor to interface with an existing
+medical database.")
+    (license license:bsd-3)))