Improve file writing of UKF

@pnlbwh This pull request GREATLY improves the writing file format capabilities of UKF.  Most significant is that the same files can be written in compress .vtp files at 4-5x space savings.  This translates to nearly a TB of savings for my experiment.  Second most significant improvement is that these files load SIGNIFICANTLY faster in slicer. In my test cases of 1, the ASCII version took ~90 seconds to load, the vtp file took less than 10 seconds to load!  (not a well controlled test, but still potentially very impressive)

Please consider merging these changes ASAP.

Thanks,
Hans

@pieper  @Chaircrusher @demianw 

==========
Below are conversations with the NAMIC crown regarding these changes.

It occurs to me that a slight refinement to the program would make it a
better fit in Slicer. Right now, the writer class looks at the file
extension (.vtk or .vtp) and decides whether to use the legacy writer or
the xml writer.  This could be an explicit choice on the command line/in
the user interface.  It may be as simple as modifying the SEM XML so that
those are filetypes that show up in the filename chooser. Is this the case?

And currently for VTKXML file the default is uncompressed text, and
command line flags (-z and -b) tell it to use compressed binary.  Should
compressed binary be default, and '--ASCII' and '--uncompressed' be the
choices? The main reason I made uncompressed and ASCII the default was so
I could read the results.
--
Kent Williams norman-k-williams@uiowa.edu

On 9/13/13 6:13 PM, "Steve Pieper" <pieper@ibility.net> wrote:
Okay great, thanks Hans.

On Fri, Sep 13, 2013 at 7:12 PM, Johnson, Hans J
<hans-johnson@uiowa.edu> wrote:
Steve,

I'me going to do some testing this weekend, and then a pull request will
be sent to Ryan and Yogesh just like we did last time.

Hans

From: Steve Pieper <pieper@ibility.net>
Reply-To: <pieper@bwh.harvard.edu>
Date: Friday, September 13, 2013 6:11 PM
To: Martin Styner <mastyner@gmail.com>
Cc: Kent Williams <norman-k-williams@uiowa.edu>, Hans Johnson
<hans.j.johnson@gmail.com>
Subject: Re: UKFTractography -- enhanced with new file vtk-based file
writer.

Makes perfect sense to me - thanks!

Have you coordinated this with Ryan and Yogesh so it gets back into their
version?

-Steve

On Fri, Sep 13, 2013 at 1:10 PM, Martin Styner
<mastyner@gmail.com> wrote:

Great! Thanks
Martin
--
Martin Styner, PhD. MS ETH
Associate Professor
Neuro Image Analysis and Research Lab
Carolina Institute of Developmental Disabilities
Departments of Psychiatry  and Computer Science
CB 7160, University of North Carolina at Chapel Hill
Chapel Hill, NC 27599-7160
Cell:  919 260 6674 <tel:919%20260%206674>
Fax:  919 962 1799 <tel:919%20962%201799>

On Sep 13, 2013, at 12:14 PM, "Williams, Norman K"
<norman-k-williams@uiowa.edu> wrote:

Hans had me implement a VTK-based file writer for UKFTractography.  I
think it's currently working well, and is both more flexible, and will
generate smaller, faster-loading tract files.

https://github.com/BRAINSia/ukftractography


User-facing changes:

1. Added '--writeBinaryTracts' (or '-b') flag.  This tells the
vtkPolyDataWriter to generate binary VTK files.
2. If you use filenames ending in '.vtp' it will instead write out
new-style XML data files. These are always generated as
compressed/binary
files -- the '-b' flag is ignored.

It always generates compressed binary XML files, since the actual goal
of
this project is to generate smaller, faster-loading data files. I can
re-complicate the program by requiring command lines flags to turn on
compressed/binary writing for XML files, if anyone thinks that's a good
idea.

I'm also going to add a small utility that will take in a VTK or VTP
file,
and write out the corresponding VTK or VTP file today.
--
Kent Williams norman-k-williams@uiowa.edu