本文整理汇总了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);
}