On yesterdays post I noted the data was not aligned correctly. Since then I made some changes to fix that, or at least improve it. It can’t really be corrected until the model data is imported and the images aligned to that standard position. For now the images are adjusted relative to the first image loaded.
Here are a few screen shots captured from the iPad simulator:



Working with VTK I have had to determine how to process the VTK poly data format,at least for the types of data I have been using. At the same time I have been working on various iPhone apps. The iPad with its larger screen seemed to be a good fit for displaying image data from theGRITS project. Below are two screen images showing the data displayed. There are some alignment issues that need to be addressed but I now have a handle on VBO’s on the iPhone platform. I have tested the loading of twelve data sets, three data sets per slice that’s only four images. The number that can realistically be displayed at one time will depend on the size of the data sets themselves. I still have to import the model data which in 3DS format…ugh


Write once run everywhere…. someday… maybe… just not today.
The project I am working on utilizes the Qt UI framework in conjunction with the Visualization ToolKit (VTK). Qt was chosen because of its cross-platform abilities and its nice integration with VTK.
Building QT and VTK on a Windows platform was straight forward. Integrating it into Visual Studio was a bit more work but once you find the magic buttons it worked very nicely. With the first versions of the applications released for the Windows platform it was time to move to the Mac. In this case OSX 10.6.
The first thing to do is get Qt. Their website offers two types of downloads, one is the complete SDK and the other is just the framework. I chose to use the binary version instead of building from the source and downloaded the complete SDK. The xcode will need the Qt Frameworks located under /System/Library/Frameworks. In Xcode simply select “Add existing Framework” and locate the ones that are Qt specific.
I am on a Mac Mini and when it was time to build my first application I kept getting a message about how the Qt code was built for a different architecture. No matter what I did, nothing would resolve this issue until I download the binary framework for the Mac Cocoa 10.5 (32 and 64 bit). Had I built the code from source this issue may have never appeared but starting with the binary seemed much simpler… Wrong.
Qt integration into Xcode is easy if you are starting with a new project. From the terminal enter
“qmake -spec macx-xcode myprojectname.pro"
This will create .pro and a .xcodeproj file.If the folder where you create the .pro file contains the source code qmake will include it in the project. In my case the project had only a few of the required files, the rest I added manually. Starting with a xcode project created by qmake sets up the rules so that qt files are correctly Moc’d . I can add new Qt files that contain “Q_OBJECT” in the header file and they are processed as expected.
Before I could continue with building the application I needed to get VTK. The source code can be downloaded from the VTK site. One could also get this from the cvs repository. I attempted to start this process using the cvs code but ran into build issues. I found that if I used the latest release I could update my source from cvs without the build issues.
Before you can build VTK also need to obtain CMake. Building VTK is done from the command line so you’ll need a terminal session open. Building VTK requires two directories, one for the source and one for the build. The source directory should exist once the code is downloaded and uncompressed. I used /Applications/vtk-5.4.2 . Create a build directory. I used /User/gricker/vtlbuild. CD in to the build directory and run cmake /Applications/vtk-5.4.2. After this is done I ran the windowed version of cmake. The source and build directories need to be specified and its likely that all of the configuration information will be “red”.
I added three new items.
VTK_USE_GUISUPPORT: BOOL=ON
VTK_USE_QVTK:BOOL=ON
DESIRED_QT_VERSION=4.
Selecting “Configure” will create the corrected cmake files. After the configure process is complete none of the fields should be red. Selecting the “Advanced View” there should be references to the QT frameworks as well as VTK related enteries.
within CMAKE make wure VTK_USE_COCOA is selected and not VTK_USE_CARBON. Set CMAKE_OSX_ARCHITECTURES to at least i386. Other options include ppc,ppc64 and x86_64. Adding other architectures will build a universal binary, something I’ll need to revisit at some point.
Select “Generate”. From the terminal enter “make”. If everything is correct the process should complete without errors. The possible errors are endless and depend on the time of day, the phase of the moon,.. Once make is done enter “make install”. The files will get installed to /usr/local/vtkbuild, usr/local/include/vtkbuild,/usr/local/lib/vtk-5.4, and /usr/local/vtkbuild.
Qt is installed and VTK is built with Qt. On to building the app….
A few years ago, while discussing a job move a friend told me why he stayed, “better the devil you know than the devil you don’t”.
Since then I have come to understand that most people prefer the status quo no matter how bad. A former co-worker, now in a management level position, was commenting on how hard it has been to find people, even in this economy. Potential candidates had to have W,X,Y, and Z skills and live within 35 mins of the office. It had been over five months since the search had begun and still no one filled all of the requirements. Would it not have been better to take someone with many of the desired requirement then to do nothing? No it would not. First of all, the company has rules about hiring, the location requirement has to be met. No exceptions. Secondly, if he hired someone who didn’t have W,X,Y and Z skills and they didn’t work out it would reflect poorly on him. The company clearly doesn’t want independent thinkers.
One the other side of the equation people who have jobs are afraid to make a move. They aren’t going to leave for something that might not be there six months from now. Even though their current job could be disappear at any moment, staying is preferable to the risk involved with making a change The later gets words of advice from friends and family,” if you had stayed at the old job you would still have one”.
Ask someone to name a person they admire; likely they’ll name someone who took a chance, didn’t bend to the status quo.
Life changing events seem to give people the ability to dump the status quo. Quite often you hear of someone being diagnosed with an illness, suddenly they get the courage to pursue some life long dream that otherwise would have remained a dream. A person, down to their last dollar starts to blog about something they love. The next thing they know the blog is a huge hit.
How do we change this pattern without having to have a life changing event? How do you get your employer to take chances in a environment that is geared towards profits?
Oops… my 30 minute lunch break is over. If I don’t get in my 8 hours there will be you know what to pay….
March 22nd, 2010 in
My ramblings |
No Comments
“Even when reading is impossible, the presence of books acquired produces such and ecstasy that the buying of more books than one can read is nothing less than the soul reaching towards infinity… we cherish books even if unread, their mere presence exudes comfort, their ready access, reassurance.” — A.E. Newton
February 5th, 2010 in
My ramblings |
No Comments
I was very pleased about how well the WebService code was working. I had finally gotten the process of changing the WS code as well as the C++ client code nailed down. As I started testing I noticed that JBoss/Hibernate started fail and complain about too many connections.
It turns out there are a lot of people that have had the same issue. The recommended solutions are:
1. Use finally block to make sure sessions are closed.
2. Use a connection pool other then the default. C3P0 is highly recommended.
I went through the code line and by and made sure sessions were being closed. Configuring a new connection pool wasn’t as straight forward as I would have hoped. After starting JBoss I noticed complaints about C3P0 vs Hibernate properties.The solution seems to be to add “hibernate” to the property name as shown below.
Original:
<!– start c3p0 connection properties –>
<property name=”c3p0.min_size”>10</property>
New:
<!– start c3p0 connection properties –>
<property name=”hibernate.c3p0.min_size”>10</property>
Even after doing all this I still had the “too many connections” problem. I reduced the Ws code to a few lines, open a session and close a session. And still I had “too many connections” .
Then the “big dummy” light came on. I was creating a new sessionFactory each time a made a WS call!
SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
Session session = sessionFactory.openSession();
I moved the sessionfactory creation to the constructor and made sessionFactory a member variable. After re-deploying it works perfect and is much faster.
This is one case where having code reviews or at least a second set of eyes on the code would have helped.
January 29th, 2010 in
My ramblings |
No Comments
There isn’t an application today that doesn’t have a “Preference” or “Settings” section. The GRITS viewer and image processing application are no exception. The viewer application needs to preserve information such as “work offline”, “window transparency level”, and “image translation” values. For a long time this was done by reading and writing to a file. Windows programmers eventually achieved this functionality using the system registry. Java developers now have the Preferences API.
The GRITS project is using QT in a C/C++ environment and I was dreading have to deal with saving state or preference information. But then I discovered “QSettings“.
The QT developers think of everything. QSettings lets me store and retrieve information without having to code for each platform. On Windows it uses the system registry, on the Mac OS, XML files and on Unix INI files are used. QSettings uses simple key/value pairs but also gives the ability to store data in a custom format. Using this is very straight forward.
To store data first create a QSetting object. Then call beginGroup(). “setValue()” adds the information and “endGroup()” completes the process.
QSettings settings();
settings.beginGroup();
settings.setValue();
settings.endGroup();
Here is an example of how I used this to store the window transparency setting.
QSettings settings(”GritsSettings”, “Preferences”);
settings.beginGroup(”viewersettings”);
settings.setValue(”windowTransparency”, windowTransparencySlider->value());
settings.endGroup();
Here is how the information appears in the registry.

