コード例 #1
0
ファイル: Program.cs プロジェクト: GDanovski/AutoCellProfile
        static void Main(string[] args)
        {
            while (true)
            {
                Console.WriteLine("Input directory:");
                string dir = Console.ReadLine();
                Console.WriteLine("Profile type ( Avg = 0, Max = 1, Min = 2):");

                Data.ProfileType type = (Data.ProfileType) int.Parse(Console.ReadLine());

                string[]      files  = Directory.GetFiles(dir, "*.tif");
                List <Series> output = new List <Series>();

                foreach (string file in files)
                {
                    Console.WriteLine(file + " - processing...");

                    var image = GetImage(file);

                    Data.Dimention dim = image[0].Length > image[0][0].Length ? Data.Dimention.Y : Data.Dimention.X;

                    for (int i = 0; i < image.Length; i++)
                    {
                        output.Add(Data.AddSeries(i, image[i], dim, type));
                    }

                    WriteOutput(dir + "\\" + Path.GetFileNameWithoutExtension(file) + "_Profile.txt", dim, output);

                    output.Clear();
                }
            }
        }
コード例 #2
0
        private void button_Refresh_Click(object sender, EventArgs e)
        {
            Data.Dimention   dim  = (Data.Dimention) this.comboBox_Dimention.SelectedIndex;
            Data.ProfileType type = (Data.ProfileType) this.comboBox_Type.SelectedIndex;
            int[]            frames;

            if (!Data.GetFrtames(this.textBox_Frames.Text, out frames) && this.textBox_Frames.Text != "")
            {
                MessageBox.Show("Incorrect frames!");
                return;
            }

            chart1.SuspendLayout();
            chart1.Series.Clear();

            if (fi.image16bitFilter == null)
            {
                fi.image16bitFilter = fi.image16bit;
            }

            foreach (int frame in frames)
            {
                if (frame < fi.image16bitFilter.Length)
                {
                    chart1.Series.Add(Data.AddSeries(frame, fi.image16bitFilter[frame], dim, type));
                }
                else
                {
                    MessageBox.Show("Selected frames out of range!");
                    return;
                }
            }

            chart1.ResumeLayout();
            chart1.Invalidate();
            chart1.Update();
        }