Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: read VTK format streamlines #13

Open
neurolabusc opened this issue Feb 22, 2016 · 4 comments
Open

Feature request: read VTK format streamlines #13

neurolabusc opened this issue Feb 22, 2016 · 4 comments

Comments

@neurolabusc
Copy link

Hello-
The current version imports MRTrix TCK and TrackVis TRK format files. It would be great if one could import VTK format files, as this seems to be the most popular format across tools (DTI-TK, Fiber Navigator, Camino, MedInria).

@jchoude
Copy link
Member

jchoude commented Feb 22, 2016

Hi,

yes, that would indeed be a good addition to the tool. We are not sure of the time needed to add such loader (because of all other projects needing our time).

In the meantime, if you already have some python-based workflows, you could use Dipy, which now has a function to compress streamlines that uses the exact same algorithm has this binary tool. You can see an example here, in the Dipy documentation for streamlines compression

To be able to load your VTK streamlines to process them with Dipy, you can use the TractConverter

If you need help with those, please let us know!

@neurolabusc
Copy link
Author

Thanks for your quick response. Perhaps you could add an example script to
http://nipy.org/dipy/reference/dipy.tracking.html#id40
that shows how to load streamlines from a popular format, compress them and then save them. I assume that you could save the simplified tracks to a popular format (e.g. VTK), but would see even smaller files by using the arithmetic or Huffman encoding of the fib format. I think a simple example would help - DiPy has a terrific collection of tools, but for a new user it is daunting to see how to use the functions together.

@StongeEtienne
Copy link

Hi neurolabusc,
Sorry for this late answer.
Be carefull if your converting your .vtk to another format because most of your header will be lost.
I think Dipy support a ".fib" format which is actually a renamed ".vtk"

If not, I did a Pull request recently to add "vtkPolyData loader in Dipy"
dipy/dipy#1034
there is also a function : lines = get_polydata_lines(line_polydata)
and after you should be able to use Dipy compression:
http://nipy.org/dipy/reference/dipy.tracking.html#dipy.tracking.benchmarks.bench_streamline.bench_compress_streamlines

@jchoude
Copy link
Member

jchoude commented May 9, 2016

@StongeEtienne Not sure exactly why you're saying that.

We normally encourage people to reuse the same file format for the input and output. However, when writing a vtk file, the minimal header information needed to work is kept.

If you feel other fields need to be kept, you are more than welcome to make a PR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants