Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
neurosnap committed Feb 28, 2014
1 parent e8ca06f commit 5d0b2d5
Showing 1 changed file with 165 additions and 74 deletions.
239 changes: 165 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,74 +33,125 @@ It uses gunicorn as the WSGI HTTP Server and nginx as the Proxy HTTP Server.
INSTALL
=========

Windows
---------
#### HOW TO DEVELOP ON DEBIAN-DIST (UBUNTU)

##### Prereqs

* Python 2.7 (determine whether 32 or 64 bit)
* Microsoft Visual C++ 2008 Redistributable Package
(identical 32 or 64 bit as python)
[32 bit](http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=29)
[64 bit](http://www.microsoft.com/en-us/download/details.aspx?id=15336)
* Git

##### Download DCMDB

SSH - git@github.com:neurosnap/dcmdb.git

[HTTPS](https://github.com/neurosnap/dcmdb.git)
```
$ apt-get update
$ apt-get upgrade
$ apt-get install python-pip
$ pip install virtualenv
$ mkdir ~/.virtualenvs
$ pip install virtualenvwrapper
$ vim ~/.bash_profile
```

in .bash_profile
```
$ git clone git@github.com:neurosnap/dcmdb.git
$ cd dcmdb
export WORKON_HOME=~/.virtualenvs
/usr/local/bin/virtualenvwrapper.sh
```

Download: https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
Install setuptools
Make a virtualenv
```
$ mkvirtualenv dcmdb
```

##### setuptools
Start working on a virtualenv (after mkvirtualenv it usually loads right into the virt)
```
$ cd /path/to/ez_setup.py
$ python ez_setup.py install
$ workon dcmdb
```

##### Install PIP
deactivate virtualenv (just an example, dont do this now)
```
$ easy_install pip
$ deactivate
```

##### Install the rest of the dependencies that actually work through PIP
Now install python dependencies
```
$ pip install -r dependencies.txt
$ pip install -r ./conf/dependencies.txt
```

dependencies.txt
```
Django==1.5.4
Pillow==2.2.1
South==0.8.2
psycopg2==2.5.1
argparse==1.2.1
gunicorn==18.0
matplotlib==1.3.0
nose==1.3.0
numpy==1.7.1
psycopg2==2.5.1
pydicom==0.9.8
pyparsing==2.0.1
python-dateutil==2.1
setproctitle==1.1.8
six==1.4.1
bleach==1.2.2
html5lib==0.95
tornado==3.1.1
yolk==0.4.3
```

##### Install Postgresql
##### HOW TO INSTALL GDCM

http://www.postgresql.org/download/windows/
###### PRE-REQS

Set password for "postgres" user
Open pgAdmin III
Connect to PostgreSQL
Create database "dcmdb" set owner to "postgres"
```
apt-get install cmake-curses-gui
apt-get install libpcre3 libpcre3-dev
```

###### SWIG

* Download the latest version of SWIG
* Extract compressed file e.g. swig-2.0.11

```
$ cd swig-2.0.11
$ ./configure
$ make
$ make install
```

###### GDCM

* Download the latest version of GDCM
* Extract compressed file e.g. gdcm.tar.bz2

```
$ mkdir gdcm-build
$ cd gdcm
$ rm CMakeCache.txt
$ cd ../gdcm-build
$ ccmake ../gdcm
```

* Screen will come up,
* Press [T] to go to advanced mode
* SET CMAKE\_C\_FLAGS to -fPIC
* SET CMAKE\_CXX\_FLAGS to -fPIC [Could be optional]
* Press [C] to configure
* SET GDCM\_WRAP\_PYTHON to ON
* [G] to generate

```
$ make
$ make install
```

##### Set up local django settings file
###### Git

```
$ apt-get install git-core
```

##### Download DCMDB

SSH: git@github.com:neurosnap/dcmdb.git
HTTPS: https://github.com/neurosnap/dcmdb.git

```
$ git clone git@github.com:neurosnap/dcmdb.git
$ cd dcmdb
```

Create dicomdb/settings_dev.py file
```
Expand All @@ -117,8 +168,6 @@ EMAIL_HOST_USER = ''
EMAIL_PASS = ''
```

##### Run

```
$ python manage.py syncdb
$ python manage.py migrate
Expand All @@ -138,67 +187,111 @@ If you get an error like "GROUP not found" when going to /users:

Done!

#### HOW TO DEVELOP ON WINDOWS (Get ready for hell)

HOW TO DEVELOP ON DEBIAN-DIST (UBUNTU)
---------
##### Install msysgit 32bit (must be 32bit)

```
$ apt-get update
$ apt-get upgrade
$ apt-get install python-pip
$ pip install virtualenv
$ mkdir ~/.virtualenvs
$ pip install virtualenvwrapper
$ vim ~/.bash_profile
```
I chose msysgit because nothing that is preinstalled with cygwin worked
for me very well. It was a living nightmare getting everything syncd using cygwin.

in .bash_profile
```
export WORKON_HOME=~/.virtualenvs
/usr/local/bin/virtualenvwrapper.sh
```
##### Install python 2.7

Make a virtualenv
```
$ mkvirtualenv dcmdb
```
Add C:/Python27;C:/Python27/Scripts;C:/Python27/Lib;C:/Python27/DLLs; to environmental variables

Start working on a virtualenv (after mkvirtualenv it usually loads right into the virt)
Download: https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
Install setuptools

##### setuptools
```
$ workon dcmdb
$ cd /path/to/ez_setup.py
$ python ez_setup.py install
```

deactivate virtualenv (just an example, dont do this now)
##### Install PIP
```
$ deactivate
$ easy_install pip
```

Now install python dependencies
##### Install the rest of the dependencies that actually work through PIP
```
$ pip install -r ./conf/dependencies.txt
$ pip install -r dependencies.txt
```

dependencies.txt
```
Django==1.5.4
Pillow==2.2.1
South==0.8.2
argparse==1.2.1
nose==1.3.0
psycopg2==2.5.1
pydicom==0.9.8
pyparsing==2.0.1
python-dateutil==2.1
setproctitle==1.1.8
six==1.4.1
tornado==3.1.1
bleach==1.2.2
html5lib==0.95
yolk==0.4.3
```

##### Download DCMDB
##### Install matplotlib 32 bit v1.3.1+ via installer

* http://matplotlib.org/downloads.html

##### Install numpy via installer

##### Install pillow via installer

##### Install gdcm v2.4.0+ via installer

SSH - git@github.com:neurosnap/dcmdb.git
* http://sourceforge.net/projects/gdcm/files/gdcm%202.x/GDCM%202.4.0/

[HTTPS](https://github.com/neurosnap/dcmdb.git)
Add C:/Program Files (x86)/GDCM 2.4.0/bin to envrionmental variables

Move C:/Program Files (x86)/GDCM 2.4.0/ to C:/Python27/Lib/site-packages
* _gdcmswig.pyd
* gdcm.py
* gdcmswig.py

##### Install Postgresql

http://www.postgresql.org/download/windows/

Set password for "postgres" user
Open pgAdmin III
Connect to PostgreSQL
Create database "dcmdb" set owner to "postgres"

###### Install psycopg2

I had to download MINGW to install psycopg2.

###### Install MINGW with gcc and g++

* http://sourceforge.net/projects/mingw/files/

###### Configure MINGW

* Add C:\MinGW\bin to PATH environment variable
* Create distutils.cfg in C:\Python27\Lib\distutils

distutils.cfg
```
[build]
compiler=mingw32
```

* Open cygwinccompiler.py in the same directory
* FIND/REPLACE all "-mno-cygwin" with blank ""
* SAVE

Open msysgit

```
$ pip install psycopg2
```

##### Download DCMDB
```
$ git clone git@github.com:neurosnap/dcmdb.git
$ cd dcmdb
Expand All @@ -219,8 +312,6 @@ EMAIL_HOST_USER = ''
EMAIL_PASS = ''
```

##### Run

```
$ python manage.py syncdb
$ python manage.py migrate
Expand Down

0 comments on commit 5d0b2d5

Please sign in to comment.