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


C++ Experiment::reports方法代码示例

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


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

示例1: spatiotemporal_average

/*!
    \todo Clarify that spatio_temporal_average specifies milliseconds from 
    simulation start, not from simulation time window that is reported in 
    the file. also produce an error message if interval not in file. Should 
    actually probably go in the Stream_Playback_Control then.
*/
void spatiotemporal_average (URI            blue_config_filename, 
							 Filename		volume_compartment_mapping_filename,
							 Filename		output_filename_prefix,
							 Millisecond	begin_time,
							 Millisecond	end_time,
							 Millisecond	average_time_window,
                             bool           portable = false)
{
	Count frames_per_second(10);

    // experiment
    Experiment  experiment;
    experiment.open(blue_config_filename);
	Cell_Target circuit_target = experiment.cell_target("Column");

    std::cout << "Microcircuit: loading target Column" << std::endl;
    Count j = 0;

    for (Cell_Target::const_iterator i = circuit_target.begin();
        i != circuit_target.end(); ++i)
    {
        Neuron_Ptr new_neuron(new Neuron(experiment.microcircuit(), *i , j));
	    experiment.microcircuit().neurons().insert(new_neuron);
        ++j;
    }
	
	Volume_Temporal_Average<Millivolt, Micron, Millisecond>	
		temporal_average(Count (average_time_window * frames_per_second));

    Filter_Data<Microcircuit> microcircuit(experiment.microcircuit_ptr());
    
    // pipeline setup
    Pipeline    pipeline;
        
    std::cout << "Loading compartment report..." << std::endl;
    Reports_Specification::const_iterator result = 
        experiment.reports().find("allCompartments");
    if (result == experiment.reports().end())
    {
        std::cerr << "No \"allCompartments\" report found" << std::endl;
        exit(1);
    }
    Compartment_Report_Stream_Reader<Millivolt> binary_report_reader(* result, 2);
    binary_report_reader.cell_target(circuit_target);
    Compartment_Report_Printer<Millivolt>   printer;
    Compartment_Voltages_to_Microcircuit    report_link;
    Compartment_Voltage_Voxel_Average voltage_volume_average(volume_compartment_mapping_filename, false);
    Volume_Voltage_to_Byte voltage_to_byte;

	binary_report_reader.time_window(begin_time, end_time);
	binary_report_reader.speed(1.0);
	voltage_to_byte.dynamic_range(-65.0, -20.0);

	std::cout << "Pipeline 1: Setup spatio-temporal average." << std::endl;
	pipeline = binary_report_reader
		  + printer
		  + report_link
		  + microcircuit
		  + voltage_volume_average
		  + temporal_average;

	std::cout << "Pipeline 1: Started processing spatio-temporal average." 
		<< std::endl;
	pipeline.start();
	pipeline.wait_until_finished();
	pipeline.stop();
	std::cout << "Pipeline 1: Temporal average finished." << std::endl;


    std::cout << "Pipeline 2: Setup NRRD volume file writer." << std::endl;

    Pipeline    pipeline2;
    Filter_Reader<Volume<Millivolt, Micron, Millisecond> >   volume_buffer_reader;
    volume_buffer_reader.input_ptr(temporal_average.output_ptr());
	Volume_NRRD_File_Stream_Writer nrrd_file_writer(output_filename_prefix);

    pipeline2 = volume_buffer_reader 
                + voltage_to_byte 
                + nrrd_file_writer;

    std::cout << "Pipeline 2: Started writing volumes to disk." << std::endl;
	pipeline2.start();
	pipeline2.wait_until_finished();
	std::cout << "Pipeline 2: Written volumes to disk." << std::endl;
	
}
开发者ID:allogn,项目名称:TOUCH,代码行数:92,代码来源:spatiotemporal_average.cpp


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