/// <summary>
        /// afficher/masquer outil
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void outilsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.etat == true)
            {
                if (outilsToolStripMenuItem.Checked == true)
                {
                    outilsToolStripMenuItem.Checked = false;
                    outl.Hide();
                }
                else
                {
                    outilsToolStripMenuItem.Checked = true;
                    outl.Show();
                }
            }
            else
            {
                outilsToolStripMenuItem.Checked = true;
                outl = new Outils(this);
                outl.Show();
                outl.MdiParent = this;

                this.etat = true;
            }
        }
        /// <summary>
        /// constrcuteur
        /// </summary>
        ///
        public MainForm()
        {
            InitializeComponent();

            outl    = new Outils(this);
            multi   = new Multi_images(this);
            l_image = new ListeImage(this);
            init();
        }
        /// <summary>
        /// ouvrir
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void ouvrirToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ouvrir_fichier.Filter = "BMP (*.bmp)|*.bmp|JPEG (*.jpg,*.jpeg)|*.jpg;*.jpeg|PNG (*.png)|*.png|TIFF (*.tiff*.tif)|*.tif|GIF (*.gif)|*.gif|S (*.s)|*.s|BIM (*.bim)|*.bim|DICOM (*.dcm,*.dc3,*.dic)|*.dcm;*.dc3;*.dic|Tous les formats (*.*)|*.*";

            if (ouvrir_fichier.ShowDialog() == DialogResult.OK)
            {
                if (nb_forme_cree == 0)
                {
                    activer_fonctionalité(true);
                }

                currentFileName = ouvrir_fichier.FileName;
                int num_type = 0;
                try
                {
                    num_type = Util.type_fichier(ouvrir_fichier.FileName);
                }
                catch (Exception ex1)
                {
                    string msg_2 = "Fichier invalide";
                    MessageBox.Show(msg_2, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    activer_fonctionalité(false);
                    return;
                }

                //bool type = Util.type_dicom(currentFileName);
                switch (num_type)
                {
                case 1:
                    MainForm.btofront = false;
                    ImageBox childform = new ImageBox(this, currentFileName);


                    childform.MdiParent = this;
                    childform.Show();
                    childform.BringToFront();

                    try
                    {
                        childform.afficher_image(ouvrir_fichier.FileName);
                    }
                    catch (Exception ex2)
                    {
                        string msg_3 = "Fichier invalide";
                        MessageBox.Show(msg_3, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        childform.Dispose();
                        activer_fonctionalité(false);
                        return;
                    }
                    nb_forme_cree++;
                    l_image.ajouterfichier(ouvrir_fichier.FileName);


                    string msg = "Vous ne pouvez pas appliquer des modifications pour ce type de fichiers!\n";
                    MessageBox.Show(msg, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);

                    break;

                case 2:
                case 3:
                    MessageBox.Show("Veuillez entrer les paramètres nécessaires du fichier \"" + ouvrir_fichier.SafeFileName + "\" pour l’ouvrir", "Notification",
                                    MessageBoxButtons.OK, MessageBoxIcon.Information);

                    caract = new Carateristiques_exam(this, num_type);
                    caract.ShowDialog();

                    if (MainForm.forme_active != null)
                    {
                        MainForm.forme_active.BringToFront();
                    }

                    break;

                case 4:
                    MainForm.btofront = false;
                    int l = 0;
                    try
                    {
                        l = Util.nb_ligne_s(this.currentFileName);
                    }
                    catch (Exception exx)
                    {
                        string msg_1 = "Fichier invalide";
                        MessageBox.Show(msg_1, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        activer_fonctionalité(false);

                        return;
                    }
                    Examen examen = new Examen(l, Util.nb_ligne_s(this.currentFileName), Util.nb_image_s(this.currentFileName), Util.type_exam_s(this.currentFileName), true,
                                               true, false, 512, true, 2, true, false);
                    ImageBox child = new ImageBox(examen, this, this.currentFileName);
                    MainForm.nb_forme_cree++;
                    child.MdiParent = this;
                    child.Show();
                    child.BringToFront();

                    string s = Util.conversion_S_to_bim(MainForm.forme_active.nom_fichier);

                    Util.créer_image(Util.créer_tableu_valeur_pour_palette(MainForm.palette_par_defaut), Util.nb_ligne_s(MainForm.forme_active.nom_fichier), Util.nb_ligne_s(MainForm.forme_active.nom_fichier),
                                     s, MainForm.forme_active.nom_dossier);
                    MainForm.forme_active.afficher_image_bim();

                    this.l_image.ajouterfichier(MainForm.forme_active.nom_fichier);

                    Util.créer_image_palette(Util.créer_tableu_valeur_pour_palette(MainForm.palette_par_defaut), MainForm.forme_active.nom_dossier);
                    MainForm.forme_active.afficher_image_palette();
                    break;

                case 5:
                    MainForm.btofront = false;

                    int    l1      = Util.nb_ligne_bmp(this.currentFileName);
                    int    c1      = Util.nb_colon_bmp(this.currentFileName);
                    Examen examen1 = new Examen(l1, c1, 1, Examen.type_examen.statique, true,
                                                false, true, 1078, false, 1, false, false);
                    ImageBox child1 = new ImageBox(examen1, this, this.currentFileName);
                    MainForm.nb_forme_cree++;
                    child1.MdiParent = this;
                    child1.Show();
                    child1.BringToFront();
                    MainForm.forme_active.bmp256 = true;
                    string s2 = Util.convrsion_BMP_to_bim(MainForm.forme_active.nom_fichier);
                    Util.créer_image(Util.créer_tableu_valeur_pour_palette(MainForm.palette_par_defaut), l1, c1,
                                     s2, MainForm.forme_active.nom_dossier);
                    MainForm.forme_active.afficher_image_bim();

                    this.l_image.ajouterfichier(MainForm.forme_active.nom_fichier);

                    Util.créer_image_palette(Util.créer_tableu_valeur_pour_palette(MainForm.palette_par_defaut), MainForm.forme_active.nom_dossier);
                    MainForm.forme_active.afficher_image_palette();


                    break;

                case 6:

                    MainForm.btofront = false;
                    try
                    {
                        Dicom.info_DCM(this.currentFileName);
                    }
                    catch (Exception ex4)
                    {
                        string msg_5 = "Fichier invalide";
                        MessageBox.Show(msg_5, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        activer_fonctionalité(false);

                        return;
                    }
                    bool rvb = false;
                    if (Dicom.m == 2)
                    {
                        rvb = true;
                    }
                    else
                    {
                        if ((Dicom.m == 0) || (Dicom.m == 1))
                        {
                            rvb = false;
                        }
                    }

                    if (Dicom.m == 4)
                    {
                        string msg_6 = "Fichier compressé, affichage impossible!";
                        MessageBox.Show(msg_6, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        //activer_fonctionalité(false);
                        return;
                    }
                    if (Dicom.m == 3)
                    {
                        string msg_6 = "PaletteColor, affichage impossible!";
                        MessageBox.Show(msg_6, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        //activer_fonctionalité(false);
                        return;
                    }

                    int tail = Dicom.tail_entet;    // (int)(((int)new System.IO.FileInfo(currentFileName).Length) - (Dicom.nb_colon * Dicom.nb_ligne * Dicom.nbr_oct_valeur));
                    Examen.type_examen type_ex;
                    if (Dicom.n == 5)
                    {
                        type_ex = Examen.type_examen.tomographique;
                    }
                    else
                    {
                        if (Dicom.n == 6)
                        {
                            type_ex = Examen.type_examen.dynamique;
                        }
                        else
                        {
                            if (Dicom.n == 7)
                            {
                                type_ex = Examen.type_examen.synchronisé;
                            }
                            else
                            {
                                type_ex = Examen.type_examen.statique;
                            }
                        }
                    }
                    Examen examen2 = new Examen(Dicom.nb_ligne, Dicom.nb_colon, Dicom.nb_image, type_ex /* Examen.type_examen.tomographique*/, true,
                                                false, true, tail, false, Dicom.nbr_oct_valeur, false, rvb);

                    ImageBox child2 = new ImageBox(examen2, this, this.currentFileName);

                    MainForm.nb_forme_cree++;
                    child2.MdiParent = this;
                    child2.Show();
                    string palette         = Application.StartupPath + "\\utilitaire\\";
                    string palette_négatif = Application.StartupPath + "\\utilitaire\\";
                    string s3 = null;
                    if (Dicom.m == 2)
                    {
                        palette += "BMPpalc.pal";
                        MainForm.forme_active.afficher_image_rvb();
                        string msg1 = "Image RVB, vous ne pourriez appliquer aucun traitement sur ce type d’examen!";
                        MessageBox.Show(msg1, "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        s3 = Util.convrsion_DCM_bim(MainForm.forme_active.nom_fichier);
                        if (s3 == null)
                        {
                            return;
                        }



                        if (Dicom.m == 0)
                        {
                            palette         += "BMPpalg.pal";
                            palette_négatif += "BMPpalgn.pal";
                        }
                        if (Dicom.m == 1)
                        {
                            palette         += "BMPpalgn.pal";
                            palette_négatif += "BMPpalg.pal";
                        }
                    }
                    child2.palette_non_negatif = palette;
                    child2.palette_negatif     = palette_négatif;


                    if ((Dicom.m == 0) || (Dicom.m == 1))
                    {
                        Util.créer_image(Util.créer_tableu_valeur_pour_palette(palette), Dicom.nb_ligne, Dicom.nb_colon,
                                         s3, MainForm.forme_active.nom_dossier);
                        MainForm.forme_active.afficher_image_bim();
                    }

                    this.l_image.ajouterfichier(MainForm.forme_active.nom_fichier);

                    Util.créer_image_palette(Util.créer_tableu_valeur_pour_palette(palette), MainForm.forme_active.nom_dossier);
                    MainForm.forme_active.afficher_image_palette();

                    break;
                }



                //si on a appuier sur annuler dans la forme caracteristique
                if (etat3 == false)
                {
                    etat3 = true; return;
                }

                if ((MainForm.forme_active.caracteristique_exam != null) && (MainForm.forme_active.caracteristique_exam.type_ex == Examen.type_examen.tomographique) && (reconstructionToolStripMenuItem.Enabled == false))
                {
                    reconstructionToolStripMenuItem.Enabled = true;
                }

                if (etat == false)
                {
                    outl           = new Outils(this);
                    outl.MdiParent = this;
                    etat           = true;
                }
                if (etat2 == false)
                {
                    multi           = new Multi_images(this);
                    multi.MdiParent = this;
                    etat2           = true;
                }
                outilsToolStripMenuItem.Checked      = true;
                multiimagesToolStripMenuItem.Checked = true;
                outl.Show();
                multi.Show();
                //this.ActivateMdiChild(MainForm.forme_active);
            }
        }