annotate src/of-dicom-1-fixes.patch @ 4383:3606cb5973b5

of-dicom: temporary fix
author John W. Eaton <jwe@octave.org>
date Thu, 27 Apr 2017 12:29:58 -0400
parents
children d28a54afe7e7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4383
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1 diff -uNr a/src/dicomdict.cpp b/src/dicomdict.cpp
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
2 --- a/src/dicomdict.cpp 2011-12-20 15:52:53.000000000 -0500
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
3 +++ b/src/dicomdict.cpp 2017-04-27 09:05:53.295379421 -0400
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
4 @@ -25,6 +25,8 @@
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
5 */
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
6
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
7 #include "octave/oct.h"
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
8 +#include "octave/octave.h"
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
9 +#include "octave/interpreter.h"
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
10 #include "octave/load-path.h"
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
11
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
12 #include "gdcm-2.0/gdcmDict.h"
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
13 @@ -256,12 +258,23 @@
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
14 }
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
15
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
16 // 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
17 + std::string resolved_filename(filename);
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
18 +
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
19 #ifndef NOT_OCT
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
20 - const std::string resolved_filename=load_path::find_file(std::string(filename)) ;
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
21 -#else
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
22 - // 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
23 - // so we just use the original filename
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
24 - const std::string resolved_filename(filename);
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25 + // Temporary fix. Eventually, a pointer to the Octave
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
26 + // interpreter should come from information passed to the
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
27 + // DEFUN function that called us, not from global data.
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
28 +
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
29 + octave::interpreter *interp = octave::application::the_interpreter ();
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
30 +
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
31 + if (interp)
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32 + {
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
33 + octave::load_path& lp = interp->get_load_path ();
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34 +
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35 + resolved_filename = lp.find_file (std::string (filename));
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
36 + }
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
37 + else
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
38 + warning ("load_dicom_dict: interpreter context missing");
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
39 #endif
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
40
3606cb5973b5 of-dicom: temporary fix
John W. Eaton <jwe@octave.org>
parents:
diff changeset
41 std::ifstream fin(resolved_filename.c_str());