-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Example exporting tables to CSV programmatically.
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
src/test/java/fiji/plugin/trackmate/visualization/table/ExportTableToCSVExample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package fiji.plugin.trackmate.visualization.table; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
|
||
import fiji.plugin.trackmate.Model; | ||
import fiji.plugin.trackmate.gui.displaysettings.DisplaySettings; | ||
import fiji.plugin.trackmate.io.TmXmlReader; | ||
|
||
public class ExportTableToCSVExample | ||
{ | ||
|
||
public static void main( String[] args ) throws IOException | ||
{ | ||
final TmXmlReader reader = new TmXmlReader( new File( "samples/FakeTracks.xml" ) ); | ||
final Model model = reader.getModel(); | ||
// final SelectionModel selectionModel = new SelectionModel( model ); | ||
final DisplaySettings ds = reader.getDisplaySettings(); | ||
|
||
// Export all spots. | ||
File allSpotsCSVFile = new File( "samples/AllSpotsCSVExport.csv" ); | ||
AllSpotsTableView.createSpotTable( model, ds ).exportToCsv( allSpotsCSVFile ); | ||
|
||
// Export spots in tracks. | ||
File spotsInTracksTableCSVFile = new File( "samples/SpotsInTracksCSVExport.csv" ); | ||
TrackTableView.createSpotTable( model, ds ).exportToCsv( spotsInTracksTableCSVFile ); | ||
|
||
// Export tracks. | ||
File trackTableCSVFile = new File("samples/TracksCSVExport.csv"); | ||
TrackTableView.createTrackTable( model, ds ).exportToCsv( trackTableCSVFile ); | ||
|
||
// Export edges. | ||
File edgeTableCSVFile = new File( "samples/EdgesCSVExport.csv" ); | ||
TrackTableView.createEdgeTable( model, ds ).exportToCsv( edgeTableCSVFile ); | ||
|
||
} | ||
|
||
} |