Thursday, May 21, 2015

Getting py2app working in Yosemite

So things did not work out of the box form me. The first trouble was when importing cv2 (opencv) libraries. For me I was able to get past this problem using hombrews python instead of the Mac's built-in version. 

Then I run into two other errors, 

  • File "/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/macholib-1.6-py2.7.egg/macholib/MachOGraph.py",  line 49, in locate loader=loader.filename) TypeError: dyld_find() got an unexpected keyword argument 'loader'

The problem was with macholib back to the definition of dyld_find() in dyld.py:
def dyld_find(name, executable_path=None, env=None, loader_path=None):

          Changing line 49 in macOGraph from loader=loader.filename) to loader_path=loader.filename) fixed the problem

  • "ValueError: New Mach-O header is too large to relocate in…" Recompiling pygtk did the trick:
    brew install pygtk -headerpad_max_install_names

Evernote helps you remember everything and get organized effortlessly. Download Evernote.

Wednesday, January 1, 2014

3-d Reconstruction Resources

When getting 3-d out of your multi-view imagery, there is some great open source tools that will provide a great starting point.

Monday, January 7, 2013

Figure Settings Matplotlib

From Evernote:

Figure Settings Matplotlib

In Lion, all figure settings live inside
/Library/Python/2.7/site-packages/matplotlib/mpl-data/matplotlibrc

You can modify such file, however it will be overwritten on the next python update. 
Instead to have your user-defined changes in a save place, write your changes to this location
/Users/myuser/.matplotlib/matplotlibrc

Friday, December 7, 2012

Permanently add path to python Mac Os

From Evernote:

Permanently add path to python Mac Os

We could add the PYTHONPATH variable to our .profile file in our home directory. 
An alternative is to create a user.pth file inside /Library/Python/2.7/site-packages, where python automatically looks inside all .pth files and adds the to the systems PATH

Monday, April 2, 2012

Installing Modules In Python

From Evernote:

Installing Modules In Python


A miscellaneous command that I always seem to forget….An easy way to install modules in Python is through pip

easy_install pip  (if not installed already)
pip install numpy
pip install matplotlib

Tuesday, April 12, 2011

Adding new file type to Xcode

This will help you get color syntax on .txx files:

Create a file
/Users/isa/Library/Application Support/Apple/Developer Tools/Specifications/TXX.pbfilespec
or
/Library/Application Support/Apple/Developer Tools/Specifications/TXX.pbfilespec

containing the following

(
        {
            Identifier = sourcecode.cpp.tpp;
            BasedOn = sourcecode.cpp.cpp;
            Extensions = (txx);
            ComputerLanguage = c;
            AppliesToBuildRules = yes;
            IncludeInIndex = NO;
            CanSetIncludeInIndex = NO;
        },
)

You may need to re-add sources or regenerate project file

Wednesday, November 10, 2010

Building VTK with QT on a Mac

VTK libraries are built in a similar fashion as VXL. You will need Cmake installed and create directories fro source and build.
The configuration for using VTK with QT are borrowed from here
In summary:

  1. Grab Qt 4.5.3 here.
  2. Launch CMake. Set the build directory to where you want to build VTK and the source directory to the VTK source tree.
  3. Turn on the following options:
    1. BUILD_SHARED_LIBS
    2. VTK_USE_QT
    3. VTK_USE_CARBON
    4. VTK_USE_GUISUPPORT
  4. Turn off the VTK_USE_COCOA option.
  5. Click “Configure”.
  6. Set DESIRED_QT_VERSION to 4.
  7. Click “Configure” again.
  8. Turn on VTK_USE_QVTK_QTOPENGL
  9. Click “Configure” yet again.
  10. Click “Generate”.