示例#1
0
        public static List <PETSingleEvent> GenerateSinglesNoAtt(List <AnnihilationEvent> eventList, DetectorsConfiguration dc, string outDir, int index)
        {
            List <PETSingleEvent> result = new List <PETSingleEvent>();

            foreach (var ev in eventList)
            {
                Photon ph1 = new Photon(ev)
                {
                    Status = stat.Finished, Energy = 511E3
                },
                         ph2 = new Photon(ev, true)
                {
                    Status = stat.Finished, Energy = 511E3
                };

                PETSingleEvent se        = new PETSingleEvent();
                bool           detection = dc.Detect(ph1, out se);
                if (detection)
                {
                    result.Add(se);
                }

                detection = dc.Detect(ph2, out se);
                if (detection)
                {
                    result.Add(se);
                }
            }

            if (result.Count != 0)
            {
                WorkWithFiles.WriteSingleEventList(string.Format("{1}\\{0}.csv", index++, outDir), result);
            }
            Console.WriteLine("\tRegistered {0} events", result.Count);

            return(result);
        }
 public SinogramBuilder(DetectorsConfiguration dc, string outDir)
 {
     indexer     = new Indexer(dc.BlocksCount * dc.DetectorsPerBlock, dc.RingsCount * dc.DetectorsPerBlock, 2, 1);
     numSins     = 2 * indexer.NumRings - 1;
     this.outDir = outDir;
 }