diff --git a/src/main/java/org/mastodon/app/MastodonIcons.java b/src/main/java/org/mastodon/app/MastodonIcons.java index fd3db5534..253bde26c 100644 --- a/src/main/java/org/mastodon/app/MastodonIcons.java +++ b/src/main/java/org/mastodon/app/MastodonIcons.java @@ -140,7 +140,7 @@ public class MastodonIcons new ImageIcon( MastodonIcons.class.getResource( "icon-tag-32x32.png" ) ); public static final ImageIcon MAMUT_IMPORT_ICON_MEDIUM = - new ImageIcon( MastodonIcons.class.getResource( "icon-mamut-import-32x32.png" ) ); + new ImageIcon( MastodonIcons.class.getResource( "icon-mamut-import-32x32-2.png" ) ); public static final ImageIcon MAMUT_EXPORT_ICON_MEDIUM = new ImageIcon( MastodonIcons.class.getResource( "icon-mamut-export-32x32.png" ) ); diff --git a/src/main/java/org/mastodon/feature/Dimension.java b/src/main/java/org/mastodon/feature/Dimension.java index 5f65a2ba6..9f5f1cfa6 100644 --- a/src/main/java/org/mastodon/feature/Dimension.java +++ b/src/main/java/org/mastodon/feature/Dimension.java @@ -75,7 +75,7 @@ public enum Dimension */ TIME( "Time" ), /** - * Units of angles. We alway pick radians for units. + * Units of angles. We always pick radians for units. */ ANGLE( "Angle" ), /** @@ -89,7 +89,11 @@ public enum Dimension /** * Non numerical quantities. */ - STRING( "NA" ); // for non-numeric features + STRING( "NA" ), + /** + * Area. + */ + AREA( "Area" ); public static final String COUNTS_UNITS = "Counts"; @@ -127,6 +131,8 @@ public String getUnits( final String spaceUnits, final String timeUnits ) { case ANGLE: return RADIANS_UNITS; + case ANGLE_RATE: + return RADIANS_UNITS + "/" + timeUnits; case INTENSITY: return COUNTS_UNITS; case INTENSITY_SQUARED: @@ -146,6 +152,8 @@ public String getUnits( final String spaceUnits, final String timeUnits ) return spaceUnits + "/" + timeUnits; case RATE: return "/" + timeUnits; + case AREA: + return spaceUnits + "²"; default: case STRING: return null; diff --git a/src/main/java/org/mastodon/mamut/io/importer/trackmate/TrackMateImporter.java b/src/main/java/org/mastodon/mamut/io/importer/trackmate/TrackMateImporter.java index 80d792dd6..ba44378d9 100644 --- a/src/main/java/org/mastodon/mamut/io/importer/trackmate/TrackMateImporter.java +++ b/src/main/java/org/mastodon/mamut/io/importer/trackmate/TrackMateImporter.java @@ -94,6 +94,9 @@ import org.mastodon.properties.DoublePropertyMap; import org.mastodon.properties.IntPropertyMap; +import ij.IJ; +import ij.ImagePlus; + /** * Importer for TrackMate (http://imagej.net/TrackMate) files. *
@@ -162,7 +165,18 @@ public MamutProject createProject() throws IOException
imageFile = makDummyImage( imageDataEl );
}
}
- final MamutProject project = MamutProjectIO.fromBdvFile( imageFile );
+ final MamutProject project;
+ if ( imageFile.getAbsolutePath().endsWith( ".xml" ) )
+ {
+ // Point to a XML file -> it's a MaMuT file
+ project = MamutProjectIO.fromBdvFile( imageFile );
+ }
+ else
+ {
+ // Everything else: we assume it's an IJ image.
+ final ImagePlus imp = IJ.openImage( imageFile.getAbsolutePath() );
+ project = MamutProjectIO.fromImagePlus( imp );
+ }
// Set project time and space units
final Element modelEl = root.getChild( MODEL_TAG );
@@ -523,6 +537,8 @@ private static final Dimension dimensionToDimension( final String dimension )
return Dimension.COST;
case "ANGLE_RATE":
return Dimension.ANGLE_RATE;
+ case "AREA":
+ return Dimension.AREA;
default:
throw new IllegalArgumentException( "Unkown dimension " + dimension );
diff --git a/src/main/java/org/mastodon/mamut/launcher/LauncherGUI.java b/src/main/java/org/mastodon/mamut/launcher/LauncherGUI.java
index 3b4d1503d..04ddd7879 100644
--- a/src/main/java/org/mastodon/mamut/launcher/LauncherGUI.java
+++ b/src/main/java/org/mastodon/mamut/launcher/LauncherGUI.java
@@ -180,7 +180,7 @@ public LauncherGUI( final Consumer< String > projectOpener )
sidePanel.add( btnImportMamut, c );
c.gridx = 1;
- sidePanel.add( new JLabel( "import MaMuT" ), c );
+ sidePanel.add( new JLabel( "import TrackMate
& MaMuT" ), c );
c.gridx = 0;
c.gridy++;
diff --git a/src/main/resources/org/mastodon/app/icon-mamut-import-16x16-2.png b/src/main/resources/org/mastodon/app/icon-mamut-import-16x16-2.png
new file mode 100644
index 000000000..04907f01e
Binary files /dev/null and b/src/main/resources/org/mastodon/app/icon-mamut-import-16x16-2.png differ
diff --git a/src/main/resources/org/mastodon/app/icon-mamut-import-32x32-2.png b/src/main/resources/org/mastodon/app/icon-mamut-import-32x32-2.png
new file mode 100644
index 000000000..00a94b217
Binary files /dev/null and b/src/main/resources/org/mastodon/app/icon-mamut-import-32x32-2.png differ
diff --git a/src/main/resources/org/mastodon/app/icon-mamut-import-512x512-2.png b/src/main/resources/org/mastodon/app/icon-mamut-import-512x512-2.png
new file mode 100644
index 000000000..1a0f5321b
Binary files /dev/null and b/src/main/resources/org/mastodon/app/icon-mamut-import-512x512-2.png differ
diff --git a/src/test/resources/org/mastodon/mamut/io/importer/FakeTracks.tif b/src/test/resources/org/mastodon/mamut/io/importer/FakeTracks.tif
index e69de29bb..1224c9266 100644
Binary files a/src/test/resources/org/mastodon/mamut/io/importer/FakeTracks.tif and b/src/test/resources/org/mastodon/mamut/io/importer/FakeTracks.tif differ