Esempio n. 1
0
        public void SetFirstStep(HistoryFilter filter)
        {
            HistoryStep step = FindStep(0);

            if (step == null)
            {
                step        = new HistoryStep();
                step.number = 0;
                step.Filter.Add(filter);
                step.category    = "Setup";
                step.description = "Original";

                AddStep(step);
            }
            else
            {
                for (int index = step.Filter.Count - 1; index >= 0; index--)
                {
                    if (string.Compare(filter.name, step.Filter[index].name, true) == 0)
                    {
                        step.Filter.RemoveAt(index);
                        break;
                    }
                }

                step.Filter.Add(filter);
            }
        }
Esempio n. 2
0
        public void AddStep(HistoryDualEnergy dualEnergy)
        {
            HistoryStep step = new HistoryStep();

            step.DualEnergy  = dualEnergy;
            step.number      = stepField.Count;
            step.category    = "Dual Energy";
            step.description = dualEnergy.name;

            UpdateStep(step);
        }
Esempio n. 3
0
        public void AddStep(HistoryBuffer buffer)
        {
            HistoryStep step = new HistoryStep();

            step.Buffer      = buffer;
            step.number      = stepField.Count;
            step.category    = "Buffer";
            step.description = buffer.name;

            UpdateStep(step);
        }
Esempio n. 4
0
        public void AddStep(HistoryHistogram histogram)
        {
            HistoryStep step = new HistoryStep();

            step.Histogram   = histogram;
            step.number      = stepField.Count;
            step.category    = "Histogram";
            step.description = "Range: " + histogram.start.ToString() + "-" + histogram.end.ToString();

            UpdateStep(step);
        }
Esempio n. 5
0
        public void AddStep(HistoryPseudoColor pseudoColor)
        {
            HistoryStep step = new HistoryStep();

            step.PseudoColor = pseudoColor;
            step.number      = stepField.Count;
            step.category    = "PseudoColor";
            step.description = pseudoColor.name;

            UpdateStep(step);
        }
Esempio n. 6
0
        public void AddStep(HistoryFilter filter)
        {
            HistoryStep step = new HistoryStep();

            step.Filter.Add(filter);
            step.number      = stepField.Count;
            step.category    = "Filter";
            step.description = filter.name;

            UpdateStep(step);
        }
Esempio n. 7
0
        public void ApplyStep(int number)
        {
            if (number >= 0 && CurrentHistoryChangedEvent != null)
            {
                HistoryStep step = GetStep(number);

                if (step != null)
                {
                    CurrentHistoryChangedEvent(step);
                }
            }
        }
Esempio n. 8
0
        public HistoryStep GetStep(int number)
        {
            HistoryStep step = new HistoryStep();

            for (int index = number; index >= 0; index--)
            {
                if (step.Buffer == null)
                {
                    step.Buffer = stepField[index].Buffer;
                }

                if (step.PseudoColor == null)
                {
                    step.PseudoColor = stepField[index].PseudoColor;
                }

                if (step.Histogram == null)
                {
                    step.Histogram = stepField[index].Histogram;
                }

                if (stepField[index].Filter != null)
                {
                    foreach (HistoryFilter filter in stepField[index].Filter)
                    {
                        bool matchFound = false;

                        foreach (HistoryFilter newFilter in step.Filter)
                        {
                            if (string.Compare(filter.name, newFilter.name, true) == 0)
                            {
                                matchFound = true;
                                break;
                            }
                        }

                        if (!matchFound)
                        {
                            step.Filter.Add(filter);
                        }
                    }
                }

                if (step.DualEnergy == null)
                {
                    step.DualEnergy = stepField[index].DualEnergy;
                }
            }

            return(step);
        }
Esempio n. 9
0
        private HistoryStep FindStep(int number)
        {
            HistoryStep historyStep = null;

            foreach (HistoryStep step in stepField)
            {
                if (step.number == number)
                {
                    historyStep = step;
                    break;
                }
            }

            return(historyStep);
        }
Esempio n. 10
0
        public void AddStep(HistoryStep step)
        {
            if (step.number >= 0)
            {
                HistoryStep historyStep = FindStep(step.number);

                if (historyStep != null)
                {
                    stepField.Remove(historyStep);
                }
            }
            else
            {
                step.number = stepField.Count;
            }

            UpdateStep(step);
        }
Esempio n. 11
0
        public void SetFirstStep(HistoryDualEnergy dualEnergy)
        {
            HistoryStep step = FindStep(0);

            if (step == null)
            {
                step             = new HistoryStep();
                step.number      = 0;
                step.DualEnergy  = dualEnergy;
                step.category    = "Setup";
                step.description = "Original";

                AddStep(step);
            }
            else
            {
                step.DualEnergy = dualEnergy;
            }
        }
Esempio n. 12
0
        public void SetFirstStep(HistoryHistogram histogram)
        {
            HistoryStep step = FindStep(0);

            if (step == null)
            {
                step             = new HistoryStep();
                step.number      = 0;
                step.Histogram   = histogram;
                step.category    = "Setup";
                step.description = "Original";

                AddStep(step);
            }
            else
            {
                step.Histogram = histogram;
            }
        }
Esempio n. 13
0
        public void SetFirstStep(HistoryBuffer buffer)
        {
            HistoryStep step = FindStep(0);

            if (step == null)
            {
                step             = new HistoryStep();
                step.number      = 0;
                step.Buffer      = buffer;
                step.category    = "Setup";
                step.description = "Original";

                AddStep(step);
            }
            else
            {
                step.Buffer = buffer;
            }
        }
Esempio n. 14
0
        public void SetFirstStep(HistoryPseudoColor pseudoColor)
        {
            HistoryStep step = FindStep(0);

            if (step == null)
            {
                step             = new HistoryStep();
                step.number      = 0;
                step.PseudoColor = pseudoColor;
                step.category    = "Setup";
                step.description = "Original";

                AddStep(step);
            }
            else
            {
                step.PseudoColor = pseudoColor;
            }
        }
Esempio n. 15
0
 private void UpdateStep(HistoryStep step)
 {
     stepField.Add(step);
     stepField.Sort(m_Comparer);
 }