•February 14, 2015 • Leave a Comment
The following was performed with VTK 5.8 and Python 2.7.8 on Debian Wheezy x86_64.
- Get the VTK source-code: http://vtk.org/VTK/resources/software.html
- Get the Tim Hutton’s PowerCrust C++ source-code: https://github.com/timhutton/vtkpowercrust
- Unzip both archives
- Copy the C++ files (.cxx & .h) into VTK/Hybrid
- Edit VTK/Hybrib/CMakeLists.txt and add the PowerCrust .cxx file
- cd VTK; mkdir build; cd build; ccmake ..
- Set desired installation directory
- Turn on BUILD_SHARED_LIBS, VTK_USE_RENDERING, VTK_WRAP_PYTHON
- While on ccmake first configured [c] and then generate [g]
- make && make install
- cd Wrapping/Python; python setup.py install
- Assuming all go well export the VTK libraries: export LD_LIBRARY_PATH=/<installation_path>/lib/vtk-5.8
•February 8, 2015 • Leave a Comment
Exporting .jpg image copy from .dcm input using VTK in Python.
# Iterate through .dcm files and export to .jpg
for image in os.listdir(PathDicom):
# Need to cast before writing to .jpg
castFilter = vtk.vtkImageCast()
# .jpg file write
writer = vtk.vtkJPEGWriter()
jpg_filename = image.replace(“.dcm”, “.jpg”)
•September 1, 2014 • Leave a Comment
Have been working with Ardour lately and the multiple audio devices (internal + PCI) have been causing issues both on output and input. The easiest workaround is removing totally the unused sound card, which in my case was the internal Intel HDA. The single step required was to blacklist the module of the sound card. You can identify the module by “lspci” and then blacklisting the module is straight forward:
and add the line
blacklist <module name>
A single reboot should do the job or you could unload the module instantly. Although, reboot would confirm whether the blacklist function worked or not.
•May 16, 2014 • Leave a Comment
I have a database with some records that among other details they also declare a local (Greek) street addresses. The requirement is to retrieve all these records from the database and display them with markers on a Google Map. Before everything, if you want to get an idea on how the API works see the following links:
– GoogleMaps API – Getting started
– GoogleMaps API – Simple markers
The flow for my task has as follows:
– Connect to database
– Retrieve all the locations from DB
– Convert Greek characters to Latin for avoiding issues with the Web Service request [ code on code.loon.gr ]
– Use GoogleMaps API to retrieve GPS coordinates based on the given location
– Parse JSON response
Full code on GitHub.
•May 9, 2014 • Leave a Comment
Μετάφραση στα ελληνικά του locate για το back-end του Croogo. Διαθέσιμο στο GitHub.
•January 30, 2014 • 1 Comment
Here is the scenario:
– Domain that needs to be backed up (public_html, mail, database).
– Only access available via cPanel and FTP.
– Need automated daily full backup.
– Take full backup on server and compress its contents (cronjob on remote server)
– Download via FTP the compressed file to the local machine (cronjob on local machine).
– Delete compressed file.
There might be tools that do this, although I didn’t come across any while looking on the web. I implemented a simple solution based on bash scripts that gets the task done.
– backup.sh: Goes on the remote server to run as a cronjob.
– ftp.sh: Runs locally (on the machine that will store the backup) as a cronjob.
– .netrc: Defines the FTP account details (stored in /home/$user/.netrc)