CreateNodeTree() public method

public CreateNodeTree ( ) : void
return void
Ejemplo n.º 1
0
        /// <summary>
        /// 主連結成分(体積最大の連結成分)の構造抽出
        /// </summary>
        public void ExtractMainDendrite()
        {
            // SSDT

            //処理対象のクラスタ (体積が最大のもの)
            List <Point3DExd> scluster = clusters_e[0];

            //距離変換
            // Point3DExd initial = scluster[0];  //距離変換開始点 初めは適当に選択

            // BFSを2回行うことで、最も距離の離れた2点間の距離を得る
            uint maxdistance = SSDTLoopEco(scluster);

            // 木構造生成
            main_dendrite = new Dendrite((int)maxdistance + 1, param.resolutionXY, param.resolutionZ);

            foreach (var tmp in scluster)
            {
                if (!tmp.flag)
                {
                    //同一距離値クラスタ
                    var cld = new List <Point3Di>();

                    //距離値でクラスタリング
                    RecursiveDistanceClusteringEco(tmp, cld);

                    main_dendrite.AddNode((int)tmp.Distance, cld);
                }
            }

            //木構造生成
            main_dendrite.CreateNodeTree();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 副連結成分(体積最大の連結成分以外のやつ)の構造抽出
        /// </summary>
        public void ExtractSubDendrites()
        {
            sub_dendrites        = new List <Dendrite>();
            sub_dendrites_volume = new List <int>();

            for (uint i = 1; i < clusters_e.Count; i++)
            {
                IList <Point3DExd> scluster = clusters_e[i]; //処理対象クラスタ
                int volume = scluster.Count;

                //体積がしきい値を下回ったら戻る (ヒント: clusters_eは体積降順でソートされている)
                if (volume < param.volumeThreshold)
                {
                    return;
                }

                uint subdistance = SSDTLoopEco(scluster);

                Dendrite subDendrite = new Dendrite((int)subdistance + 1, param.resolutionXY, param.resolutionZ);

                foreach (var tmp in scluster)
                {
                    if (!tmp.flag)
                    {
                        var cld = new List <Point3Di>();//距離値クラスタリング用の一時リスト

                        //距離値でクラスタリング
                        RecursiveDistanceClusteringEco(tmp, cld);

                        subDendrite.AddNode((int)tmp.Distance, cld);
                    }
                }

                subDendrite.CreateNodeTree();

                //subリストに追加
                sub_dendrites.Add(subDendrite);
                sub_dendrites_volume.Add(volume);
            }
        }