|
| 1 | +package org.mastodon.mamut.io.importer.trackmate; |
| 2 | + |
| 3 | +import static org.mastodon.mamut.io.importer.trackmate.TrackMateXMLKeys.FEATURE_ATTRIBUTE; |
| 4 | +import static org.mastodon.mamut.io.importer.trackmate.TrackMateXMLKeys.FEATURE_DIMENSION_ATTRIBUTE; |
| 5 | +import static org.mastodon.mamut.io.importer.trackmate.TrackMateXMLKeys.FEATURE_ISINT_ATTRIBUTE; |
| 6 | +import static org.mastodon.mamut.io.importer.trackmate.TrackMateXMLKeys.FEATURE_NAME_ATTRIBUTE; |
| 7 | +import static org.mastodon.mamut.io.importer.trackmate.TrackMateXMLKeys.FEATURE_SHORT_NAME_ATTRIBUTE; |
| 8 | +import static org.mastodon.mamut.io.importer.trackmate.TrackMateXMLKeys.FEATURE_TAG; |
| 9 | + |
| 10 | +import java.util.Arrays; |
| 11 | +import java.util.List; |
| 12 | + |
| 13 | +import org.jdom2.Element; |
| 14 | + |
| 15 | +public class CommonTrackMateFeatureDeclarations |
| 16 | +{ |
| 17 | + |
| 18 | + public static final List< CommonTrackMateFeatureDeclaration > spotFeatureDeclarations = Arrays.asList( new CommonTrackMateFeatureDeclaration[] { |
| 19 | + new CommonTrackMateFeatureDeclaration( TrackMateXMLKeys.VISIBILITY_FEATURE_NAME, "Visibility", "Visibility", "NONE", true ), |
| 20 | + new CommonTrackMateFeatureDeclaration( TrackMateXMLKeys.POSITION_X_FEATURE_NAME, "X", "X", "POSITION", false ), |
| 21 | + new CommonTrackMateFeatureDeclaration( TrackMateXMLKeys.POSITION_Y_FEATURE_NAME, "Y", "Y", "POSITION", false ), |
| 22 | + new CommonTrackMateFeatureDeclaration( TrackMateXMLKeys.POSITION_Z_FEATURE_NAME, "Z", "Z", "POSITION", false ), |
| 23 | + new CommonTrackMateFeatureDeclaration( TrackMateXMLKeys.POSITION_T_FEATURE_NAME, "T", "T", "TIME", false ), |
| 24 | + new CommonTrackMateFeatureDeclaration( TrackMateXMLKeys.FRAME_FEATURE_NAME, "Frame", "Frame", "NONE", true ), |
| 25 | + new CommonTrackMateFeatureDeclaration( TrackMateXMLKeys.RADIUS_FEATURE_NAME, "Radius", "R", "LENGTH", false ), |
| 26 | + new CommonTrackMateFeatureDeclaration( TrackMateXMLKeys.QUALITY_FEATURE_NAME, "Quality", "Quality", "QUALITY", false ), |
| 27 | + } ); |
| 28 | + |
| 29 | + public static final List< CommonTrackMateFeatureDeclaration > edgeFeatureDeclarations = Arrays.asList( new CommonTrackMateFeatureDeclaration[] { |
| 30 | + new CommonTrackMateFeatureDeclaration( TrackMateXMLKeys.EDGE_SOURCE_ATTRIBUTE, "Source spot ID", "Source ID", "NONE", true ), |
| 31 | + new CommonTrackMateFeatureDeclaration( TrackMateXMLKeys.EDGE_TARGET_ATTRIBUTE, "Target spot ID", "Target ID", "NONE", true ), |
| 32 | + } ); |
| 33 | + |
| 34 | + public static final List< CommonTrackMateFeatureDeclaration > trackFeatureDeclarations = Arrays.asList( new CommonTrackMateFeatureDeclaration[] { |
| 35 | + new CommonTrackMateFeatureDeclaration( TrackMateXMLKeys.TRACK_ID_ATTRIBUTE, "Track ID", "ID", "NONE", true ), |
| 36 | + } ); |
| 37 | + |
| 38 | + public static class CommonTrackMateFeatureDeclaration |
| 39 | + { |
| 40 | + public final String key; |
| 41 | + |
| 42 | + public final String name; |
| 43 | + |
| 44 | + public final String shortName; |
| 45 | + |
| 46 | + public final String dimension; |
| 47 | + |
| 48 | + public final boolean isInt; |
| 49 | + |
| 50 | + public CommonTrackMateFeatureDeclaration( final String key, final String name, final String shortName, final String dimension, final boolean isInt ) |
| 51 | + { |
| 52 | + this.key = key; |
| 53 | + this.name = name; |
| 54 | + this.shortName = shortName; |
| 55 | + this.dimension = dimension; |
| 56 | + this.isInt = isInt; |
| 57 | + } |
| 58 | + |
| 59 | + public Element toElement() |
| 60 | + { |
| 61 | + final Element fel = new Element( FEATURE_TAG ); |
| 62 | + fel.setAttribute( FEATURE_ATTRIBUTE, key ); |
| 63 | + fel.setAttribute( FEATURE_NAME_ATTRIBUTE, name ); |
| 64 | + fel.setAttribute( FEATURE_SHORT_NAME_ATTRIBUTE, shortName ); |
| 65 | + fel.setAttribute( FEATURE_DIMENSION_ATTRIBUTE, dimension ); |
| 66 | + fel.setAttribute( FEATURE_ISINT_ATTRIBUTE, "" + isInt ); |
| 67 | + return fel; |
| 68 | + } |
| 69 | + } |
| 70 | +} |
0 commit comments