Hello, ITK

This the first time that I heard the ITK. What is the ITK?


ITK is the abridger for Insight Segmentation and Registration Toolkit , which is different from the OpenCV. It major used for Medical Image Analysis. Here I should highlight two key words “Segmentation”  and “Registration”.

1. Segmentation

2. Registration

Is there any other good medical image analysis library on the iOS or other Mobile Device?


Using mex in Matlab

Matlab functions written in C++ are called MEX-files.MEX stands for Matlab EXectuable.

However,some old information left online, some of them mentioned cmex compile command in Matlab, but it doesn’t work in 2013a version.

You could just input the

>>mex yourfile.c

then some information will be shown to you for choosing proper compile.

Have Fun

Run Matlab in Command Line

Problem: I have a Matlab file on Mac OS X, but I want to use a common line to run it, without displaying the UI.

Solution: I referred to solution provide by http://stackoverflow.com/questions/6657005/matlab-running-an-m-file-from-command-line

however, it was introduced on Windows. I find a solution on Mac OS X.


1. Find the binary file of Matlab on your Mac.


2.Check the Documentation of it.

Using ./matlab -help, check the manual.

3.Going to your workspace and using the following command line

$:/your matlab insatlled path/bin/matlab -nodisplay -nosplash -nodesktop -r “run(‘your m file path/mfile.m’);”

{p.s: I will add a sreenshot of command line tomorrow, right now the m file is running 🙂 }

Have Fun!

Hello Activitiy on Android

Every time we use Hello World to learn our first work,I name it “Hello Activity”, since the most different term comparing with iOS, the android prefers to “Activity”.

I borrowed a Tutorial Book of Android yesterday in Library. There is a good note introducing the difference between the application and activity.

“an application can be composed of multiple activities, but one application must have at least one activity”.So Today my work is to create an application of Android with one activity.

1. Create an Android Project in Eclipse

Screen Shot 2014-01-26 at 10.37.00 AM

Maybe different Eclipse versions are different, this figure shows there is no android project in the New menu, but I found it after clicking Other…

Screen Shot 2014-01-26 at 10.37.10 AM

Choose the Android Application Project, set the project name and other settings, then a wizard will be created in your workspace.

2.See the structure of the Project

Screen Shot 2014-01-26 at 1.03.13 PM

It is helpful to look at the structure of the project, because it can tell us how the android project manage the source and resource. When we develop the real project,we can organize it depends on the requirement of the design or other team members.

What I am focusing on is

a)FirstActivity.java, which I could implement by adding the UI elements.

b)activity_first.xml, which is a layout file of FirstActivity class, the content is based on the rule of XML, so you should have some conceptions about it.

c)R.java, which is generated automatically, so never modify this file directly.

3.Add a simple widget in the HelloActivity

when I created the project with blank activity, a TextView was auto-generated. So I removed it!Screen Shot 2014-01-26 at 1.15.59 PM

And then create one in the override method named onCreate in FirstActivity.java.

1:TextView HelloTextView= new TextView(this);

2:HelloTextView.setText(“Hello My First TextView”);


Screen Shot 2014-01-26 at 1.21.10 PM

4.Run the application on emulator

OK, after that, we can run the application to see what will happen.

Screen Shot 2014-01-26 at 1.21.42 PM Screen Shot 2014-01-26 at 1.26.28 PM

Easy, right! Have Fun~

Android Virtual Device(AVD) on Mac OS X

Lots of resource written, there is a menu item in Eclipse, only click it, then the AVD manager can be called out, however, I cannot find this quick calling.

I used the command line to call “AVD manager”, once you “New” a new virtual device.

In the terminal, go into the folder named “tools” under the  Android SDK directory  you are using. Then, input “android avd”, the Android Virtual Device Manager will be launched.

Screen Shot 2014-01-24 at 11.49.02 PM

(Give an figure show the command line on my laptop)

Then, you can create an virtual device according to the requirement of your development. The following screenshot is the setting window when you create a new  AVD.

Screen Shot 2014-01-24 at 11.51.39 PM

One of the thing I want to mention here, I only can use ARM CPU or I cannot run the android package on AVD.The compiler will give some error message to ask me install some package support intel CPU. I haven’t try to install it.

Yeah, right now, with the my first work, all the development environment is installed successfully.

Have Fun!

Install the Android 4.4 with Eclipse on Mac OS X

Recently, I found a lot position of Mobile Developer should have some experience of all the mobile platform.So, I decided to learn a little bit more about the Android. And compare it with iOS development.

Yeah,of course android development will not limited by your working machine, we can install development environment on any OS.

I list some records when I installed it. Since I have installed the Eclipse, I skip the part of how to install it on Mac.

1. Install the Android SDK


I felt a little lost when I saw the “ADT bundle for Mac”, in the end I chosen the “USE AN EXISTED IDE”, and found the link of getting the latest SDK.

Screen Shot 2014-01-22 at 11.25.35 PM

After finishing, unzip the package, then Update your PATH environment variable to know about the Android tools.

I used ~/.bash_profile to add path environment.

Screen Shot 2014-01-22 at 11.35.24 PM

(of course, there are other ways to add it, for example http://peter.boctor.net/2010/12/02/installing-the-android-sdk-on-mac-os-x/ )

Then change the build path in Preference Panel

2. Install the ADT plugIn

first, I added the path :http://dl-ssl.google.com/android/eclipse/

Screen Shot 2014-01-22 at 11.46.06 PM

3.Install the ADT Translation Manager Plugin

Then, I added the path:https://dl.google.com/alt/

4. After that, the Eclipse was restart,but a message saying “missing Platform-tools”, so I opened the SDK Manager, install the latest version I wanted.

Screen Shot 2014-01-22 at 11.45.21 PM

Screen Shot 2014-01-22 at 11.21.09 PM

Screen Shot 2014-01-22 at 11.45.44 PM

Yeah, after that, All the error messages have gone.

Have Fun!

Configure Vimrc

Yeah, since I am learning python by vim, I hope the vim to be an awesome develop IDE.

Screen Shot 2013-06-27 at 9.57.04 PM

very cool and convenience.

If you can read Chinese, these is my reference:





Anyway, you should config your own .vimrc file for your vim . I will conclude my configuration on Mac OS X in few days later.