help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dicom package on Mac OS X


From: Miloslav Polasek
Subject: Re: Dicom package on Mac OS X
Date: Mon, 16 Jun 2014 19:35:01 +0200

Hi again,

thanks to everyone for their responses. It seems that I made it work! I had to do the following:

1. uninstall Octave (which was installed from dmg file)
2. install Homebrew (http://brew.sh/)
  2a. brew doctor (here it complained about previously installed static GDCM libraries, so I deleted them)
3. followed guide to install Octave for Mac using Homebrew (http://wiki.octave.org/Octave_for_MacOS_X#Homebrew)
  3a. minor exception is that I was not able to install gfortran, instead it suggested installing gcc (brew install gcc)
4. before I could start with installation of Octave I had to download and install LaTeX for mac (MacTex-2014)
5. install Octave (brew install octave)

The installation ran for about an hour. When done, I was able to launch Octave from the Terminal with:
 octave --force-gui
However, at this point there was a problem with plotting and launching X11. This was fixed by creating .octaverc file in my home directory and adding the line:
setenv ("GNUTERM", "X11”)

6. Installed again the supporting GDCM library from source code through Makefile as described here: http://wiki.octave.org/Dicom_package
Here I decided to go with an older version of the library (gdcm-2.0.19)

7. Exported the path to the library with
  export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/lib
  7a. Here I checked again with 
        echo $DYLD_LIBRARY_PATH
        that gave the right answer: 
        :/usr/local/lib
        It is a bit weird, because this information should be stored in .bashrc file in the home directory. There was no such file, so I created it. But even after exporting the path, the file contained no information. So, where is the path stored? Nevertheless, it works somehow.

8. I took the dicom package and did the corrections that Sebastian suggested earlier (I omitted the one line that was only required when working with gdcm 2.4, because I decided to use gdcm 2.0):

#extract package 
tar -zxvf dicom-0.1.1.tar.gz 
#add correct include and libdirs 
perl -pi -e 's/INCDIRFLAGS =.*/INCDIRFLAGS =\t-I\/usr\/local\/include/' dicom/src/Makefile 
perl -pi -e 's/LIBDIRFLAGS =.*/LIBDIRFLAGS =\t-L\/usr\/local\/lib/' dicom/src/Makefile 
# repack 
tar -zcvf dicom-0.1.1patched.tar.gz dicom

9. Launched Octave (octave --force-gui) and installed the patched package with:
  pkg install dicom-0.1.1patched.tar.gz
It gave me some warnings (see below), but the package seems to be installed and working. I tried some real data that I have from an MRI scanner and it was able to load the dicom information and the imaging data correctly. Basically, I have no idea what I was doing, but I am happy that I can work with dicom files on my Mac now :-)

Miloslav


The warnings that I got during Dicom package installation:


>> pkg install dicom-0.1.1patched.tar.gz
dicominfo.cpp:79:1: warning: 'Octave_map' is deprecated [-Wdeprecated-declarations]
Octave_map dump(const char filename[], int chatty);
^
/usr/local/Cellar/octave/3.8.1/include/octave-3.8.1/octave/oct-map.h:484:1: note: 'Octave_map' declared here
Octave_map
^
dicominfo.cpp:80:18: warning: 'Octave_map' is deprecated [-Wdeprecated-declarations]
void dumpDataSet(Octave_map *om, const gdcm::DataSet *ds, int chatty, int sequenceDepth);
                 ^
/usr/local/Cellar/octave/3.8.1/include/octave-3.8.1/octave/oct-map.h:484:1: note: 'Octave_map' declared here
Octave_map
^
dicominfo.cpp:82:18: warning: 'Octave_map' is deprecated [-Wdeprecated-declarations]
void dumpElement(Octave_map *om, const gdcm::DataElement * elem, int chatty, int sequenceDepth);
                 ^
/usr/local/Cellar/octave/3.8.1/include/octave-3.8.1/octave/oct-map.h:484:1: note: 'Octave_map' declared here
Octave_map
^
dicominfo.cpp:166:2: warning: 'Octave_map' is deprecated [-Wdeprecated-declarations]
        Octave_map om=dump(filename.c_str(),chatty);
        ^
/usr/local/Cellar/octave/3.8.1/include/octave-3.8.1/octave/oct-map.h:484:1: note: 'Octave_map' declared here
Octave_map
^
dicominfo.cpp:175:1: warning: 'Octave_map' is deprecated [-Wdeprecated-declarations]
Octave_map dump(const char filename[], int chatty) {
^
/usr/local/Cellar/octave/3.8.1/include/octave-3.8.1/octave/oct-map.h:484:1: note: 'Octave_map' declared here
Octave_map
^
dicominfo.cpp:177:2: warning: 'Octave_map' is deprecated [-Wdeprecated-declarations]
        Octave_map om;
        ^
/usr/local/Cellar/octave/3.8.1/include/octave-3.8.1/octave/oct-map.h:484:1: note: 'Octave_map' declared here
Octave_map
^
dicominfo.cpp:205:18: warning: 'Octave_map' is deprecated [-Wdeprecated-declarations]
void dumpDataSet(Octave_map *om, const gdcm::DataSet *ds, int chatty, int sequenceDepth) {
                 ^
/usr/local/Cellar/octave/3.8.1/include/octave-3.8.1/octave/oct-map.h:484:1: note: 'Octave_map' declared here
Octave_map
^
dicominfo.cpp:215:18: warning: 'Octave_map' is deprecated [-Wdeprecated-declarations]
void dumpElement(Octave_map *om, const gdcm::DataElement * elem,
                 ^
/usr/local/Cellar/octave/3.8.1/include/octave-3.8.1/octave/oct-map.h:484:1: note: 'Octave_map' declared here
Octave_map
^
dicominfo.cpp:456:2: warning: 'Octave_map' is deprecated [-Wdeprecated-declarations]
        Octave_map om;
        ^
/usr/local/Cellar/octave/3.8.1/include/octave-3.8.1/octave/oct-map.h:484:1: note: 'Octave_map' declared here
Octave_map
^
dicominfo.cpp:459:3: warning: 'Octave_map' is deprecated [-Wdeprecated-declarations]
                Octave_map subom;
                ^
/usr/local/Cellar/octave/3.8.1/include/octave-3.8.1/octave/oct-map.h:484:1: note: 'Octave_map' declared here
Octave_map
^
10 warnings generated.
dicomwrite.cpp:46:55: warning: 'Octave_map' is deprecated [-Wdeprecated-declarations]
void structarray2sequence(gdcm::SequenceOfItems & sq, Octave_map * om, bool trial, int sequenceDepth);
                                                      ^
/usr/local/Cellar/octave/3.8.1/include/octave-3.8.1/octave/oct-map.h:484:1: note: 'Octave_map' declared here
Octave_map
^
dicomwrite.cpp:135:2: warning: 'Octave_map' is deprecated [-Wdeprecated-declarations]
        Octave_map om=ov.map_value();
        ^
/usr/local/Cellar/octave/3.8.1/include/octave-3.8.1/octave/oct-map.h:484:1: note: 'Octave_map' declared here
Octave_map
^
dicomwrite.cpp:182:55: warning: 'Octave_map' is deprecated [-Wdeprecated-declarations]
void structarray2sequence(gdcm::SequenceOfItems & sq, Octave_map * om, bool trial, int sequenceDepth) {
                                                      ^
/usr/local/Cellar/octave/3.8.1/include/octave-3.8.1/octave/oct-map.h:484:1: note: 'Octave_map' declared here
Octave_map
^
dicomwrite.cpp:190:3: warning: 'Octave_map' is deprecated [-Wdeprecated-declarations]
                Octave_map subom = cell(0).map_value();
                ^
/usr/local/Cellar/octave/3.8.1/include/octave-3.8.1/octave/oct-map.h:484:1: note: 'Octave_map' declared here
Octave_map
^
dicomwrite.cpp:292:3: warning: 'Octave_map' is deprecated [-Wdeprecated-declarations]
                Octave_map subom = ov->map_value();
                ^
/usr/local/Cellar/octave/3.8.1/include/octave-3.8.1/octave/oct-map.h:484:1: note: 'Octave_map' declared here
Octave_map
^
5 warnings generated.


On Jun 5, 2014, at 5:42 PM, andy buckle [via Octave] <address@hidden> wrote:




On 5 June 2014 16:04, c. <[hidden email]> wrote:

On 4 Jun 2014, at 13:16, Miloslav Polasek <[hidden email]> wrote:

> Ok, would you be so kind and provide a fool-proof list of commands that I need to run to test this?
> Thanks,
> M.

no sorry, I don't even know exactly what dicom is nor do I know what libraries you
need to link to, so I'm afraid I'm not able to help further.

c.

If you can't compile it, I doubt I can help. (I know nothing of OSX)

If you have compiled it, there are test bits in the source. If you have compiled it, and you have the source too, these octave commands will tun tests. (These are all the working functions)
test dicominfo.cpp
test dicomdict.cpp
test dicomread.cpp
test dicomlookup.cpp
test isdicom.m
It has not been migrated to mercurial, but the source is still here (svn), and can be downloaded
http://sourceforge.net/p/octave/code/HEAD/tree/trunk/octave-forge/extra/dicom/

There are example dicom files, required for the tests, which are there too. I should be able to help you run the tests, after it s compiled.

--
/* andy buckle */

_______________________________________________
Help-octave mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-octave



If you reply to this email, your message will be added to the discussion below:
http://octave.1599824.n4.nabble.com/Dicom-package-on-Mac-OS-X-tp4664365p4664485.html
To unsubscribe from Dicom package on Mac OS X, click here.
NAML


reply via email to

[Prev in Thread] Current Thread [Next in Thread]