Since I need to access this data from various parts of the application I created a Preferences object that hides the QSetting details. I can simple user prefs->getTransparency() or setTransparency() to do the work for me.
Its not too difficult to see how one could use this to store the location and state of windows or other pieces of application information.
January 21st, 2010 in
Visualization |
No Comments
The gsoap issue wasn’t as straight forward as expected, surprise! As I stated last time “wsdl2h” worked fine when connecting the to the external server either with or without ssl. But the service address wasn’t correct. The JBoss server is running behind Apache and this must be causing the service name to use the localhost address.
From the wsdl:
“<service name=”MyWebService”>
<port binding=”tns:MyWebBinding” name=”MyWebPort”>
<soap:address location=”http://127.0.0.1:8080/Myweb/MyWebService”/>
</port>
</service>”
In the MyWeb.h file created from running wsdl2h I found:
“@section MyWebBinding_ports Endpoints of Binding “MyWebBinding”
-http://127.0.0.1:8080/Myweb/MyWebService”
I changed the url to: “@section MyWebBinding_ports Endpoints of Binding “MyWebBinding”
-http://university.edu/Myweb/MyWebService”
and ran soapcpp2. It didn’t work. The endpoint in the WebBindingProxy file still defaulted to the local host. To get around this I initialized the endpoint to the correct value in the MyWebBindingProxy_init method:
“void MyWebBindingProxy::MyWebBindingProxy_init(soap_mode imode, soap_mode omode)
{
soap_imode(this, imode);
soap_omode(this, omode);
soap_endpoint = “http://university.edu/myweb/MyWebService“;
static const struct Namespace namespaces[] =……..”
and it works..almost. The ssl connection still isn’t working. so much for my hoping this would “just work”. Back to ssl……
P.S.
I started out using gsoap without any options. I’d suggest using the “-nname and -Nname” options with wsdl2h to rename the prefix. As it is now all of objects and methods default to “ns__”. While this is fine for now it make for ugly code and in the future some will hate me if I don’t change it.
January 14th, 2010 in
Visualization |
No Comments
CNN Money FORTUNE
By Anne Fisher
“In a world where fewer and fewer employees work in the same location as their bosses, IBM is figuring out how to bring together far-flung coworkers.
NEW YORK (Fortune) — Leo Mendoza is a typical IBM sales rep. Based in Chicago, he starts his day with a 5:45 a.m. swim at a local health club, then usually hits the road by 7:15 to see clients in Milwaukee or Racine. A couple of days a week, he works from home. How often does he see his boss in person? Maybe once a month, maybe less.
“Going mobile like this made me nervous at first,” says Mendoza. “But after two or three months, that went away. I realized, hey, I can get my work done and make my numbers without going in to the office.”
If you’re like most managers these days, you have more and more people like Mendoza reporting to you — that is, people you rarely lay eyes on. Consider: A 2008 study by high-tech think tank Nemertes Research found that 90% of U.S. employees now work somewhere other than headquarters, and 84% work in a different location than their bosses.
The years 2003 to 2008 saw an 800% jump in the number of “virtual employees”. That group includes road warriors who travel constantly, telecommuters who work from home, and people in one-or-two-person offices spread out all over the globe.
Collaborating with peers and team leaders separated by vast distances is made possible by technology, of course, but virtual managers are discovering that technology alone doesn’t build teams.
The ’90s marketing catchphrase “high tech, high touch” applies here too: The more dazzling the gadgets people have at their disposal, the more they crave ordinary human contact — or a close facsimile of it.
About 40% of IBM’s 400,000 employees are now virtual. Since 1995, when IBM (IBM, Fortune 500) first began encouraging its employees to telecommute, the company has been working on building a sense of personal connection among far-flung workers.
“Humans are social animals. Without a real sense of community, most people just don’t do their best work,” says Dan Pelino, general manager of IBM’s global health care and life sciences division.
Social networking that’s encouraged
To combat a widespread feeling that IBM stood for “I’m By Myself”, as an in-house joke had it, Pelino brought back IBM Clubs, an old company tradition that had been allowed to fall by the wayside.
The clubs, now active in several hundred cities in 30 countries, bring employees together for family events, like trips to the zoo, as well as for work-related meetings like coaching and mentoring sessions with senior executives.
Sales rep Leo Mendoza says the Chicago club has helped him bond with other mobile staffers. Three of them, whom he had befriended at an IBM golf outing, came to his wedding in Colorado, “even though it was a day’s drive for them each way,” he says. “I was really touched by that.”
IBM, this year’s Top Company for Leaders, is also using technology to whittle the distances between people. In 2007, for instance, a task force called OTTO (for Other Than the Office) created informal online networks of virtual employees who share ideas, advice, moral support, and scuttlebutt — just like in-person cubicle mates.
The company added a social networking site called SocialBlue where employees post photos and bulletins about topics like their kids, their dogs, their motorcycles, and what they did over the weekend. It’s a big hit with tens of thousands of IBMers worldwide, from new entry-level hires to senior vice presidents.
Employee surveys show that being able to work far from colleagues without losing touch has boosted employee satisfaction and makes top talent more inclined to stick around. IBM managers say SocialBlue has been a boon to teamwork and productivity — ironic, since the site recreates the kind of water-cooler chitchat that might once have been considered a waste of company time”
January 10th, 2010 in
Telecommuting |
No Comments
I read this on CNN.
pirillo.telecommuting
By Chris Pirillo
“With gas prices inching their way back up and traffic in most metropolitan areas bottlenecking along any rush-hour route, it’s a wonder that the majority of the modern office workforce doesn’t telecommute.
The sad fact is that many bosses and personnel departments refuse to see the value in allowing their underlings the freedom to work from home in spite of the massive cost savings of business overhead (i.e. office space rental, work stations, parking, etc.) and potentially increased productivity.
How can employees be working, these short-sighted micromanagers muse, if they’re not monitored for every second they’re on the clock? Who’s going to make sure they’re taking their allotted 30-minute lunches and 10-minute breaks? Who will crack the whip when the personal phone calls and water cooler chit-chat get out of hand?
Stuck in the mindset of the 19th-century business model like Dickensian Scrooges, these uninformed overseers fail to see how grown adults could possibly be trusted to monitor their own work habits and get their jobs done without the “benefit” of managerial…guidance.
They don’t understand how constant meddling (i.e., calling endless meetings, tapping their watches parentally when employees return from lunch two minutes late, interrupting the general flow by introducing empty priority items over work already in progress, etc.) hinders — rather than stimulates — overall office morale and productivity.
Let’s say your job really is something that doesn’t require you to be shackled to a desk in some office loft’s cubicle sprawlscape. You have a daily checklist of tasks that need to be done and, regardless of whatever distractions may come your way, you’ve got the discipline to make sure you get those tasks crossed off before the personnel department’s officially permitted quitting time.
What do you say to a boss who, for no sane reason on God’s green earth, resists a sensible appeal for allowing you to telecommute? It’s tempting to parrot the immortal words of Redd Foxx’s Fred Sanford and say: “You big dummy!”
But don’t. Don’t. Sure, it’d probably save you the agony of your daily commute, but…
On the other hand, if you’re lucky enough to work in a place that does allow you to telecommute but the person who needs the most convincing is you, here are some of the best reasons I can come up with (maybe you’ll think of more — if so, drop me a line and share!):
1. You’ll save money on gas and car repairs, and possibly insurance since you’ll be traveling less miles every day.
2. No more random interruptions from the office busybody.
3. Worried about not having enough social interaction? Do your work at home and hang out with people of your own choosing afterward instead of whoever you get stuck with all day long at the office! Sure, those social circles may overlap and you might actually enjoy the company of people with whom you happen to work, but my point here is that telecommuting gives you options.
4. Spend a good chunk of your day on the Internet? The office will likely pay for your home broadband connection!
5. Need to share a presentation with someone? Think about putting it up on SlideShare.
6. Need to collaborate on a spreadsheet? Use Google Docs! Stop sending file attachments, already! Seriously, if you’ve learned nothing else from this article, it’s the benefit of using a service like Google Docs.
7. Need to look at someone’s desktop remotely? I bet your company’s system administrator has a tool for the job.
8. Need to take notes with a group, even if you’re not in the same room together? Check out Etherpad.com.
9. Need some kind of radio playing in the background, just for that old-time officey feel? Point a Web browser to Pandora.com or Last.fm. You can define your own stations instantly, based on music and artists you love.
10. Monitor your eating habits, because (I’m telling you) you’ll snack more at home than you do at work — it’s too convenient. Hey, I had to throw in at least one caveat, right?
Still reading this at the office in spite of being offered the option to telecommute by your progressive, 21st-century, forward-thinking company? What the heck are you waiting for, you big dummy?”
January 10th, 2010 in
Telecommuting |
No Comments