annotate src/of-dicom-1-fixes.patch @ 4386:d28a54afe7e7

of-dicom: update patch to work for both stable and dev octave * src/of-dicom-1-fixes.patch: update patch from dicom repo * src/of-dicom.mk: call autoreconfig on src directory
author John D
date Tue, 16 May 2017 08:36:10 -0400
parents 3606cb5973b5
children f45182733409
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4386
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
1 diff -r c6fc977bc48a src/Makefile.in
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
2 --- a/src/Makefile.in Thu Feb 23 08:34:52 2017 +0100
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
3 +++ b/src/Makefile.in Tue May 16 08:25:04 2017 -0400
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
4 @@ -4,6 +4,8 @@
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
5 GDCM_CPPFLAGS = @GDCM_CXXFLAGS@
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
6 GDCM_LIBS = @GDCM_LIBS@
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
7
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
8 +OCTAVE_DEFS = -DHAVE_OCTAVE_LOAD_PATH=@HAVE_OCTAVE_LOAD_PATH@
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
9 +
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
10 need_dict = dicominfo.oct dicomwrite.oct dicomlookup.oct
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
11
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
12 test_files = dicominfo.cpp dicomdict.cpp dicomread.cpp dicomlookup.cpp isdicom.cpp dicomuid.oct
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
13 @@ -11,13 +13,13 @@
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
14 all: $(need_dict) dicomdict.oct dicomread.oct _gendicomdict.oct isdicom.oct dicomuid.oct
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
15
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
16 %.o: %.cpp
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
17 - $(MKOCTFILE) $(GDCM_CPPFLAGS) -c $<
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
18 + $(MKOCTFILE) $(OCTAVE_DEFS) $(GDCM_CPPFLAGS) -c $<
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
19
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
20 $(need_dict): %.oct: %.cpp dicomdict.o
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
21 - $(MKOCTFILE) $(GDCM_CPPFLAGS) $(GDCM_LIBS) $^
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
22 + $(MKOCTFILE) $(OCTAVE_DEFS) $(GDCM_CPPFLAGS) $(GDCM_LIBS) $^
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
23
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
24 %.oct: %.cpp
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
25 - $(MKOCTFILE) $(GDCM_CPPFLAGS) $(GDCM_LIBS) $<
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
26 + $(MKOCTFILE) $(OCTAVE_DEFS) $(GDCM_CPPFLAGS) $(GDCM_LIBS) $<
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
27
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
28 clean:
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
29 $(RM) *.o *.oct *~
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
30 diff -r c6fc977bc48a src/configure.ac
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
31 --- a/src/configure.ac Thu Feb 23 08:34:52 2017 +0100
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
32 +++ b/src/configure.ac Tue May 16 08:25:04 2017 -0400
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
33 @@ -6,9 +6,48 @@
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
34
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
35 AC_PROG_SED
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
36
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
37 +AC_PATH_PROG([MKOCTFILE], [mkoctfile])
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
38 +if test -z "$MKOCTFILE"; then
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
39 + AC_MSG_ERROR([*** 'mkoctfile' not found.])
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
40 +fi
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
41 +
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
42 AC_PROG_CXX
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
43 AC_LANG(C++)
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
44
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
45 +## octave API tests
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
46 +save_CXX="$CXX"
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
47 +save_CXXFLAGS="$CXXFLAGS"
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
48 +CXX=`${MKOCTFILE} -p CXX`
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
49 +CXXFLAGS="$CXXFLAGS -I`$MKOCTFILE -p OCTINCLUDEDIR`"
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
50 +
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
51 +# need to use interpreter->get_load_path in dev version of octave,
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
52 +# prior to that methods of load_path were static
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
53 +AC_CACHE_CHECK(
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
54 + [interpreter get_load_path],
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
55 + [octave_cv_interpreter_get_load_path],
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
56 + [AC_COMPILE_IFELSE(
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
57 + [AC_LANG_PROGRAM([
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
58 + #include <oct.h>
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
59 + #include <octave.h>
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
60 + #include <interpreter.h>
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
61 + #include <load-path.h>
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
62 + ],
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
63 + [
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
64 + octave::load_path &p = octave::application::the_interpreter ()->get_load_path ();
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
65 + ])],
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
66 + [octave_cv_interpreter_get_load_path=yes],
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
67 + [octave_cv_interpreter_get_load_path=no])
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
68 + ])
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
69 +if test "$octave_cv_interpreter_get_load_path" = "yes" ; then
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
70 + HAVE_OCTAVE_LOAD_PATH=1
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
71 +else
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
72 + HAVE_OCTAVE_LOAD_PATH=0
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
73 +fi
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
74 +AC_SUBST(HAVE_OCTAVE_LOAD_PATH)
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
75 +
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
76 +CC=$save_CXX
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
77 +CXXFLAGS=$save_CXXFLAGS
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
78 +
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
79 dnl
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
80 dnl GDCM headers are in a version specific path. They use CMake and
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
81 dnl provide a project.cmake config file which has the correct flags to
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
82 diff -r c6fc977bc48a src/dicomdict.cpp
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
83 --- a/src/dicomdict.cpp Thu Feb 23 08:34:52 2017 +0100
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
84 +++ b/src/dicomdict.cpp Tue May 16 08:25:04 2017 -0400
4383
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
85 @@ -25,6 +25,8 @@
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
86 */
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
87
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
88 #include "octave/oct.h"
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
89 +#include "octave/octave.h"
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
90 +#include "octave/interpreter.h"
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
91 #include "octave/load-path.h"
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
92
4386
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
93 #include "gdcmDict.h"
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
94 @@ -263,13 +265,20 @@
4383
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
95 }
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
96
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
97 // find dic if it is anywhere in the search path (same path as for m-files etc)
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
98 + std::string resolved_filename(filename);
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
99 #ifndef NOT_OCT
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
100 - const std::string resolved_filename=load_path::find_file(std::string(filename)) ;
4386
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
101 +#if HAVE_OCTAVE_LOAD_PATH == 1
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
102 + octave::interpreter *interp = octave::application::the_interpreter ();
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
103 + if (interp) {
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
104 + octave::load_path& lp = interp->get_load_path ();
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
105 + resolved_filename = lp.find_file (std::string (filename));
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
106 + }
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
107 + else
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
108 + warning ("load_dicom_dict: interpreter context missing");
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
109 #else
4383
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
110 - // for debugging: if not running in octave, find_file always returns ""
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
111 - // so we just use the original filename
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
112 - const std::string resolved_filename(filename);
4386
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
113 -#endif
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
114 + resolved_filename=load_path::find_file(std::string(filename));
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
115 +#endif // HAVE_OCTAVE_LOAD_PATH
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
116 +#endif // NOT_OCT
4383
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
117
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
118 std::ifstream fin(resolved_filename.c_str());
4386
d28a54afe7e7 of-dicom: update patch to work for both stable and dev octave
John D
parents: 4383
diff changeset
119 if (!fin) {