int main( int argc, char* argv[] ) { clock_t t0 = StartTiming(); /* ------------------ */ /* Parse command line */ /* ------------------ */ gArgs.SetCmdLine( argc, argv ); TS.SetLogFile( flog ); if( !ReadScriptParams( scr, gArgs.script, flog ) ) goto exit; inv_scl = 1.0 / scr.crossscale; /* ---------------- */ /* Read source data */ /* ---------------- */ if( gArgs.zb >= 0 && gArgs.za < 0 ) gArgs.za = gArgs.zb; TS.FillFromRgns( gArgs.srcmons, gArgs.idb, gArgs.zb, gArgs.za ); fprintf( flog, "Got %d images.\n", (int)TS.vtil.size() ); if( !TS.vtil.size() ) goto exit; TS.SetTileDimsFromImageFile(); TS.GetTileDims( gW, gH ); t0 = StopTiming( flog, "ReadFile", t0 ); /* ------------- */ /* Sort by layer */ /* ------------- */ TS.SortAll_z(); /* ----- */ /* Stuff */ /* ----- */ ScapeStuff(); /* ---- */ /* Done */ /* ---- */ exit: fprintf( flog, "\n" ); VMStats( flog ); fclose( flog ); return 0; }
int main( int argc, char* argv[] ) { /* ------------------ */ /* Parse command line */ /* ------------------ */ gArgs.SetCmdLine( argc, argv ); TS.SetLogFile( flog ); /* ---------------- */ /* Read source file */ /* ---------------- */ int isrickfile = !FileIsExt( gArgs.infile, ".xml" ); if( isrickfile ) TS.FillFromRickFile( gArgs.infile, gArgs.zmin, gArgs.zmax ); else TS.FillFromTrakEM2( gArgs.infile, gArgs.zmin, gArgs.zmax ); fprintf( flog, "Got %d images.\n", (int)TS.vtil.size() ); if( !TS.vtil.size() ) goto exit; if( isrickfile ) TS.SetTileDimsFromImageFile(); TS.SortAll_z_id(); ismrc = FileIsExt( TS.vtil[0].name.c_str(), ".mrc" ); if( ismrc ) Make_nmrc_paths(); /* ----------- */ /* Diagnostics */ /* ----------- */ if( isrickfile || ismrc ) { TS.WriteTrakEM2_EZ( "PreClicks.xml", gArgs.xml_type, gArgs.xml_min, gArgs.xml_max ); } if( gArgs.clk ) { TS.ApplyClix( tsClixAffine, gArgs.clk ); TS.WriteTrakEM2_EZ( "PostClicks.xml", gArgs.xml_type, gArgs.xml_min, gArgs.xml_max ); } /* ----------------------- */ /* Just make generator xml */ /* ----------------------- */ if( !gArgs.outdir[0] || !strcmp( gArgs.outdir, "NoSuch" ) ) goto exit; /* --------------- */ /* Create dir tree */ /* --------------- */ CreateTopDir(); WriteImageparamsFile(); CopyCropFile(); CopyLensFile(); if( !gArgs.NoFolds || ismrc ) { WriteSubfmFile(); WriteReportFile(); } ForEachLayer(); /* ---- */ /* Done */ /* ---- */ exit: fprintf( flog, "\n" ); fclose( flog ); return 0; }
int main( int argc, char* argv[] ) { clock_t t0 = StartTiming(); /* ------------------ */ /* Parse command line */ /* ------------------ */ gArgs.SetCmdLine( argc, argv ); TS.SetLogFile( flog ); if( !ReadScriptParams( scr, gArgs.script, flog ) ) exit( 42 ); if( scr.blockreqdz < 1 ) scr.blockreqdz == 1; else if( scr.blockreqdz > scr.blockmaxdz ) scr.blockreqdz = scr.blockmaxdz; inv_scl = 1.0 / scr.crossscale; /* --------------- */ /* Read block data */ /* --------------- */ gDat.ReadFile(); if( gArgs.abdbg ) { if( gArgs.dbgz == -1 ) gArgs.dbgz = gDat.za - 1; gDat.zmin = gArgs.dbgz; } /* ---------------- */ /* Read source data */ /* ---------------- */ string idb; IDBFromTemp( idb, "../..", flog ); if( idb.empty() ) exit( 42 ); TS.FillFromRgns( gDat.scaf, idb, gDat.zmin, gDat.za ); fprintf( flog, "Got %d images.\n", (int)TS.vtil.size() ); if( !TS.vtil.size() ) goto exit; TS.SetTileDimsFromImageFile(); TS.GetTileDims( gW, gH ); t0 = StopTiming( flog, "ReadFile", t0 ); /* ------------- */ /* Sort by layer */ /* ------------- */ TS.SortAll_z(); /* ----- */ /* Stuff */ /* ----- */ LayerLoop(); /* ---- */ /* Done */ /* ---- */ exit: fprintf( flog, "\n" ); VMStats( flog ); fclose( flog ); return 0; }