当前位置: 首页>>代码示例>>C++>>正文


C++ ProgramState::Save方法代码示例

本文整理汇总了C++中ProgramState::Save方法的典型用法代码示例。如果您正苦于以下问题:C++ ProgramState::Save方法的具体用法?C++ ProgramState::Save怎么用?C++ ProgramState::Save使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProgramState的用法示例。


在下文中一共展示了ProgramState::Save方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SetUpOrLoadInitialState

void SetUpOrLoadInitialState(CommandLineOpts &inception_state, SeqListClass &my_keys, TrackProgress &my_progress, ImageSpecClass &my_image_spec, SlicedPrequel& my_prequel_setup)
{

  if ( !inception_state.bkg_control.signal_chunks.restart_from.empty() )
  {
    // restarting from saved computational state
    // beadfind, bfmask.bin and beadfind.h5 will be ignored

    // note that if we are here we will never load the separator data
    inception_state.sys_context.GenerateContext (); // find our directories
    inception_state.sys_context.SetUpAnalysisLocation();

    LoadBeadFindState(inception_state, my_keys, my_image_spec);
  }
  else if (inception_state.mod_control.reusePriorBeadfind && inception_state.bkg_control.signal_chunks.restart_from.empty())
  {
    // starting execution fresh, justBeadFind already run
    
    // get any state from beadFind
    LoadBeadFindState(inception_state, my_keys, my_image_spec);

	// save current command line options to state file
	std::string stateFile = inception_state.sys_context.analysisLocation + "/analysisState.json";
    if (rename(stateFile.c_str(),(inception_state.sys_context.analysisLocation+"/analysisState_beadfind.json").c_str()) )
    {
      fprintf(stdout, "Unable to copy beadfind analysisState.json");
    }

    SetUpKeys(my_keys, inception_state.key_context, inception_state.flow_context);
    ProgramState state ( stateFile );
    state.Save ( inception_state,my_keys,my_image_spec );
    state.WriteState();

    // region layout saved in inception_state.loc_context
    // region definitions in background model via my_prequel_setup
    my_prequel_setup.SetRegions ( inception_state.loc_context.numRegions,
				  my_image_spec.rows,my_image_spec.cols,
				  inception_state.loc_context.regionXSize,
				  inception_state.loc_context.regionYSize );
    my_prequel_setup.FileLocations ( inception_state.sys_context.analysisLocation );

  }
 else
 {  
   // starting execution fresh, justBeadFind not run
   inception_state.SetUpProcessing();

   CreateResultsFolder (inception_state.sys_context.GetResultsFolder());
   inception_state.sys_context.SetUpAnalysisLocation();
    
   // convert from old key representatino to more useful modern style  
   SetUpKeys(my_keys, inception_state.key_context, inception_state.flow_context);
  
   //@TODO: side effects here on the entire image class
   // after this point, Images will behave differently when read in
   SetUpToProcessImages ( my_image_spec, inception_state );

   // region layout saved into inception_state.loc_context
   SetUpRegionsForAnalysis ( my_image_spec.rows, my_image_spec.cols, inception_state.loc_context );

   // region layout shared in background model and beadfind via my_prequel_setup
   my_prequel_setup.SetRegions ( inception_state.loc_context.numRegions,
				 my_image_spec.rows,my_image_spec.cols,
				 inception_state.loc_context.regionXSize,
				 inception_state.loc_context.regionYSize );
   my_prequel_setup.FileLocations ( inception_state.sys_context.analysisLocation );
 }
  strncpy(ImageTransformer::PCATest,inception_state.img_control.PCATest,sizeof(ImageTransformer::PCATest)-1);

  fprintf(stdout, "Analysis region size is width %d, height %d\n", inception_state.loc_context.regionXSize, inception_state.loc_context.regionYSize);
}
开发者ID:Lingrui,项目名称:TS,代码行数:71,代码来源:SetUpForProcessing.cpp


注:本文中的ProgramState::Save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。