Login  Register

Re: A flat (2D) projection of a 3D model generated in TrakEM2

Posted by Kenneth Sloan-2 on Aug 21, 2013; 6:04pm
URL: http://imagej.273.s1.nabble.com/A-flat-2D-projection-of-a-3D-model-generated-in-TrakEM2-tp5004520p5004521.html

The natural choice would be to use cylindrical coordinates (z, rho, theta) to represent locations on your "pipe", discard rho (distance from the axis) and plot (z, theta) as (x,y).

The first problem is to find the central axis.  Without seeing your "pipe", I can't tell how hard this is - so I'll assume it's easy.  Assume you have a straight line down the center of your pipe.
That gives you a z-axis.  Now, you need to select x,y axes.

First, the question of the cross-sectional plane.  At each point along the z-axis, you need an x-y plane.  For now, assume that the x-y plane is perpendicular to the z-axis (which we assumed above was
globally constant).

Next, you must orient the x and y axes that span the x-y plane.  Do you have a "distinguished" feature, or orientation, which you can declare to be the "x" direction?  If so, good!  Call that "x" and y is now z CROSS x.  You now have an x-y-z coordinate frame at each location along your central axis.

[complications: if your axis is curved, or your "distinguished orientation" moves around, you need to to more work to get to this point.  The key is to define an x-y-z local coordinate frame at each point
along your central axis]

For each point along the central axis, if your "pipe" is regular enough, you can assign (z,rho,theta)
coordinates to points on the surface of your pipe.  Note that this mapping may miss some points on the pipe (and in nasty cases rho may be multi-valued for a given (z,theta).  

Finally, for every (z,theta) in your final output picture, find the location on your pipe described by (z,rho,theta) and display whatever quantity you have assigned to that point (color, rho, …)

This will "work" for very simple "pipes".  If your object is more complicated, then you will have to do something hairier.  Look for papers describing "parameterizing triangular meshes".


Here's another way to think of this (essentially the same) scheme.  Construct a cylinder which completely surrounds your object, with an axis which is "close enough for gov't work" to the central axis of your object.  You want to project points on the surface of your object onto the constructed cylinder and then unroll the cylinder for display.  This is a ray-casting problem.  For every pixel in your final image, cast a ray from the axis (at the same z-coordinate) to the cylinder.  Plot the object-surface point(s) that the ray passes through.  If the ray passes through multiple points on the surface…you will have to use knowledge of your particular application to decide what to do.

This breaks the problem into two parts:

a) project your object onto the perfect cylinder
b) unroll a perfect cylinder for display

You might find inspiration in the literature on "texture mapping", where the reverse problem is considered - you have a texture defined on the perfect cylinder and you want to paint the cylinder-like object with that texture.

Again - it boils down to assigning coordinates to points on your object.

The method I FIRST described can probably be adapted to a slightly more hairy set of cases than the second approach.  But, it really is all about establishing a coordinate system for the surface of your object.  There is a mountain of papers on this topic.  I would start at the current SIGGRAPH Proceedings and trace references back far enough to find a method simple enough to implement quickly which handles your particular class of objects.

--
Kenneth Sloan
[hidden email]


On Aug 21, 2013, at 10:43 , Tom Lynch <[hidden email]> wrote:

> Dear ImageJ community,
>
> I have constructed a 3-dimentional model of a tissue from cross sectional histology samples using the TrakEM2 plug-in. Is there a method of projecting a 3D model for a 2D publication-friendly figure? For example, consider a Mollweide projection of the earth--the 3D globe is rolled out into a flat map.
>
> Imagine my 3D model is the shape of a piece of pipe. I would like to project it as a flat sheet like it had been cut down one side and rolled out. I would like to avoid 3D glasses if possible. I appreciate any advise/expertise you can give me!
>
>
> Thank you,
>
> Tom J Lynch
> PhD Candidate
> Anatomy and Cell Biology
> University of Iowa, Iowa City, IA, USA
> [hidden email]
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html