Skip to content

Commit 2961a4d

Browse files
committed
Export int feature values as int into the TrackMate XML
1 parent 7708d2f commit 2961a4d

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

src/main/java/org/mastodon/mamut/io/importer/trackmate/MamutExporter.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -660,9 +660,18 @@ else if ( origName.startsWith( "IMPORTED_" ) )
660660
attName = origName;
661661
}
662662

663-
attributes.add( new Attribute(
664-
attName,
665-
Double.toString( p.projection.value( spot ) ) ) );
663+
664+
String val;
665+
if ( p.projection instanceof IntFeatureProjection )
666+
{
667+
val = Integer.toString( (int) p.projection.value( spot ) );
668+
}
669+
else
670+
{
671+
// Assume double.
672+
val = Double.toString( p.projection.value( spot ) );
673+
}
674+
attributes.add( new Attribute( attName, val ) );
666675
}
667676

668677
final Element spotElement = new Element( SPOT_ELEMENT_TAG );
@@ -991,4 +1000,5 @@ public static final void export( final File target, final Model model, final Mam
9911000
exporter.appendGuiState();
9921001
exporter.write( target );
9931002
}
1003+
9941004
}

0 commit comments

Comments
 (0)