Tuesday, June 16, 2015

Ubuntu 14.04: compile DCMTK 3.6.1 (development snapshot)

Get latest version from: http://dicom.offis.de/download/dcmtk/snapshot/ At the time of writing this could be done to compile latest version of the dcmtk:
# The gist shows how to compile latest development snaphost of DCMTK 3.6.1
# in Ubuntu 14.04. The version of the dcmtk avaliable in ubuntu's repositiries
# is 3.6.0, which is from 2011. The gist also shows how to setup include
#and lib folders so thatwe can use them to write our own C++ programs
# using the develpment version.
# first need to install required packages
sudo apt-get install build-essential cmake libpng12-dev libtiff5-dev libxml2-dev libjpeg8-dev zlib1g-dev libwrap0-dev libssl-dev
# where to install DCMTK
export DCMTK_PREFIX=~/dcmtk361
# download latest development snapshot of the dcmtk. At the time of writing it was dcmtk-3.6.1_20150217.tar.gz
# for latest development versions please go to: http://dicom.offis.de/download/dcmtk/snapshot/
wget http://dicom.offis.de/download/dcmtk/snapshot/dcmtk-3.6.1_20150217.tar.gz
# unpack the archive
tar xzvf dcmtk-3.6.1_20150217.tar.gz
# go into the unpacked archive
cd dcmtk-3.6.1_20150217/
# run cmake to produce make file (alrenative to using ./configure --prefix=$DCMTK_PREFIX)
cmake -DCMAKE_INSTALL_PREFIX=$DCMTK_PREFIX
# compile
make all
# install into prefix folder
make install
# as a result of the above commands the follwoing folders should be created in the $DCMTK_PREFIX
# bin, etc, include, lib, share
# optional to clean the dcmtk-3.6.1_20150217 from the files created
# during compilation.
# make clean
#----- READ BELOW when using ./configure --prefix=$DCMTK_PREFIX instead of cmake ----#
# when ./configure --prefix=$DCMTK_PREFIX is used to configure the dmckt for
# compilation and installation, the execution of the "make install" for
# this development snapshot version wont produce $DCMTK_PREFIX/lib and $DCMTK_PREFIX/include
# directories with header and library files required when wanting to write C++11 that uses
# this snapshot version. Thus, we need to create them ourselfs.
if false; then
# Copy dmcktk library files that were compilied into our $DCMTK_PREFIX/lib folder
mkdir $DCMTK_PREFIX/lib
find . -name "*.a" -exec sh -c 'echo "Copying ${0}"; cp -Rp "${0}" $DCMTK_PREFIX/lib' {} \;
# Now do the same but for header files.
mkdir $DCMTK_PREFIX/include
find . -type d -name "dcmtk" -exec sh -c 'echo "Copying ${0}"; cp -Rp "${0}" $DCMTK_PREFIX/include/' {} \;
fi

ubuntu: dcmtk convert to grayscale tiff

Example:/opt/dcmtk361/bin/dcml2pnm +ot +G ../00_org/003.dcm 003.tif

Saturday, June 06, 2015

Xubuntu 15.04: lightdm autologin

To setup autologin, create the following file: /etc/lightdm/lightdm.conf

sudo vim /etc/lightdm/lightdm.conf
And add to the following lines: [SeatDefaults]
user-session=xubuntu
autologin-user=your_user_name

Ubuntu: chome browser new instance

chromium-browser --enable-udd-profiles --user-data-dir=~/chromeProf or for chromegoogle-chrome --enable-udd-profiles --user-data-dir=~/chromeProf