Thursday, September 07, 2006

Calculating Normals

The next step in furthering the registration process is to add intensity processes. Sean Mann, another undergrad in the lab, has already written the retrieval of the intensities from a mesh and image in a class. To incorporate that into the registration I need to pass the point set in as a vtkMesh and calculate the normals from my point set.

I finished writing some functions that calculate the normals from the itkPointSet that I get from using the itkBinaryMaskToNarrowBandPointSetFilter on an itkSpatialObject, which in this case was an ellipse. The functions go through each point and calculate the normal based on the shape being roughly a circle and taking a ray from the center going through a perimeter point. The resulting direction is stored in a float array as a point that is then normalized to a unit vector. This approach seems to work well if the shape is a circle. In the case of other shapes, the normals cannot be found so easily. Another method is to calculate the normals based on looking at points to the left and right of the point in question. Then find a line that goes through those two points and use a line perpendicular to it that goes through the center point to be the normal direction. This method would be difficult in the point set implemented thus far because the points resulting from the itkBinaryMaskToNarrowBandPointSetFilter are not uniformly spaced around the border. Because of the way the points are placed, in some cases two points on the same normal vector, this method would only work if the point set were constructed more carefully. Reducing the width of the filter causes there to be empty areas in the border that would not work effectively. Creating the ellipse by using equations to map out the desired region seems like it could also be one solution.

Aside from the creation of the point set normals, their incorporation into the registration will require either adding them to a point set class as an inherited class, or having them as a separate object. There will also need to be an efficient way to transform the normals that could work interchangeably with the various transforms. Those tools could be a part of the new point set class.

I was unable to get the program that the meshes are fed into to calculate the normals to work on my computer. Errors seem to be stemming from the inclusion of "argtable" into the program. I tried installing an rpm of the program from the Internet but get the error "Missing Dependency: linux-gate.so.1 is needed by package argtable2". However, "linux-gate.so.1" is supposedly a virtual library and cannot be installed. It may have something to do with where the install is looking for it. In my case since I am calculating the normals this issue is not as critical.

0 Comments:

Post a Comment

<< Home