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


C++ Segmentation::addDependency方法代码示例

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


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

示例1: defaultExecution

void defaultExecution(SysEnv &sysEnv, std::string &metricType, RegionTemplateCollection *rtCollection,
                      std::string tuningPolicy,
                      float *perf, float *totaldiffs, float *metricPerIteration,
                      float *diceNotCoolPerIteration,
                      uint64_t *totalexecutiontimes) {
    int versionNorm = 0, versionSeg = 0;
    int segCount = 0;
    std::vector<int> segComponentIds[rtCollection->getNumRTs()];
    std::vector<int> metricComponentIds[rtCollection->getNumRTs()];
    std::vector<int> diceNotCoolComponentIds[rtCollection->getNumRTs()];
    // Build application dependency graph
    // Instantiate application dependency graph
    for (int i = 0; i < rtCollection->getNumRTs(); i++) {

        int previousSegCompId = 0;
        // CREATE NORMALIZATION STEP
        ParameterSet parSetNormalization;
        std::vector<ArgumentBase *> targetMeanOptions;
        ArgumentFloatArray *targetMeanAux = new ArgumentFloatArray(ArgumentFloat(-0.632356));
        targetMeanAux->addArgValue(ArgumentFloat(-0.0516004));
        targetMeanAux->addArgValue(ArgumentFloat(0.0376543));
        targetMeanOptions.push_back(targetMeanAux);
        parSetNormalization.addArguments(targetMeanOptions);
        parSetNormalization.resetIterator();
        std::vector<ArgumentBase *> argSetInstanceNorm = parSetNormalization.getNextArgumentSetInstance();
        NormalizationComp *norm = new NormalizationComp();
        // normalization parameters
        norm->addArgument(new ArgumentInt(versionNorm));
        norm->addArgument(argSetInstanceNorm[0]);
        norm->addRegionTemplateInstance(rtCollection->getRT(i), rtCollection->getRT(i)->getName());
        sysEnv.executeComponent(norm);


        std::cout << "BEGIN: Default Execution: ";


        std::cout << std::endl;

        // Creating segmentation component
        Segmentation *seg = new Segmentation();

        // version of the data region red. Each parameter instance in norm creates a output w/ different version
        seg->addArgument(new ArgumentInt(versionNorm));
        // version of the data region generated by the segmentation stage
        seg->addArgument(new ArgumentInt(versionSeg));


        int blue = 220;
        int green = 220;
        int red = 220;
        float T1 = 5.0;
        float T2 = 4.0;
        int G1 = 80;
        int minSize = 11;
        int maxSize = 1000;
        int G2 = 45;
        int minSizePl = 30;
        int minSizeSeg = 21;
        int maxSizeSeg = 1000;
        int fillHolesConnectivity = 4;
        int reconConnectivity = 8;
        int watershedConnectivity = 8;

        // add remaining (application specific) parameters from the argSegInstance
        seg->addArgument(new ArgumentInt(
                (int) round(blue)));
        seg->addArgument(new ArgumentInt(
                (int) round(green)));
        seg->addArgument(new ArgumentInt(
                (int) round(red)));
        seg->addArgument(
                new ArgumentFloat((float) (T1)));
        seg->addArgument(
                new ArgumentFloat((float) (T2)));
        seg->addArgument(new ArgumentInt(
                (int) round(G1)));
        seg->addArgument(new ArgumentInt(
                (int) round(G2)));
        seg->addArgument(new ArgumentInt(
                (int) round(minSize)));
        seg->addArgument(new ArgumentInt(
                (int) round(maxSize)));
        seg->addArgument(new ArgumentInt(
                (int) round(minSizePl)));
        seg->addArgument(new ArgumentInt(
                (int) round(minSizeSeg)));
        seg->addArgument(new ArgumentInt(
                (int) round(maxSizeSeg)));
        seg->addArgument(new ArgumentInt(
                (int) round(fillHolesConnectivity)));
        seg->addArgument(new ArgumentInt(
                (int) round(reconConnectivity)));
        seg->addArgument(new ArgumentInt(
                (int) round(watershedConnectivity)));


        // and region template instance that it is suppose to process
        seg->addRegionTemplateInstance(rtCollection->getRT(i), rtCollection->getRT(i)->getName());
        seg->addDependency(norm->getId());

//.........这里部分代码省略.........
开发者ID:SBU-BMI,项目名称:region-templates,代码行数:101,代码来源:PipelineManager.cpp

示例2: ArgumentFloat


//.........这里部分代码省略.........
                            (int) round(tuningClient->getParamValue("blue", j))));
                    seg->addArgument(new ArgumentInt(
                            (int) round(tuningClient->getParamValue("green", j))));
                    seg->addArgument(new ArgumentInt(
                            (int) round(tuningClient->getParamValue("red", j))));
                    seg->addArgument(
                            new ArgumentFloat((float) (tuningClient->getParamValue("T1", j))));
                    seg->addArgument(
                            new ArgumentFloat((float) (tuningClient->getParamValue("T2", j))));
                    seg->addArgument(new ArgumentInt(
                            (int) round(tuningClient->getParamValue("G1", j))));
                    seg->addArgument(new ArgumentInt(
                            (int) round(tuningClient->getParamValue("G2", j))));
                    seg->addArgument(new ArgumentInt(
                            (int) round(tuningClient->getParamValue("minSize", j))));
                    seg->addArgument(new ArgumentInt(
                            (int) round(tuningClient->getParamValue("maxSize", j))));
                    seg->addArgument(new ArgumentInt(
                            (int) round(tuningClient->getParamValue("minSizePl", j))));
                    seg->addArgument(new ArgumentInt(
                            (int) round(tuningClient->getParamValue("minSizeSeg", j))));
                    seg->addArgument(new ArgumentInt(
                            (int) round(tuningClient->getParamValue("maxSizeSeg", j))));
                    seg->addArgument(new ArgumentInt(
                            (int) round(tuningClient->getParamValue("fillHoles", j))));
                    seg->addArgument(new ArgumentInt(
                            (int) round(tuningClient->getParamValue("recon", j))));
                    seg->addArgument(new ArgumentInt(
                            (int) round(tuningClient->getParamValue("watershed", j))));


                    // and region template instance that it is suppose to process
                    seg->addRegionTemplateInstance(rtCollection->getRT(i), rtCollection->getRT(i)->getName());
                    seg->addDependency(norm->getId());

                    std::cout << "Creating DiffMask" << std::endl;

                    RTPipelineComponentBase *metricComp;
                    DiceNotCoolMaskComp *diceNotCoolComp;

                    if (metricType.find("jaccard") != std::string::npos) metricComp = new JaccardMaskComp();
                    else metricComp = new DiceMaskComp();

                    if (metricType.find("dicenc") != std::string::npos) diceNotCoolComp = new DiceNotCoolMaskComp();

                    // version of the data region that will be read. It is created during the segmentation.
                    // region template name
                    metricComp->addArgument(new ArgumentInt(versionSeg));
                    metricComp->addRegionTemplateInstance(rtCollection->getRT(i), rtCollection->getRT(i)->getName());
                    metricComp->addDependency(seg->getId());


                    // add to the list of diff component ids.
                    segComponentIds[j].push_back(seg->getId());
                    metricComponentIds[j].push_back(metricComp->getId());


                    sysEnv.executeComponent(seg);
                    sysEnv.executeComponent(metricComp);

                    if (metricType.find("dicenc") != std::string::npos) {
                        diceNotCoolComp->addArgument(new ArgumentInt(versionSeg));
                        diceNotCoolComp->addRegionTemplateInstance(rtCollection->getRT(i),
                                                                   rtCollection->getRT(i)->getName());
                        diceNotCoolComp->addDependency(metricComp->getId());
                        diceNotCoolComponentIds[j].push_back(diceNotCoolComp->getId());
开发者ID:SBU-BMI,项目名称:region-templates,代码行数:67,代码来源:PipelineManager.cpp


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