Mesh Generation
Variable mesh generation has been an arduous process. The steps are:
-
First select the nerve slice that will be used for the 3D model.
The fascicle from the original
nerve slice image is recolored to show different
tissue types.
-
Run the image through a lens filter.
In the process, save the transform from the original x,y coordinates to
the projected x,y coordinates. This step can be done in the GIMP
or in Matlab.
-
Subsample the filtered
image. We selected every 5th pixel from the projected image.
This step can be done in Matlab or Photoshop. Note that when using
Photoshop, the 'Nearest neighbor' option must be selected to prevent interpolating
colors.
-
At this point we have two sets of data. The first is a distorted
image, color-coded by tissue type. The second set contains the undistorted
x,y coordinates for each pixel in the distorted image. Each of these
data sets is handled separately. The distorted image is extruded
in Matlab, and an (x,y,z) volume of conductivity indices are saved.
Each of these indices is mapped to a cell whose position is stored in the
second data set.
-
A third dataset is also needed. Since SCIRun builds the tetvol mesh
from node positions, these xyz coordinates are also needed. The number
of nodes is n+1 in the x,y and z dimensions of the matrix.
We have started generating the first set of mesh results:
-
Single slice of mesh showing x,y coordinates.
Note the odd folding at the edges.
-
Single slice showing conductivities. Note
the incorrect colors.
-
Updated single slice with edges and coloring corrected.
Note the red block near the center of the picture, up and to the left.
This block persists if I show only myelin.
-
Full 3d mesh with only myelin shown. Note
that there are more blocks. Note also that for some reason the full
3d mesh only shows a single slice, even though the mesh contains the correct
number of nodes. Further investigation shows that other tissue types
show only a single slice.
-
A bug was found in the cell numbering. Here is the new
3d mesh. However, even though this looks much better some scirun
modules are reporting problems. Also, the HexToTet conversion is
taking about 16 hours. The next step is to examine a smaller 3d mesh.
-
Here is a 3d mesh with 4 layers. The blocks
that appeared in earlier versions are gone - hopefully they were a result
of the cell numbering bug.
-
Update on blocks: they are still appearing in the mesh, though they seem
to only appear at certain layers - they do not project all the way through.
-
The blocks appear in the original data. To see them, try the following
commands in matlab:
submodel=linear_extruded_model(182*185*0+1:182*185*1);
submodel2=reshape(submodel,182,185);
imagesc(submodel2)
-
It may be worthwhile to center the cell a little better. The
perineurium looks incomplete on one side.
-
Technical note: For some reason FieldBoundary does not work correctly with
the 64 bit version of scirun. It seems like it works fine for volumes
with 5 layers or less. More than that and it produces erroneous results.
On Linux and 32 bit irix it seems to work fine.
-
There seem to be breaks in the myelin, even near the center of the mesh.
Some are shown in this magnified picture.
-
After a conversation between Ian and Chris it seems that the breaks in
myelin are due to subsampling. We will look into fixing this with
a better subsampling algorithm.
Update March 12
New images: