66 * %%
77 * Redistribution and use in source and binary forms, with or without
88 * modification, are permitted provided that the following conditions are met:
9- *
9+ *
1010 * 1. Redistributions of source code must retain the above copyright notice,
1111 * this list of conditions and the following disclaimer.
1212 * 2. Redistributions in binary form must reproduce the above copyright notice,
1313 * this list of conditions and the following disclaimer in the documentation
1414 * and/or other materials provided with the distribution.
15- *
15+ *
1616 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
1717 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1818 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2828 */
2929package org .mastodon .graph .revised ;
3030
31+ import java .io .IOException ;
32+
33+ import org .mastodon .mamut .ProjectModel ;
34+ import org .mastodon .mamut .WindowManager ;
3135import org .mastodon .mamut .io .importer .ModelImporter ;
36+ import org .mastodon .mamut .io .project .MamutProject ;
3237import org .mastodon .mamut .model .Link ;
3338import org .mastodon .mamut .model .Model ;
3439import org .mastodon .mamut .model .Spot ;
40+ import org .mastodon .views .bdv .SharedBigDataViewerData ;
41+ import org .scijava .Context ;
3542
3643public class CreateLargeModelExample
3744{
38- private static final int N_STARTING_CELLS = 6 ;
45+ private static final int N_STARTING_CELLS = 10 ;
3946
4047 private static final int N_DIVISIONS = 17 ;
4148
@@ -160,8 +167,13 @@ private void addBranch( final Spot start, final double vx, final double vy, fina
160167 model .getGraph ().releaseRef ( link );
161168 }
162169
163- public static void main ( final String [] args )
170+ public static void main ( final String [] args ) throws IOException
164171 {
172+ // Print info on the JVM used to run the code.
173+ System .out .println ( "JVM: " + System .getProperty ( "java.vm.name" ) + " " + System .getProperty ( "java.vm.version" ) );
174+ System .out .println ( "Java: " + System .getProperty ( "java.version" ) );
175+ System .out .println ( "OS: " + System .getProperty ( "os.name" ) + " " + System .getProperty ( "os.version" ) + " " + System .getProperty ( "os.arch" ) );
176+
165177 final CreateLargeModelExample clme = new CreateLargeModelExample ();
166178 final long start = System .currentTimeMillis ();
167179 final Model model = clme .run ();
@@ -170,5 +182,22 @@ public static void main( final String[] args )
170182 System .out .println ( "Total number of spots: " + model .getGraph ().vertices ().size () );
171183 System .out .println ( String .format ( "Total memory used by the model: %.1f MB" ,
172184 ( Runtime .getRuntime ().totalMemory () - Runtime .getRuntime ().freeMemory () ) / 1e6d ) );
185+
186+
187+ final Context context = new Context ();
188+ final SharedBigDataViewerData imagedata = SharedBigDataViewerData .fromDummyFilename ( "x=1000 y=1000 z=100 sx=1 sy=1 sz=10 t=400.dummy" );
189+ final MamutProject project = new MamutProject ( "./large_model_example.mastodon" );
190+ final ProjectModel appModel = ProjectModel .create ( context , model , imagedata , project );
191+ final WindowManager wm = new WindowManager ( appModel );
192+
193+ // start = System.currentTimeMillis();
194+ // wm.createBigDataViewer();
195+ // end = System.currentTimeMillis();
196+ // System.out.println( "Rendering in the main viewer done in " + ( end - start ) / 1000. + " s." );
197+ //
198+ // start = System.currentTimeMillis();
199+ // wm.createTrackScheme( );
200+ // end = System.currentTimeMillis();
201+ // System.out.println( "Rendering in TrackScheme done in " + ( end - start ) / 1000. + " s." );
173202 }
174203}
0 commit comments