Esempio n. 1
0
 public static bool TrackHasTooManyHoles(SySal.TotalScan.Flexi.Track ftk)
 {
     SySal.Tracking.MIPEmulsionTrackInfo[] btks = ftk.BaseTracks;
     if (btks.Length < 3 && ftk.Length > 3)
     {
         return(true);
     }
     else if (Math.Round((btks[btks.Length - 3].TopZ - ftk[ftk.Length - 1].Info.TopZ) / 1300.0) > 4.0)
     {
         return(true);
     }
     return(false);
 }
Esempio n. 2
0
        /// <summary>
        /// Seeks a kink in a track using the default requirements of the procedure (3/5 base tracks in the first plates, kink sought in the first 4 plates).
        /// </summary>
        /// <param name="tk">the track where the kink is being sought.</param>
        public KinkSearchResult(SySal.TotalScan.Flexi.Track tk)
        {
            SySal.Tracking.MIPEmulsionTrackInfo[] info = tk.BaseTracks;
            System.Collections.ArrayList          ar   = new System.Collections.ArrayList();
            int    i     = info.Length - 1;
            double lastz = 0.0;

            if (i >= 0)
            {
                lastz = info[i].TopZ;
                ar.Add(info[i]);
                while (--i >= 0)
                {
                    if (Math.Round((info[i].TopZ - lastz) / 1300.0) >= 1.0)
                    {
                        ar.Add(info[i]);
                        lastz = info[i].TopZ;
                    }
                }
            }
            if (ar.Count < 3)
            {
                TransverseSlopeRMS = LongitudinalSlopeRMS = TransverseMaxDeltaSlopeRatio = LongitudinalMaxDeltaSlopeRatio = KinkDelta = -1.0;
                KinkIndex          = -1;
                ExceptionMessage   = "At least 3 base tracks are needed to search for a kink.";
                return;
            }
            SySal.TotalScan.Segment[] segs = new SySal.TotalScan.Segment[ar.Count];
            bool [] allowedkink            = new bool[segs.Length - 1];
            lastz = ((SySal.Tracking.MIPEmulsionTrackInfo)ar[0]).TopZ;
            for (i = 0; i < segs.Length; i++)
            {
                segs[i] = new SySal.TotalScan.Segment((SySal.Tracking.MIPEmulsionTrackInfo)ar[segs.Length - i - 1], new SySal.TotalScan.NullIndex());
                if (i < segs.Length - 1 && Math.Round((segs[i].Info.TopZ - lastz) / 1300.0) <= 3.0)
                {
                    allowedkink[i] = true;
                }
            }
            ComputeResult(segs, allowedkink);
            if (Math.Round((((SySal.Tracking.MIPEmulsionTrackInfo)ar[2]).TopZ - (lastz = ((SySal.Tracking.MIPEmulsionTrackInfo)ar[0]).TopZ)) / 1300.0) > 4.0)
            {
                TransverseMaxDeltaSlopeRatio = LongitudinalMaxDeltaSlopeRatio = KinkDelta = -1.0;
                KinkIndex        = -1;
                ExceptionMessage = "At least 3 base tracks must be found in the 5 most upstream plates to search for a kink.";
                return;
            }
            if (KinkIndex >= 0)
            {
                KinkIndex = (int)segs[KinkIndex].Info.Field;
            }
        }
Esempio n. 3
0
        public static bool TrackHasHoles(SySal.TotalScan.Flexi.Track ftk)
        {
            SySal.Tracking.MIPEmulsionTrackInfo[] btks = ftk.BaseTracks;
            int j;

            for (j = 0; j <= 3; j++)
            {
                if (btks.Length - 1 - j >= 0 && Math.Round((btks[btks.Length - 1 - j].TopZ - ftk[ftk.Length - 1].Info.TopZ) / 1300.0) > j)
                {
                    return(true);
                }
            }
            return(false);
        }
Esempio n. 4
0
        /// <summary>
        /// Saves a TotalScan volume to a stream.
        /// </summary>
        /// <param name="w">the stream to save to.</param>
        public override void Save(System.IO.Stream w)
        {
            Type firsttype = null;
            int  i, j;

            for (i = 0; i < m_Layers.Length && m_Layers[i].Length > 0; i++)
            {
                firsttype = m_Layers[i][0].Index.GetType();
                break;
            }
            for (; i < m_Layers.Length && firsttype != null; i++)
            {
                for (j = 0; j < m_Layers[i].Length; j++)
                {
                    if (m_Layers[i][j].Index.GetType() != firsttype)
                    {
                        firsttype = null;
                        break;
                    }
                }
            }
            if (firsttype == null)
            {
                for (i = 0; i < m_Layers.Length; i++)
                {
                    for (j = 0; j < m_Layers[i].Length; j++)
                    {
                        ((SySal.TotalScan.Flexi.Segment)m_Layers[i][j]).SetIndex(new SySal.TotalScan.NullIndex());
                    }
                }
            }

            for (i = 0; i < m_Tracks.Length; i++)
            {
                SySal.TotalScan.Flexi.Track   tk = (SySal.TotalScan.Flexi.Track)m_Tracks[i];
                SySal.TotalScan.Flexi.DataSet ds = tk.DataSet;
                tk.SetAttribute(new SySal.TotalScan.NamedAttributeIndex(DataSetString + ds.DataType), ds.DataId);
            }

            base.Save(w);
        }