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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Tom Lynch
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
Reply | Threaded
Open this post in threaded view
|

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

Kenneth Sloan-2
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
Reply | Threaded
Open this post in threaded view
|

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

Michael Doube-4
In reply to this post by Tom Lynch
Dear Tom,
>
>
> 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!

Ken Sloan has a good idea. Perhaps to avoid the problem of aliasing or
errors in cylindrical-ness you could rotate a line ROI with one end at
the centre of your pipe and the other at the circumference of a circle,
easily outside your cylinder.

For each angle rho take some summary (mean, max, nearest...) of the
pixel values on that line to generate a projection, and enter the result
on a rho vs z plot. Do the whole rotation to get all the 'rhos' and fill
out a row of a rho vs z plot.

Repeat that for each z slice of your cylinder and you have rolled it out
onto a flat plane.

Time prevents me from helping further with actual code, sorry!

Michael




[RVC Logo - link to RVC Website]<http://www.rvc.ac.uk>    [Twitter icon - link to RVC (Official) Twitter] <http://twitter.com/RoyalVetCollege>     [Facebook icon - link to RVC (Official) Facebook] <http://www.facebook.com/theRVC>     [YouTube icon - link to RVC YouTube] <http://www.youtube.com/user/RoyalVetsLondon?feature=mhee>     [Pinterest icon - link to RVC Pinterest] <http://pinterest.com/royalvetcollege/>     [Instagram icon - link to RVC Instagram] <http://instagram.com/royalvetcollege>

This message, together with any attachments, is intended for the stated addressee(s) only and may contain privileged or confidential information. Any views or opinions presented are solely those of the author and do not necessarily represent those of the Royal Veterinary College (RVC). If you are not the intended recipient, please notify the sender and be advised that you have received this message in error and that any use, dissemination, forwarding, printing, or copying is strictly prohibited. Unless stated expressly in this email, this email does not create, form part of, or vary any contractual or unilateral obligation. Email communication cannot be guaranteed to be secure or error free as information could be intercepted, corrupted, amended, lost, destroyed, incomplete or contain viruses. Therefore, we do not accept liability for any such matters or their consequences. Communication with us by email will be taken as acceptance of the risks inherent in doing so.

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