Skip to content

Commit 2768a36

Browse files
committed
Fix bugs in the CTC exporter.
- create the export folders if they don't exist. - missing branch parents means it is the beginning of a track.
1 parent 786a300 commit 2768a36

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/main/java/fiji/plugin/trackmate/action/CTCExporter.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ public Path getTrackTifFilePath( final String exportRootFolder, final int saveId
135135

136136
public static String exportAll( final String exportRootFolder, final TrackMate trackmate, final ExportType exportType, final Logger logger ) throws IOException
137137
{
138+
if ( !new File( exportRootFolder ).exists() )
139+
new File( exportRootFolder ).mkdirs();
140+
138141
logger.log( "Exporting as CTC type: " + exportType.toString() + '\n' );
139142
final int id = getAvailableDatasetID( exportRootFolder );
140143
exportOriginalImageData( exportRootFolder, id, trackmate, logger );
@@ -440,7 +443,8 @@ public static String exportTrackingData( final String exportRootFolder, final in
440443
{
441444
final DefaultEdge edge = branchGraph.incomingEdgesOf( current ).iterator().next();
442445
final List< Spot > parent = Graphs.getOppositeVertex( branchGraph, edge, current );
443-
parentID = branchID.get( parent );
446+
final Integer obj = branchID.get( parent );
447+
parentID = ( obj == null ) ? 0 : obj.intValue();
444448
}
445449

446450
// Start and finish frame.

0 commit comments

Comments
 (0)