SCI Seg3D Mailing List

Text archives Help


[Seg3D] Re: Re: saving the seeds (spline control points)


Chronological Thread 
  • From: Ramón Casero Cañas <ramon.casero@comlab.ox.ac.uk>
  • To: seg3d@sci.utah.edu
  • Subject: [Seg3D] Re: Re: saving the seeds (spline control points)
  • Date: Wed, 28 Oct 2009 01:44:19 +0000

Michael Callahan wrote:
There are not currently any tools that save and restore auxiliary data
like the splines.  As such there isn't currently a model for how that
interaction should work.  It's also non-trivial to set this up so that
it's a general purpose and easy to use mechanism.

If you are just needing the control points for your own purposes then
your best bet would be to make a 'export' button on the tool that calls
a function which just writes curves.txt or similar, and then use that
externally.


Hi Michael,

Gosh, you are right that it's non-trivial, it's taken hours of work.
But it can be done! I just got your email as I got it to work! :) You are right, it would have been a lot easier adding a button to the tool ;)

So this is how it works: I have added an item "Export Control Points" to menu "File". I have basically copied what "Export Statistics" does, and then made some changes.

So what the new "Export Control Points" does is to get the "seeds_" vector from SplineTool, and write the coordinates to a CSV file.

It can easily be extended to other tools by writing for them a "get_seeds()" function.


The patch 20091028-013900-export-control-points.diff can be downloaded from

http://paracommunications.org/wiki/index.php/Adding_a_new_filter_to_Seg3D#Milestones


The events path is the following:

http://paracommunications.org/wiki/index.php/Adding_a_new_filter_to_Seg3D#Adding_a_new_item_to_export_control_points_to_the_.22File.22_menu


1) GUI "File" menu, "Export Control Points"
                |
                |
     Seg3DFrame Event(MENU_FILE_EXPORT_SEEDS)
                |
               \|/
                v
2) Seg3DFrame::FileExportSeeds
                |
                |
     SkinnerSignal(Painter::ExportSeeds)
                |
               \|/
                v
3) Painter::ExportSeeds
                |
                |
     Check that we are using the Spline Tool
                |
                |
     wxCommandEvent(wxEVT_COMMAND_EXPORT_SEEDS_SELECTION)
                |
               \|/
                v
4) Seg3DFrame::OnExportSeedsSelection
                |
                |
     Show dialogs to user to select the output filename
                |
                |
     Write SkinnerVariable(Painter::ExportSeeds::filename)
                |
                |
     SkinnerSignal(Painter::ExportSeeds2)
                |
               \|/
                v
5) Painter::ExportSeeds2
                |
                |
     Read SkinnerVariable(Painter::ExportSeeds::filename)
                |
                |
     Get hold of seeds_ variable in SplineTool
                |
                |
     Open stream for output file
                |
                |
     Write coordinates of seeds_ to output file
                |
                |
     Close stream for output file



Best regards,

Ramon.

--
Dr. Ramón Casero Cañas

Computational Biology, Computing Laboratory
University of Oxford
Wolfson Building, Parks Rd
Oxford OX1 3QD

tlf     +44 (0) 1865 610807
web     http://web.comlab.ox.ac.uk/people/Ramon.CaseroCanas
photos  http://www.flickr.com/photos/rcasero/



Archive powered by MHonArc 2.6.16.

Top of page