gsoap with SSL

Yesterday we managed to get the webservice configured so that its visible outside to the outside world. I didn’t do much but D.J Merrill at Bowdoin College was able to work his magic. The only issue is that my client application is using gsoap (C++ environment)  and apparently doesn’t include ssl as part of the win32 binaries. At least the wsdl2h utility isn’t built that way.

First off one needs something like openssl installed. Getting this downloaded was easy. To build it you need Perl. Great, I removed that a while ago as I wasn’t using it. Back to ActivePerl and get that. With Perl installed building openssl was simple, just follow the directions under install.w32.

Back to rebuilding gsoap. The Visual Studio project included doesn’t seem to work, at least it doesn’t within the limits of my current attention span. Lets try cygwin. Much better,run configure, make, and make install. The only issue is that I didn’t change the install folder so everything gets put in under the cgywin folders. No big deal just copy the required files where I need them. I’ll have to fix this later.

Now the wsdl2h works fine. It connects to the webservice located at the college!  Next, rebuild the app and test……

.NET and Java WebService

Sometimes one does things just to see the result. In this case I wanted to see how it would be to access a Java web service from a .NET C# application. The client side of GRITS project uses VTK along with QT. While there are .NET wrappers for VTK I haven’t tried them. Besides the QT/VTK combination works on Apple as well so .NET wouldn’t bring anything to the table. But I still wanted to see. The WebService is running on a JBOSS Application server with Apache as the Web server. Hibernate provides the object/relational persistence and query service.

I am using VS 2008 and its fairly straight forward.

The first step is to create a new ASP.NET web site.

VS-1

The second step is to add a Web Reference.

VS-2

On the Web Reference screen enter the url of the web service wsdl.

VS-3

After the processing is done you can see a list of services that were found. So far this is exactly what I was hoping for.

VS-4

The next step is to add code that will connect to the service. Since we named the service Grits  we can do the following.

using Grits; // add name space

public partial class _Default : System.Web.UI.Page
{
GritsWebService proxy;  // create a service proxy variable

protected void Page_Load(object sender, EventArgs e)
{
proxy = new GritsWebService();

}

VS-5

And finally call the service. At this point nothing will happen. Watching the JBOSS console window shows no activity.One query that I know will work with out VTK is “findRegionByExtent”.  This call takes a user name and six points that will define a bounding volume.

Selecting “GritsWebService” and then “Go to Definition” gives a list of all of the functions along with their parameters and return  values.

VS-5.5

The function “findRegionByExtent” takes a “findRegionByExtent” type as a calling parameter and returns an “areaRegionInformation” array.

VS-6

Using “Go to Definition” we can see how they are constructed.

VS-7

VS-8

The  “findRegionByExtent” type  isn’t very descriptive, its just indicates seven args. I’ll need to address this on the Web service side so that it uses more descriptive values. Since I created the beast I know that arg0 is the user name and args 1-6 are xmin,xmax,ymin,ymax,zmin and zmax. These describe the volume in which we want to search.

The return value “areaRegionInformation” returns a set consisting of genename, spotname, stagename and a set of points. There will be one set for each unique gene,spot,stage combination that lies within the bounding volume.

Here is the code that sets up and makes the call. I added six points that I know will provide results.

VS-10

Running the app in the VS debugger I see a response in the JBoss console window indicating that two “spots’ were located:

INFO  [STDOUT]  xmin -70.33 xmax -50.33 ymin 62.93 ymax 82.93 zmin -144.03 zmax -122.03
INFO [STDOUT] findRegionByExtent– The number returned is :2

In the VS debugger with a break point set we can see the results(part of them) returned from the service.The length of the array “test” is 2 and the first genename is “Calbindn”  so I know that is working.

VS-12

The next step would be to display this results. This would require the .NET version of VTK, maybe later but I wonder about  the iPhone…..?

Slicing the model.. oops

There is a tool that is used to slice up the model. It works along the same lines as what was used to fix the scaling problem. So far I have been working with only one data set. A few days ago I received a new model and started to process it. The first step is to “slice” the model. Of course this didn’t work. My biggest fear was that the tool wasn’t robust enough and this new model was breaking something. After spending hours(and hours) trying to determine what was causing the troubles maybe it was time to look at the model data .

The model was created in 3D studio, which I don’t own. You know how expensive 3D studio is? I have a 3D tool called Milkshape and it will import 3D files. While I couldn’t fix the issue I could see there was something wrong. I resorted to downloading a trial version of 3D.

The white object shown below isn’t supposed to be there.

3dmax-1

I was able to remove the extra object without messing up the remaining data.

3dmax-2

The slicer works fine now.

slice-2

Image scaling… redo

I have had this issue where the images didn’t align correctly with the model. It turns out that only the first one(Z=0). Th answer is that the model varies in X,Y along the Z axis. The bounding box that is used to scale the image to the model must be recalculated for each image according to its position on the model. Don’t why I didn’t see this before.

The trick is to extract a slice from the model at the desired Z position. VTK does this very nicely. Then get the bounding box for the slice. This is what we will use to scale the image.

Below is a slice of the model(blue) mapped onto the model.

model slicing

Using this new scaling process here are some results. Its clear that the images fit the model much better then before.

image scaling 1

image scaling 4

image scaling 2

The viewing application… finally

Below are two examples of how the viewer works(so far).First we see three images, classified into three groups. The PAX6 data represents day P05. The level selectors on the left allow the user to control which levels are displayed. The mask slider is used to further reduce the density( this affects the display only).

early application-1 91809

Next we see the same three images with the model. The scaling is still incorrect.

early application 91809

Images and model

Here are two images from the application I have created. The gray image is a 3D model of the cerebellum,created by the researcher.Youmay notice the image doesn’t fit the model, too large. This is a scale issue that has yet to be resolved.

91009
The colored area of the image represents a slice of the model.  The colors represent density of a specific gene type. Each gene type is shown with unique color that varies by density. Gene A with density of 100 will be green. Gene B with density of 100 will be yellow. The researcher will be able to see where Gene A and B are expressed in relation to each other.

This shows the slice as it intersects the model.

91009-intersection

Gene Classification

Here is a image showing the spot having been divided into three buckets. Its not been simple as I was expecting. I am dealing with the limits of how much data can be displayed. Gene Classification

The original blue and green images contained about 17k points each. That was too much for vtk to deal with on a sphere per point basis. At this point I am trying to determine if the I can trade number of points for sphere resolution. Also this is only one image, not sure what happens when I get more loaded. It will work but the resolution maybe need to be lowered to accommodate the increase in data points.

Gene Regulation in Time & Space

Started today on a project for Bowdion College , Maine. Dr. Carey Phillips is heading this work at Bowdoin. The application effort was begun by Carl Trapani of Skytop Software Camden, Maine.

The project involves data visualization of Gene expression data over time and in 3d space. The client application utilizes QT and VTK in a C++ environment. Both QT and VTK work on PC and Mac OSX, so they say.  The data needs to be somewhere that it can be shared. For that we’ll use JBoss and MySql. The client will connect with a web service to store, retrieve and search for information.

More later……

   Newer→