.trk to .stl?

354 views
Skip to first unread message

Jonathan A. Fisher

unread,
Oct 1, 2013, 3:59:12 PM10/1/13
to diffusio...@googlegroups.com
Hi -

I've been using TrackVis to create .trk files from my DTI data (pre-processed with Diffusion Toolkit).

I'd like to convert the .trk file to .stl.  Any recommendations on how? What software?

TrackVis supposedly lets you do it, but in Windows it crashes (yes, I've asked about it on their blog).

Thanks!

Jonathan


__________________________________

Jonathan A. N. Fisher, Ph.D.

Laboratory of Sensory Neuroscience
The Rockefeller University
Box 314
1230 York Avenue
New York, NY 10065

tel: 212-327-7354
fax: 212-327-7352

http://ds9.rockefeller.edu/labheads/hudspeth/jfisher/
__________________________________

Samuel A. Hurley (University of Wisconsin)

unread,
Oct 1, 2013, 5:08:23 PM10/1/13
to diffusio...@googlegroups.com
Hi Jonathan,

Thank you for the interest in the DTI blog!

While I highly doubt that a TRK -> STL converter exists at the moment, both file formats are very well-defined, and it should be relatively easy to write a program that can read in the .trk, perform some basic computations, and write out an STL file.

TRK file format specification here: http://www.trackvis.org/docs/?subsect=fileformat

(Basic) STL file format specification here: http://en.wikipedia.org/wiki/STL_(file_format)

The TRK format is basically a set of n "tracks" containing m points. At each point, you have three float values x/y/z to represent the location of this point along the track in space, along withn_s additional scalars that can be associated with this point (such as the FA, MD, or other scalar DTI metrics).


In the STL file format, you create a set of "vertices" with v_x, v_y, v_z to define the location of each vertex in space. These are arranged in triplets to create a "facet," which is a small triangle, and a set of "facets" make up a "solid," which is some surface that can be rendered (by rendering these individual little triangles).

It might not be trivial, but you can try to translate the x/y/z points along each track into cylindrical surfaces in STL.

Best of luck,
-Sam Hurley
Distinguished Graduate Fellow
University of Wisconsin - Madison
Reply all
Reply to author
Forward
0 new messages