4383
|
1 diff -uNr a/src/dicomdict.cpp b/src/dicomdict.cpp |
|
2 --- a/src/dicomdict.cpp 2011-12-20 15:52:53.000000000 -0500 |
|
3 +++ b/src/dicomdict.cpp 2017-04-27 09:05:53.295379421 -0400 |
|
4 @@ -25,6 +25,8 @@ |
|
5 */ |
|
6 |
|
7 #include "octave/oct.h" |
|
8 +#include "octave/octave.h" |
|
9 +#include "octave/interpreter.h" |
|
10 #include "octave/load-path.h" |
|
11 |
|
12 #include "gdcm-2.0/gdcmDict.h" |
|
13 @@ -256,12 +258,23 @@ |
|
14 } |
|
15 |
|
16 // find dic if it is anywhere in the search path (same path as for m-files etc) |
|
17 + std::string resolved_filename(filename); |
|
18 + |
|
19 #ifndef NOT_OCT |
|
20 - const std::string resolved_filename=load_path::find_file(std::string(filename)) ; |
|
21 -#else |
|
22 - // for debugging: if not running in octave, find_file always returns "" |
|
23 - // so we just use the original filename |
|
24 - const std::string resolved_filename(filename); |
|
25 + // Temporary fix. Eventually, a pointer to the Octave |
|
26 + // interpreter should come from information passed to the |
|
27 + // DEFUN function that called us, not from global data. |
|
28 + |
|
29 + octave::interpreter *interp = octave::application::the_interpreter (); |
|
30 + |
|
31 + if (interp) |
|
32 + { |
|
33 + octave::load_path& lp = interp->get_load_path (); |
|
34 + |
|
35 + resolved_filename = lp.find_file (std::string (filename)); |
|
36 + } |
|
37 + else |
|
38 + warning ("load_dicom_dict: interpreter context missing"); |
|
39 #endif |
|
40 |
|
41 std::ifstream fin(resolved_filename.c_str()); |