classificationRice / progRice.py
progRice.py
Raw
#! /usr/bin/env python
#  -*- coding: utf-8 -*-
#
# GUI module generated by PAGE version 7.5
#  in conjunction with Tcl version 8.6
#    Mar 15, 2023 07:50:13 PM -04  platform: Windows NT

import sys
import tkinter as tk
import tkinter.ttk as ttk
from tkinter.constants import *
import os.path

_script = sys.argv[0]
_location = os.path.dirname(_script)

import progRice_support

_bgcolor = '#d9d9d9'  # X11 color: 'gray85'
_fgcolor = '#000000'  # X11 color: 'black'
_compcolor = 'gray40' # X11 color: #666666
_ana1color = '#c3c3c3' # Closest X11 color: 'gray76'
_ana2color = 'beige' # X11 color: #f5f5dc
_tabfg1 = 'black' 
_tabfg2 = 'black' 
_tabbg1 = 'grey75' 
_tabbg2 = 'grey89' 
_bgmode = 'light' 

_style_code_ran = 0
def _style_code():
    global _style_code_ran
    if _style_code_ran:
       return
    style = ttk.Style()
    if sys.platform == "win32":
       style.theme_use('winnative')
    style.configure('.',background=_bgcolor)
    style.configure('.',foreground=_fgcolor)
    style.configure('.',font='TkDefaultFont')
    style.map('.',background =
       [('selected', _compcolor), ('active',_ana2color)])
    if _bgmode == 'dark':
       style.map('.',foreground =
         [('selected', 'white'), ('active','white')])
    else:
       style.map('.',foreground =
         [('selected', 'black'), ('active','black')])
    style.configure('Vertical.TScrollbar',  background=_bgcolor,
        arrowcolor= _fgcolor)
    style.configure('Horizontal.TScrollbar',  background=_bgcolor,
        arrowcolor= _fgcolor)
    _style_code_ran = 1

class TopPrincipal:
    def __init__(self, top=None):
        '''This class configures and populates the toplevel window.
           top is the toplevel containing window.'''

        top.geometry("528x537+395+70")
        top.minsize(120, 1)
        top.maxsize(3460, 1061)
        top.resizable(1,  1)
        top.title("Hyperspectral Seed Tools")
        top.configure(borderwidth="5")
        top.configure(relief="groove")
        top.configure(background="#d9d9d9")
        top.configure(highlightbackground="#d9d9d9")
        top.configure(highlightcolor="black")

        self.top = top
        self.dirImage = tk.StringVar()
        self.info = tk.StringVar()
        self.dirDark = tk.StringVar()
        self.dirWhite = tk.StringVar()
        self.b1 = tk.StringVar()
        self.b2 = tk.StringVar()
        self.b3 = tk.StringVar()
        self.valueCal = tk.IntVar()

        self.Labelframe1 = tk.LabelFrame(self.top)
        self.Labelframe1.place(relx=0.019, rely=0.019, relheight=0.225
                , relwidth=0.953)
        self.Labelframe1.configure(relief='groove')
        self.Labelframe1.configure(foreground="#000000")
        self.Labelframe1.configure(text='''Load Image (hdr)''')
        self.Labelframe1.configure(background="#d9d9d9")
        self.Labelframe1.configure(highlightbackground="#d9d9d9")
        self.Labelframe1.configure(highlightcolor="black")

        self.Button1 = tk.Button(self.Labelframe1)
        self.Button1.place(relx=0.795, rely=0.248, height=20, width=30
                , bordermode='ignore')
        self.Button1.configure(activebackground="beige")
        self.Button1.configure(activeforeground="black")
        self.Button1.configure(background="#f8f8f8")
        self.Button1.configure(command=progRice_support.findImage)
        self.Button1.configure(compound='left')
        self.Button1.configure(disabledforeground="#a3a3a3")
        self.Button1.configure(foreground="#000000")
        self.Button1.configure(highlightbackground="#d9d9d9")
        self.Button1.configure(highlightcolor="black")
        self.Button1.configure(pady="0")
        self.Button1.configure(text='''Find''')

        self.Label1 = tk.Label(self.Labelframe1)
        self.Label1.place(relx=0.02, rely=0.248, height=21, width=33
                , bordermode='ignore')
        self.Label1.configure(activebackground="#f9f9f9")
        self.Label1.configure(anchor='w')
        self.Label1.configure(background="#d9d9d9")
        self.Label1.configure(compound='left')
        self.Label1.configure(disabledforeground="#a3a3a3")
        self.Label1.configure(foreground="#000000")
        self.Label1.configure(highlightbackground="#d9d9d9")
        self.Label1.configure(highlightcolor="black")
        self.Label1.configure(text='''Path:''')

        self.Entry1 = tk.Entry(self.Labelframe1)
        self.Entry1.place(relx=0.099, rely=0.248, height=20, relwidth=0.684
                , bordermode='ignore')
        self.Entry1.configure(background="white")
        self.Entry1.configure(disabledforeground="#a3a3a3")
        self.Entry1.configure(font="TkFixedFont")
        self.Entry1.configure(foreground="#000000")
        self.Entry1.configure(highlightbackground="#d9d9d9")
        self.Entry1.configure(highlightcolor="black")
        self.Entry1.configure(insertbackground="black")
        self.Entry1.configure(selectbackground="#c4c4c4")
        self.Entry1.configure(selectforeground="black")
        self.Entry1.configure(textvariable=self.dirImage)

        self.Button7 = tk.Button(self.Labelframe1)
        self.Button7.place(relx=0.875, rely=0.165, height=40, width=45
                , bordermode='ignore')
        self.Button7.configure(activebackground="beige")
        self.Button7.configure(activeforeground="black")
        self.Button7.configure(background="#f8f8f8")
        self.Button7.configure(command=progRice_support.cargar)
        self.Button7.configure(compound='left')
        self.Button7.configure(disabledforeground="#a3a3a3")
        self.Button7.configure(foreground="#000000")
        self.Button7.configure(highlightbackground="#d9d9d9")
        self.Button7.configure(highlightcolor="black")
        self.Button7.configure(pady="0")
        self.Button7.configure(state='disabled')
        self.Button7.configure(text='''Load
Image''')

        self.Label8 = tk.Label(self.Labelframe1)
        self.Label8.place(relx=0.02, rely=0.579, height=41, width=474
                , bordermode='ignore')
        self.Label8.configure(activebackground="#f9f9f9")
        self.Label8.configure(background="#d9d9d9")
        self.Label8.configure(compound='left')
        self.Label8.configure(disabledforeground="#a3a3a3")
        self.Label8.configure(foreground="#5446fb")
        self.Label8.configure(highlightbackground="#d9d9d9")
        self.Label8.configure(highlightcolor="black")
        self.Label8.configure(relief="sunken")
        self.Label8.configure(text='''{}''')
        self.Label8.configure(textvariable=self.info)
        self.info.set('''{}''')

        self.Labelframe2 = tk.LabelFrame(self.top)
        self.Labelframe2.place(relx=0.019, rely=0.242, relheight=0.218
                , relwidth=0.148)
        self.Labelframe2.configure(relief='groove')
        self.Labelframe2.configure(foreground="#000000")
        self.Labelframe2.configure(text='''Calibration''')
        self.Labelframe2.configure(background="#d9d9d9")
        self.Labelframe2.configure(highlightbackground="#d9d9d9")
        self.Labelframe2.configure(highlightcolor="black")

        self.Radiobutton1 = tk.Radiobutton(self.Labelframe2)
        self.Radiobutton1.place(relx=0.128, rely=0.256, relheight=0.214
                , relwidth=0.564, bordermode='ignore')
        self.Radiobutton1.configure(activebackground="beige")
        self.Radiobutton1.configure(activeforeground="black")
        self.Radiobutton1.configure(anchor='w')
        self.Radiobutton1.configure(background="#d9d9d9")
        self.Radiobutton1.configure(compound='left')
        self.Radiobutton1.configure(disabledforeground="#a3a3a3")
        self.Radiobutton1.configure(foreground="#000000")
        self.Radiobutton1.configure(highlightbackground="#d9d9d9")
        self.Radiobutton1.configure(highlightcolor="black")
        self.Radiobutton1.configure(justify='left')
        self.Radiobutton1.configure(selectcolor="#d9d9d9")
        self.Radiobutton1.configure(state='disabled')
        self.Radiobutton1.configure(text='''No''')
        self.Radiobutton1.configure(value='0')
        self.Radiobutton1.configure(variable=self.valueCal)
        self.Radiobutton1.bind('<ButtonRelease-1>',lambda e:progRice_support.xxx(e))

        self.Radiobutton2 = tk.Radiobutton(self.Labelframe2)
        self.Radiobutton2.place(relx=0.128, rely=0.598, relheight=0.214
                , relwidth=0.59, bordermode='ignore')
        self.Radiobutton2.configure(activebackground="beige")
        self.Radiobutton2.configure(activeforeground="black")
        self.Radiobutton2.configure(anchor='w')
        self.Radiobutton2.configure(background="#d9d9d9")
        self.Radiobutton2.configure(compound='left')
        self.Radiobutton2.configure(disabledforeground="#a3a3a3")
        self.Radiobutton2.configure(foreground="#000000")
        self.Radiobutton2.configure(highlightbackground="#d9d9d9")
        self.Radiobutton2.configure(highlightcolor="black")
        self.Radiobutton2.configure(justify='left')
        self.Radiobutton2.configure(selectcolor="#d9d9d9")
        self.Radiobutton2.configure(state='disabled')
        self.Radiobutton2.configure(text='''Yes''')
        self.Radiobutton2.configure(value='1')
        self.Radiobutton2.configure(variable=self.valueCal)
        self.Radiobutton2.bind('<ButtonRelease-1>',lambda e:progRice_support.xx2(e))

        self.Frame1 = tk.Frame(self.top)
        self.Frame1.place(relx=0.17, rely=0.261, relheight=0.229, relwidth=0.801)

        self.Frame1.configure(relief='groove')
        self.Frame1.configure(borderwidth="2")
        self.Frame1.configure(relief="groove")
        self.Frame1.configure(background="#d9d9d9")
        self.Frame1.configure(highlightbackground="#d9d9d9")
        self.Frame1.configure(highlightcolor="black")

        self.Entry2 = tk.Entry(self.Frame1)
        self.Entry2.place(relx=0.213, rely=0.081, height=20, relwidth=0.671)
        self.Entry2.configure(background="white")
        self.Entry2.configure(disabledforeground="#a3a3a3")
        self.Entry2.configure(font="TkFixedFont")
        self.Entry2.configure(foreground="#000000")
        self.Entry2.configure(highlightbackground="#d9d9d9")
        self.Entry2.configure(highlightcolor="black")
        self.Entry2.configure(insertbackground="black")
        self.Entry2.configure(selectbackground="#c4c4c4")
        self.Entry2.configure(selectforeground="black")
        self.Entry2.configure(state='disabled')
        self.Entry2.configure(textvariable=self.dirDark)

        self.Entry3 = tk.Entry(self.Frame1)
        self.Entry3.place(relx=0.213, rely=0.325, height=20, relwidth=0.671)
        self.Entry3.configure(background="white")
        self.Entry3.configure(disabledforeground="#a3a3a3")
        self.Entry3.configure(font="TkFixedFont")
        self.Entry3.configure(foreground="#000000")
        self.Entry3.configure(highlightbackground="#d9d9d9")
        self.Entry3.configure(highlightcolor="black")
        self.Entry3.configure(insertbackground="black")
        self.Entry3.configure(selectbackground="#c4c4c4")
        self.Entry3.configure(selectforeground="black")
        self.Entry3.configure(state='disabled')
        self.Entry3.configure(textvariable=self.dirWhite)

        self.Label2 = tk.Label(self.Frame1)
        self.Label2.place(relx=0.024, rely=0.081, height=21, width=76)
        self.Label2.configure(activebackground="#f9f9f9")
        self.Label2.configure(anchor='w')
        self.Label2.configure(background="#d9d9d9")
        self.Label2.configure(compound='left')
        self.Label2.configure(disabledforeground="#a3a3a3")
        self.Label2.configure(foreground="#000000")
        self.Label2.configure(highlightbackground="#d9d9d9")
        self.Label2.configure(highlightcolor="black")
        self.Label2.configure(text='''Dark Image''')

        self.Label3 = tk.Label(self.Frame1)
        self.Label3.place(relx=0.024, rely=0.325, height=21, width=73)
        self.Label3.configure(activebackground="#f9f9f9")
        self.Label3.configure(anchor='w')
        self.Label3.configure(background="#d9d9d9")
        self.Label3.configure(compound='left')
        self.Label3.configure(disabledforeground="#a3a3a3")
        self.Label3.configure(foreground="#000000")
        self.Label3.configure(highlightbackground="#d9d9d9")
        self.Label3.configure(highlightcolor="black")
        self.Label3.configure(text='''White Image''')

        self.Button2 = tk.Button(self.Frame1)
        self.Button2.place(relx=0.898, rely=0.081, height=20, width=30)
        self.Button2.configure(activebackground="beige")
        self.Button2.configure(activeforeground="black")
        self.Button2.configure(background="#f8f8f8")
        self.Button2.configure(command=progRice_support.findDark)
        self.Button2.configure(compound='left')
        self.Button2.configure(disabledforeground="#a3a3a3")
        self.Button2.configure(foreground="#000000")
        self.Button2.configure(highlightbackground="#d9d9d9")
        self.Button2.configure(highlightcolor="black")
        self.Button2.configure(pady="0")
        self.Button2.configure(state='disabled')
        self.Button2.configure(text='''Find''')

        self.Button3 = tk.Button(self.Frame1)
        self.Button3.place(relx=0.898, rely=0.325, height=20, width=30)
        self.Button3.configure(activebackground="beige")
        self.Button3.configure(activeforeground="black")
        self.Button3.configure(background="#f8f8f8")
        self.Button3.configure(command=progRice_support.findWhite)
        self.Button3.configure(compound='left')
        self.Button3.configure(disabledforeground="#a3a3a3")
        self.Button3.configure(foreground="#000000")
        self.Button3.configure(highlightbackground="#d9d9d9")
        self.Button3.configure(highlightcolor="black")
        self.Button3.configure(pady="0")
        self.Button3.configure(state='disabled')
        self.Button3.configure(text='''Find''')

        self.Button4 = tk.Button(self.Frame1)
        self.Button4.place(relx=0.165, rely=0.569, height=40, width=105)
        self.Button4.configure(activebackground="beige")
        self.Button4.configure(activeforeground="black")
        self.Button4.configure(background="#f8f8f8")
        self.Button4.configure(command=progRice_support.calibrar)
        self.Button4.configure(compound='left')
        self.Button4.configure(disabledforeground="#a3a3a3")
        self.Button4.configure(foreground="#000000")
        self.Button4.configure(highlightbackground="#d9d9d9")
        self.Button4.configure(highlightcolor="black")
        self.Button4.configure(pady="0")
        self.Button4.configure(state='disabled')
        self.Button4.configure(text='''Calibrate''')

        self.Button8 = tk.Button(self.Frame1)
        self.Button8.place(relx=0.591, rely=0.569, height=40, width=105)
        self.Button8.configure(activebackground="beige")
        self.Button8.configure(activeforeground="black")
        self.Button8.configure(background="#f8f8f8")
        self.Button8.configure(command=progRice_support.saveImageCal)
        self.Button8.configure(compound='left')
        self.Button8.configure(disabledforeground="#a3a3a3")
        self.Button8.configure(foreground="#000000")
        self.Button8.configure(highlightbackground="#d9d9d9")
        self.Button8.configure(highlightcolor="black")
        self.Button8.configure(pady="0")
        self.Button8.configure(text='''Save 
Calibrated Image''')

        self.menubar = tk.Menu(top,font="TkMenuFont",bg=_bgcolor,fg=_fgcolor)
        top.configure(menu = self.menubar)

        self.menubar.add_command(label='File')
        self.menubar.add_command(label='Edit')
        self.menubar.add_command(label='Tools')

        self.Labelframe3 = tk.LabelFrame(self.top)
        self.Labelframe3.place(relx=0.511, rely=0.503, relheight=0.624
                , relwidth=0.464)
        self.Labelframe3.configure(relief='groove')
        self.Labelframe3.configure(foreground="#000000")
        self.Labelframe3.configure(text='''Segmentation''')
        self.Labelframe3.configure(background="#d9d9d9")
        self.Labelframe3.configure(highlightbackground="#d9d9d9")
        self.Labelframe3.configure(highlightcolor="black")

        self.Frame2 = tk.Frame(self.Labelframe3)
        self.Frame2.place(relx=0.041, rely=0.299, relheight=0.657, relwidth=0.898
                , bordermode='ignore')
        self.Frame2.configure(relief='groove')
        self.Frame2.configure(borderwidth="2")
        self.Frame2.configure(relief="groove")
        self.Frame2.configure(background="#c0c0c0")
        self.Frame2.configure(highlightbackground="#d9d9d9")
        self.Frame2.configure(highlightcolor="black")

        self.lblSegmentacion = tk.Label(self.Frame2)
        self.lblSegmentacion.place(relx=0.045, rely=0.045, height=200, width=200)

        self.lblSegmentacion.configure(activebackground="#f9f9f9")
        self.lblSegmentacion.configure(background="#ffffff")
        self.lblSegmentacion.configure(compound='left')
        self.lblSegmentacion.configure(disabledforeground="#a3a3a3")
        self.lblSegmentacion.configure(foreground="#000000")
        self.lblSegmentacion.configure(highlightbackground="#d9d9d9")
        self.lblSegmentacion.configure(highlightcolor="black")
        self.lblSegmentacion.configure(relief="sunken")

        self.Button6 = tk.Button(self.Labelframe3)
        self.Button6.place(relx=0.082, rely=0.09, height=45, width=65
                , bordermode='ignore')
        self.Button6.configure(activebackground="beige")
        self.Button6.configure(activeforeground="black")
        self.Button6.configure(background="#f8f8f8")
        self.Button6.configure(command=progRice_support.segmentar)
        self.Button6.configure(compound='left')
        self.Button6.configure(disabledforeground="#a3a3a3")
        self.Button6.configure(foreground="#000000")
        self.Button6.configure(highlightbackground="#d9d9d9")
        self.Button6.configure(highlightcolor="black")
        self.Button6.configure(pady="0")
        self.Button6.configure(text='''Segment
Image''')

        self.Button9 = tk.Button(self.Labelframe3)
        self.Button9.place(relx=0.367, rely=0.09, height=45, width=65
                , bordermode='ignore')
        self.Button9.configure(activebackground="beige")
        self.Button9.configure(activeforeground="black")
        self.Button9.configure(background="#f8f8f8")
        self.Button9.configure(command=progRice_support.guardarSegmentacion)
        self.Button9.configure(compound='left')
        self.Button9.configure(disabledforeground="#a3a3a3")
        self.Button9.configure(foreground="#000000")
        self.Button9.configure(highlightbackground="#d9d9d9")
        self.Button9.configure(highlightcolor="black")
        self.Button9.configure(pady="0")
        self.Button9.configure(text='''Save''')

        self.Button10 = tk.Button(self.Labelframe3)
        self.Button10.place(relx=0.653, rely=0.09, height=45, width=65
                , bordermode='ignore')
        self.Button10.configure(activebackground="beige")
        self.Button10.configure(activeforeground="black")
        self.Button10.configure(background="#f8f8f8")
        self.Button10.configure(command=progRice_support.abrirTools)
        self.Button10.configure(compound='left')
        self.Button10.configure(disabledforeground="#a3a3a3")
        self.Button10.configure(foreground="#000000")
        self.Button10.configure(highlightbackground="#d9d9d9")
        self.Button10.configure(highlightcolor="black")
        self.Button10.configure(pady="0")
        self.Button10.configure(text='''Tools''')

        self.Labelframe4 = tk.LabelFrame(self.top)
        self.Labelframe4.place(relx=0.019, rely=0.503, relheight=0.624
                , relwidth=0.464)
        self.Labelframe4.configure(relief='groove')
        self.Labelframe4.configure(foreground="#000000")
        self.Labelframe4.configure(text='''View Image''')
        self.Labelframe4.configure(background="#d9d9d9")
        self.Labelframe4.configure(highlightbackground="#d9d9d9")
        self.Labelframe4.configure(highlightcolor="black")

        self.Frame3 = tk.Frame(self.Labelframe4)
        self.Frame3.place(relx=0.041, rely=0.299, relheight=0.657, relwidth=0.898
                , bordermode='ignore')
        self.Frame3.configure(relief='groove')
        self.Frame3.configure(borderwidth="2")
        self.Frame3.configure(relief="groove")
        self.Frame3.configure(background="#c0c0c0")
        self.Frame3.configure(highlightbackground="#d9d9d9")
        self.Frame3.configure(highlightcolor="black")

        self.lblImage = tk.Label(self.Frame3)
        self.lblImage.place(relx=0.045, rely=0.045, height=200, width=200)
        self.lblImage.configure(activebackground="#f9f9f9")
        self.lblImage.configure(background="#ffffff")
        self.lblImage.configure(compound='center')
        self.lblImage.configure(disabledforeground="#a3a3a3")
        self.lblImage.configure(foreground="#000000")
        self.lblImage.configure(highlightbackground="#d9d9d9")
        self.lblImage.configure(highlightcolor="black")
        self.lblImage.configure(relief="sunken")

        self.Label5 = tk.Label(self.Labelframe4)
        self.Label5.place(relx=0.041, rely=0.09, height=21, width=56
                , bordermode='ignore')
        self.Label5.configure(activebackground="#f9f9f9")
        self.Label5.configure(anchor='w')
        self.Label5.configure(background="#d9d9d9")
        self.Label5.configure(compound='left')
        self.Label5.configure(disabledforeground="#a3a3a3")
        self.Label5.configure(foreground="#000000")
        self.Label5.configure(highlightbackground="#d9d9d9")
        self.Label5.configure(highlightcolor="black")
        self.Label5.configure(text='''Red Band''')

        self.Label6 = tk.Label(self.Labelframe4)
        self.Label6.place(relx=0.041, rely=0.149, height=21, width=67
                , bordermode='ignore')
        self.Label6.configure(activebackground="#f9f9f9")
        self.Label6.configure(anchor='w')
        self.Label6.configure(background="#d9d9d9")
        self.Label6.configure(compound='left')
        self.Label6.configure(disabledforeground="#a3a3a3")
        self.Label6.configure(foreground="#000000")
        self.Label6.configure(highlightbackground="#d9d9d9")
        self.Label6.configure(highlightcolor="black")
        self.Label6.configure(text='''Green Band''')

        self.Label7 = tk.Label(self.Labelframe4)
        self.Label7.place(relx=0.041, rely=0.209, height=21, width=59
                , bordermode='ignore')
        self.Label7.configure(activebackground="#f9f9f9")
        self.Label7.configure(anchor='w')
        self.Label7.configure(background="#d9d9d9")
        self.Label7.configure(compound='left')
        self.Label7.configure(disabledforeground="#a3a3a3")
        self.Label7.configure(foreground="#000000")
        self.Label7.configure(highlightbackground="#d9d9d9")
        self.Label7.configure(highlightcolor="black")
        self.Label7.configure(text='''Blue Band''')

        self.Entry5 = tk.Entry(self.Labelframe4)
        self.Entry5.place(relx=0.327, rely=0.09, height=20, relwidth=0.098
                , bordermode='ignore')
        self.Entry5.configure(background="white")
        self.Entry5.configure(disabledforeground="#a3a3a3")
        self.Entry5.configure(font="TkFixedFont")
        self.Entry5.configure(foreground="#000000")
        self.Entry5.configure(highlightbackground="#d9d9d9")
        self.Entry5.configure(highlightcolor="black")
        self.Entry5.configure(insertbackground="black")
        self.Entry5.configure(selectbackground="#c4c4c4")
        self.Entry5.configure(selectforeground="black")
        self.Entry5.configure(textvariable=self.b1)

        self.Entry6 = tk.Entry(self.Labelframe4)
        self.Entry6.place(relx=0.327, rely=0.149, height=20, relwidth=0.098
                , bordermode='ignore')
        self.Entry6.configure(background="white")
        self.Entry6.configure(disabledforeground="#a3a3a3")
        self.Entry6.configure(font="TkFixedFont")
        self.Entry6.configure(foreground="#000000")
        self.Entry6.configure(highlightbackground="#d9d9d9")
        self.Entry6.configure(highlightcolor="black")
        self.Entry6.configure(insertbackground="black")
        self.Entry6.configure(selectbackground="#c4c4c4")
        self.Entry6.configure(selectforeground="black")
        self.Entry6.configure(textvariable=self.b2)

        self.Entry7 = tk.Entry(self.Labelframe4)
        self.Entry7.place(relx=0.327, rely=0.209, height=20, relwidth=0.098
                , bordermode='ignore')
        self.Entry7.configure(background="white")
        self.Entry7.configure(disabledforeground="#a3a3a3")
        self.Entry7.configure(font="TkFixedFont")
        self.Entry7.configure(foreground="#000000")
        self.Entry7.configure(highlightbackground="#d9d9d9")
        self.Entry7.configure(highlightcolor="black")
        self.Entry7.configure(insertbackground="black")
        self.Entry7.configure(selectbackground="#c4c4c4")
        self.Entry7.configure(selectforeground="black")
        self.Entry7.configure(textvariable=self.b3)

        self.Button5 = tk.Button(self.Labelframe4)
        self.Button5.place(relx=0.571, rely=0.09, height=54, width=77
                , bordermode='ignore')
        self.Button5.configure(activebackground="beige")
        self.Button5.configure(activeforeground="black")
        self.Button5.configure(background="#f8f8f8")
        self.Button5.configure(command=progRice_support.desplegar)
        self.Button5.configure(compound='left')
        self.Button5.configure(disabledforeground="#a3a3a3")
        self.Button5.configure(foreground="#000000")
        self.Button5.configure(highlightbackground="#d9d9d9")
        self.Button5.configure(highlightcolor="black")
        self.Button5.configure(pady="0")
        self.Button5.configure(text='''Display
Image''')

class Toplevel2:
    def __init__(self, top=None):
        '''This class configures and populates the toplevel window.
           top is the toplevel containing window.'''

        top.geometry("848x572+368+204")
        top.minsize(120, 1)
        top.maxsize(1540, 845)
        top.resizable(1,  1)
        top.title("Tools")
        top.configure(background="#d8d8d8")
        top.configure(highlightbackground="#d9d9d9")
        top.configure(highlightcolor="black")

        self.top = top
        self.dirFolder = tk.StringVar()
        self.infoFeatures = tk.StringVar()
        self.cmbClase = tk.StringVar()
        self.cmbTime = tk.StringVar()
        self.cmbNumero = tk.StringVar()
        self.estadoCarg = tk.StringVar()

        self.Labelframe5 = tk.LabelFrame(self.top)
        self.Labelframe5.place(relx=0.012, rely=0.017, relheight=0.114
                , relwidth=0.519)
        self.Labelframe5.configure(relief='groove')
        self.Labelframe5.configure(foreground="#000000")
        self.Labelframe5.configure(text='''Select Folder''')
        self.Labelframe5.configure(background="#d8d8d8")
        self.Labelframe5.configure(highlightbackground="#d9d9d9")
        self.Labelframe5.configure(highlightcolor="black")

        self.Entry4 = tk.Entry(self.Labelframe5)
        self.Entry4.place(relx=0.023, rely=0.462, height=20, relwidth=0.895
                , bordermode='ignore')
        self.Entry4.configure(background="white")
        self.Entry4.configure(disabledforeground="#a3a3a3")
        self.Entry4.configure(font="TkFixedFont")
        self.Entry4.configure(foreground="#000000")
        self.Entry4.configure(highlightbackground="#d9d9d9")
        self.Entry4.configure(highlightcolor="black")
        self.Entry4.configure(insertbackground="black")
        self.Entry4.configure(selectbackground="#c4c4c4")
        self.Entry4.configure(selectforeground="black")
        self.Entry4.configure(textvariable=self.dirFolder)

        self.Button11 = tk.Button(self.Labelframe5)
        self.Button11.place(relx=0.909, rely=0.462, height=24, width=27
                , bordermode='ignore')
        self.Button11.configure(activebackground="beige")
        self.Button11.configure(activeforeground="black")
        self.Button11.configure(background="#f8f8f8")
        self.Button11.configure(command=progRice_support.selectFolder)
        self.Button11.configure(compound='left')
        self.Button11.configure(disabledforeground="#a3a3a3")
        self.Button11.configure(foreground="#000000")
        self.Button11.configure(highlightbackground="#d9d9d9")
        self.Button11.configure(highlightcolor="black")
        self.Button11.configure(pady="0")
        self.Button11.configure(text='''Find''')

        self.lblInfoFeatures = tk.Label(self.top)
        self.lblInfoFeatures.place(relx=0.542, rely=0.035, height=191, width=234)

        self.lblInfoFeatures.configure(activebackground="#f9f9f9")
        self.lblInfoFeatures.configure(background="#f7f7f7")
        self.lblInfoFeatures.configure(compound='left')
        self.lblInfoFeatures.configure(disabledforeground="#a3a3a3")
        self.lblInfoFeatures.configure(font="-family {Segoe UI} -size 12")
        self.lblInfoFeatures.configure(foreground="#000000")
        self.lblInfoFeatures.configure(highlightbackground="#d9d9d9")
        self.lblInfoFeatures.configure(highlightcolor="black")
        self.lblInfoFeatures.configure(relief="sunken")
        self.lblInfoFeatures.configure(text='''Features:''')
        self.lblInfoFeatures.configure(textvariable=self.infoFeatures)
        self.infoFeatures.set('''Features:''')

        self.Labelframe6 = tk.LabelFrame(self.top)
        self.Labelframe6.place(relx=0.012, rely=0.385, relheight=0.603
                , relwidth=0.979)
        self.Labelframe6.configure(relief='groove')
        self.Labelframe6.configure(foreground="#000000")
        self.Labelframe6.configure(text='''Image and Spectrum Graph''')
        self.Labelframe6.configure(background="#d8d8d8")
        self.Labelframe6.configure(highlightbackground="#d9d9d9")
        self.Labelframe6.configure(highlightcolor="black")

        self.lblImagenEspectro = tk.Label(self.Labelframe6)
        self.lblImagenEspectro.place(relx=0.012, rely=0.087, height=301
                , width=804, bordermode='ignore')
        self.lblImagenEspectro.configure(activebackground="#f9f9f9")
        self.lblImagenEspectro.configure(anchor='w')
        self.lblImagenEspectro.configure(background="#ffffff")
        self.lblImagenEspectro.configure(compound='left')
        self.lblImagenEspectro.configure(disabledforeground="#a3a3a3")
        self.lblImagenEspectro.configure(foreground="#000000")
        self.lblImagenEspectro.configure(highlightbackground="#d9d9d9")
        self.lblImagenEspectro.configure(highlightcolor="black")
        self.lblImagenEspectro.configure(relief="sunken")

        self.Labelframe7 = tk.LabelFrame(self.top)
        self.Labelframe7.place(relx=0.153, rely=0.14, relheight=0.233
                , relwidth=0.377)
        self.Labelframe7.configure(relief='groove')
        self.Labelframe7.configure(foreground="#000000")
        self.Labelframe7.configure(text='''Select Image''')
        self.Labelframe7.configure(background="#d8d8d8")
        self.Labelframe7.configure(highlightbackground="#d9d9d9")
        self.Labelframe7.configure(highlightcolor="black")

        self.Label10 = tk.Label(self.Labelframe7)
        self.Label10.place(relx=0.031, rely=0.226, height=21, width=36
                , bordermode='ignore')
        self.Label10.configure(activebackground="#f9f9f9")
        self.Label10.configure(anchor='w')
        self.Label10.configure(background="#d8d8d8")
        self.Label10.configure(compound='left')
        self.Label10.configure(disabledforeground="#a3a3a3")
        self.Label10.configure(foreground="#000000")
        self.Label10.configure(highlightbackground="#d9d9d9")
        self.Label10.configure(highlightcolor="black")
        self.Label10.configure(text='''Class:''')

        self.Label11 = tk.Label(self.Labelframe7)
        self.Label11.place(relx=0.031, rely=0.451, height=21, width=54
                , bordermode='ignore')
        self.Label11.configure(activebackground="#f9f9f9")
        self.Label11.configure(anchor='w')
        self.Label11.configure(background="#d8d8d8")
        self.Label11.configure(compound='left')
        self.Label11.configure(disabledforeground="#a3a3a3")
        self.Label11.configure(foreground="#000000")
        self.Label11.configure(highlightbackground="#d9d9d9")
        self.Label11.configure(highlightcolor="black")
        self.Label11.configure(text='''Subclass:''')

        self.Label12 = tk.Label(self.Labelframe7)
        self.Label12.place(relx=0.031, rely=0.677, height=21, width=53
                , bordermode='ignore')
        self.Label12.configure(activebackground="#f9f9f9")
        self.Label12.configure(anchor='w')
        self.Label12.configure(background="#d8d8d8")
        self.Label12.configure(compound='left')
        self.Label12.configure(disabledforeground="#a3a3a3")
        self.Label12.configure(foreground="#000000")
        self.Label12.configure(highlightbackground="#d9d9d9")
        self.Label12.configure(highlightcolor="black")
        self.Label12.configure(text='''Number:''')

        self.Button12 = tk.Button(self.Labelframe7)
        self.Button12.place(relx=0.688, rely=0.451, height=54, width=87
                , bordermode='ignore')
        self.Button12.configure(activebackground="beige")
        self.Button12.configure(activeforeground="black")
        self.Button12.configure(background="#f8f8f8")
        self.Button12.configure(command=progRice_support.graficarYmostrarEspectro)
        self.Button12.configure(compound='left')
        self.Button12.configure(disabledforeground="#a3a3a3")
        self.Button12.configure(foreground="#000000")
        self.Button12.configure(highlightbackground="#d9d9d9")
        self.Button12.configure(highlightcolor="black")
        self.Button12.configure(pady="0")
        self.Button12.configure(text='''Plot Image 
and 
Spectrum''')

        _style_code()
        self.TCombobox1 = ttk.Combobox(self.Labelframe7)
        self.TCombobox1.place(relx=0.219, rely=0.226, relheight=0.158
                , relwidth=0.447, bordermode='ignore')
        self.TCombobox1.configure(justify='center')
        self.TCombobox1.configure(state='readonly')
        self.TCombobox1.configure(textvariable=self.cmbClase)
        self.TCombobox1.configure(takefocus="")
        self.TCombobox1.bind('<<ComboboxSelected>>',lambda e:progRice_support.cmbSelected1(e))

        self.TCombobox2 = ttk.Combobox(self.Labelframe7)
        self.TCombobox2.place(relx=0.219, rely=0.451, relheight=0.158
                , relwidth=0.447, bordermode='ignore')
        self.TCombobox2.configure(state='readonly')
        self.TCombobox2.configure(textvariable=self.cmbTime)
        self.TCombobox2.configure(takefocus="")
        self.TCombobox2.bind('<<ComboboxSelected>>',lambda e:progRice_support.cmbSelected2(e))

        self.TCombobox3 = ttk.Combobox(self.Labelframe7)
        self.TCombobox3.place(relx=0.219, rely=0.677, relheight=0.158
                , relwidth=0.447, bordermode='ignore')
        self.TCombobox3.configure(textvariable=self.cmbNumero)
        self.TCombobox3.configure(takefocus="")

        self.TButton7 = ttk.Button(self.Labelframe7)
        self.TButton7.place(relx=0.688, rely=0.15, height=35, width=86
                , bordermode='ignore')
        self.TButton7.configure(command=progRice_support.verSpectrum)
        self.TButton7.configure(takefocus="")
        self.TButton7.configure(text='''Spectrum''')
        self.TButton7.configure(compound='left')

        self.Frame6 = tk.Frame(self.top)
        self.Frame6.place(relx=0.012, rely=0.14, relheight=0.236, relwidth=0.136)

        self.Frame6.configure(relief='groove')
        self.Frame6.configure(borderwidth="2")
        self.Frame6.configure(relief="groove")
        self.Frame6.configure(background="#d8d8d8")
        self.Frame6.configure(highlightbackground="#d9d9d9")
        self.Frame6.configure(highlightcolor="black")

        self.bProgreso = ttk.Progressbar(self.Frame6)
        self.bProgreso.place(relx=0.087, rely=0.741, relwidth=0.87, relheight=0.0
                , height=22)
        self.bProgreso.configure(maximum="792")

        self.TButton2 = ttk.Button(self.Frame6)
        self.TButton2.place(relx=0.087, rely=0.074, height=30, width=96)
        self.TButton2.configure(command=progRice_support.loadImageFolder)
        self.TButton2.configure(takefocus="")
        self.TButton2.configure(text='''Load Images''')
        self.TButton2.configure(compound='left')

        self.Label4 = tk.Label(self.Frame6)
        self.Label4.place(relx=0.087, rely=0.296, height=61, width=94)
        self.Label4.configure(activebackground="#d9d9d9")
        self.Label4.configure(background="#d8d8d8")
        self.Label4.configure(compound='left')
        self.Label4.configure(disabledforeground="#a3a3a3")
        self.Label4.configure(foreground="#000000")
        self.Label4.configure(highlightbackground="#d9d9d9")
        self.Label4.configure(highlightcolor="black")
        self.Label4.configure(text='''Tlabel''')
        self.Label4.configure(textvariable=self.estadoCarg)
        self.estadoCarg.set('''Tlabel''')

        self.Labelframe8 = tk.LabelFrame(self.top)
        self.Labelframe8.place(relx=0.836, rely=0.033, relheight=0.318
                , relwidth=0.153)
        self.Labelframe8.configure(relief='groove')
        self.Labelframe8.configure(foreground="#000000")
        self.Labelframe8.configure(text='''Tools''')
        self.Labelframe8.configure(background="#d8d8d8")
        self.Labelframe8.configure(highlightbackground="#d9d9d9")
        self.Labelframe8.configure(highlightcolor="black")

        self.TButton1 = ttk.Button(self.Labelframe8)
        self.TButton1.place(relx=0.077, rely=0.165, height=40, width=106
                , bordermode='ignore')
        self.TButton1.configure(command=progRice_support.featureExtraction)
        self.TButton1.configure(takefocus="")
        self.TButton1.configure(text='''Feature
Extraction''')
        self.TButton1.configure(compound='center')

        self.TButton3 = ttk.Button(self.Labelframe8)
        self.TButton3.place(relx=0.077, rely=0.44, height=40, width=106
                , bordermode='ignore')
        self.TButton3.configure(command=progRice_support.plotSpectrumClasses)
        self.TButton3.configure(takefocus="")
        self.TButton3.configure(text='''Plot Spectrum 
Between Classes''')
        self.TButton3.configure(compound='left')

        self.TButton6 = ttk.Button(self.Labelframe8)
        self.TButton6.place(relx=0.077, rely=0.714, height=40, width=106
                , bordermode='ignore')
        self.TButton6.configure(command=progRice_support.openWindowsClasssification)
        self.TButton6.configure(takefocus="")
        self.TButton6.configure(text='''Classification''')
        self.TButton6.configure(compound='left')

class Toplevel3:
    def __init__(self, top=None):
        '''This class configures and populates the toplevel window.
           top is the toplevel containing window.'''

        top.geometry("399x195+545+346")
        top.minsize(120, 1)
        top.maxsize(1540, 845)
        top.resizable(1,  1)
        top.title("Cut and Save Segmentation")
        top.configure(background="#d8d8d8")
        top.configure(highlightbackground="#d9d9d9")
        top.configure(highlightcolor="black")

        self.top = top
        self.dirFolder = tk.StringVar()
        self.cmbClase4 = tk.StringVar()
        self.cmbSubClase5 = tk.StringVar()
        self.estadoCarg2 = tk.StringVar()

        _style_code()
        self.TLabelframe1 = ttk.Labelframe(self.top)
        self.TLabelframe1.place(relx=0.025, rely=0.051, relheight=0.282
                , relwidth=0.952)
        self.TLabelframe1.configure(relief='ridge')
        self.TLabelframe1.configure(text='''Select Folder''')
        self.TLabelframe1.configure(relief="ridge")

        self.TButton4 = ttk.Button(self.TLabelframe1)
        self.TButton4.place(relx=0.868, rely=0.364, height=25, width=36
                , bordermode='ignore')
        self.TButton4.configure(command=progRice_support.openSelFolder)
        self.TButton4.configure(takefocus="")
        self.TButton4.configure(text='''Find''')
        self.TButton4.configure(compound='left')

        self.TEntry2 = ttk.Entry(self.TLabelframe1)
        self.TEntry2.place(relx=0.158, rely=0.364, relheight=0.382, relwidth=0.7
                , bordermode='ignore')
        self.TEntry2.configure(textvariable=self.dirFolder)
        self.TEntry2.configure(takefocus="")
        self.TEntry2.configure(cursor="fleur")

        self.TLabel3 = ttk.Label(self.TLabelframe1)
        self.TLabel3.place(relx=0.053, rely=0.364, height=19, width=31
                , bordermode='ignore')
        self.TLabel3.configure(background="#d9d9d9")
        self.TLabel3.configure(foreground="#000000")
        self.TLabel3.configure(font="TkDefaultFont")
        self.TLabel3.configure(relief="flat")
        self.TLabel3.configure(anchor='w')
        self.TLabel3.configure(justify='left')
        self.TLabel3.configure(text='''Path:''')
        self.TLabel3.configure(compound='left')

        self.TFrame1 = ttk.Frame(self.top)
        self.TFrame1.place(relx=0.025, rely=0.359, relheight=0.59, relwidth=0.94)

        self.TFrame1.configure(relief='groove')
        self.TFrame1.configure(borderwidth="2")
        self.TFrame1.configure(relief="groove")

        self.TCombobox4 = ttk.Combobox(self.TFrame1)
        self.TCombobox4.place(relx=0.187, rely=0.174, relheight=0.183
                , relwidth=0.381)
        self.TCombobox4.configure(textvariable=self.cmbClase4)
        self.TCombobox4.configure(takefocus="")
        self.TCombobox4.bind('<<ComboboxSelected>>',lambda e:progRice_support.seleccionaCmb4(e))

        self.TCombobox5 = ttk.Combobox(self.TFrame1)
        self.TCombobox5.place(relx=0.187, rely=0.435, relheight=0.183
                , relwidth=0.381)
        self.TCombobox5.configure(textvariable=self.cmbSubClase5)
        self.TCombobox5.configure(takefocus="")

        self.TLabel4 = ttk.Label(self.TFrame1)
        self.TLabel4.place(relx=0.08, rely=0.174, height=19, width=34)
        self.TLabel4.configure(background="#d9d9d9")
        self.TLabel4.configure(foreground="#000000")
        self.TLabel4.configure(font="TkDefaultFont")
        self.TLabel4.configure(relief="flat")
        self.TLabel4.configure(anchor='w')
        self.TLabel4.configure(justify='left')
        self.TLabel4.configure(text='''Class:''')
        self.TLabel4.configure(compound='left')

        self.TLabel5 = ttk.Label(self.TFrame1)
        self.TLabel5.place(relx=0.027, rely=0.435, height=19, width=52)
        self.TLabel5.configure(background="#d9d9d9")
        self.TLabel5.configure(foreground="#000000")
        self.TLabel5.configure(font="TkDefaultFont")
        self.TLabel5.configure(relief="flat")
        self.TLabel5.configure(anchor='w')
        self.TLabel5.configure(justify='left')
        self.TLabel5.configure(text='''Subclass:''')
        self.TLabel5.configure(compound='left')

        self.TButton5 = ttk.Button(self.TFrame1)
        self.TButton5.place(relx=0.24, rely=0.696, height=25, width=106)
        self.TButton5.configure(command=progRice_support.saveCutSegmentation)
        self.TButton5.configure(takefocus="")
        self.TButton5.configure(text='''Save''')
        self.TButton5.configure(compound='left')

        self.bProgreso2 = ttk.Progressbar(self.TFrame1)
        self.bProgreso2.place(relx=0.693, rely=0.696, relwidth=0.267
                , relheight=0.0, height=22)

        self.TLabel1 = ttk.Label(self.TFrame1)
        self.TLabel1.place(relx=0.693, rely=0.087, height=59, width=95)
        self.TLabel1.configure(background="#d9d9d9")
        self.TLabel1.configure(foreground="#000000")
        self.TLabel1.configure(font="TkDefaultFont")
        self.TLabel1.configure(relief="sunken")
        self.TLabel1.configure(anchor='center')
        self.TLabel1.configure(justify='left')
        self.TLabel1.configure(textvariable=self.estadoCarg2)
        self.estadoCarg2.set('''''')
        self.TLabel1.configure(compound='left')

class Toplevel4:
    def __init__(self, top=None):
        '''This class configures and populates the toplevel window.
           top is the toplevel containing window.'''

        top.geometry("714x372+345+207")
        top.minsize(120, 1)
        top.maxsize(3460, 1061)
        top.resizable(1,  1)
        top.title("Show Spectrum")
        top.configure(background="#d8d8d8")
        top.configure(highlightbackground="#d9d9d9")
        top.configure(highlightcolor="black")

        self.top = top
        self.posx = tk.StringVar()
        self.posy = tk.StringVar()
        self.posxy = tk.StringVar()

        self.Canvas1 = tk.Canvas(self.top)
        self.Canvas1.place(relx=0.042, rely=0.081, relheight=0.806
                , relwidth=0.42)
        self.Canvas1.configure(background="#d9d9d9")
        self.Canvas1.configure(borderwidth="2")
        self.Canvas1.configure(cursor="crosshair")
        self.Canvas1.configure(highlightbackground="#d9d9d9")
        self.Canvas1.configure(highlightcolor="black")
        self.Canvas1.configure(insertbackground="black")
        self.Canvas1.configure(relief="ridge")
        self.Canvas1.configure(selectbackground="#c4c4c4")
        self.Canvas1.configure(selectforeground="black")
        self.Canvas1.bind('<Button-1>',lambda e:progRice_support.clicWidget(e))
        self.Canvas1.bind('<Motion>',lambda e:progRice_support.moverEncimaWidget(e))

        _style_code()
        self.TFrame2 = ttk.Frame(self.top)
        self.TFrame2.place(relx=0.476, rely=0.887, relheight=0.094
                , relwidth=0.497)
        self.TFrame2.configure(relief='groove')
        self.TFrame2.configure(borderwidth="2")
        self.TFrame2.configure(relief="groove")

        self.TLabel2 = ttk.Label(self.TFrame2)
        self.TLabel2.place(relx=0.141, rely=0.286, height=19, width=18)
        self.TLabel2.configure(background="#d9d9d9")
        self.TLabel2.configure(foreground="#000000")
        self.TLabel2.configure(font="TkDefaultFont")
        self.TLabel2.configure(relief="flat")
        self.TLabel2.configure(anchor='w')
        self.TLabel2.configure(justify='left')
        self.TLabel2.configure(text='''x=''')
        self.TLabel2.configure(compound='left')

        self.TEntry1 = ttk.Entry(self.TFrame2)
        self.TEntry1.place(relx=0.197, rely=0.286, relheight=0.6, relwidth=0.101)

        self.TEntry1.configure(textvariable=self.posx)
        self.TEntry1.configure(takefocus="")
        self.TEntry1.configure(cursor="ibeam")

        self.TLabel6 = ttk.Label(self.TFrame2)
        self.TLabel6.place(relx=0.62, rely=0.286, height=19, width=18)
        self.TLabel6.configure(background="#d9d9d9")
        self.TLabel6.configure(foreground="#000000")
        self.TLabel6.configure(font="TkDefaultFont")
        self.TLabel6.configure(relief="flat")
        self.TLabel6.configure(anchor='w')
        self.TLabel6.configure(justify='left')
        self.TLabel6.configure(text='''y=''')
        self.TLabel6.configure(compound='left')

        self.TEntry3 = ttk.Entry(self.TFrame2)
        self.TEntry3.place(relx=0.676, rely=0.286, relheight=0.6, relwidth=0.101)

        self.TEntry3.configure(textvariable=self.posy)
        self.TEntry3.configure(takefocus="")
        self.TEntry3.configure(cursor="ibeam")

        self.TLabel7 = ttk.Label(self.top)
        self.TLabel7.place(relx=0.056, rely=0.887, height=29, width=285)
        self.TLabel7.configure(background="#d8d8d8")
        self.TLabel7.configure(foreground="#000000")
        self.TLabel7.configure(font="TkDefaultFont")
        self.TLabel7.configure(relief="sunken")
        self.TLabel7.configure(anchor='w')
        self.TLabel7.configure(justify='center')
        self.TLabel7.configure(textvariable=self.posxy)
        self.posxy.set(''' ''')
        self.TLabel7.configure(compound='center')

        self.Canvas2 = tk.Canvas(self.top)
        self.Canvas2.place(relx=0.476, rely=0.188, relheight=0.699
                , relwidth=0.504)
        self.Canvas2.configure(background="#d9d9d9")
        self.Canvas2.configure(borderwidth="2")
        self.Canvas2.configure(highlightbackground="#d9d9d9")
        self.Canvas2.configure(highlightcolor="black")
        self.Canvas2.configure(insertbackground="black")
        self.Canvas2.configure(relief="ridge")
        self.Canvas2.configure(selectbackground="#c4c4c4")
        self.Canvas2.configure(selectforeground="black")

class Toplevel5:
    def __init__(self, top=None):
        '''This class configures and populates the toplevel window.
           top is the toplevel containing window.'''

        top.geometry("609x466+432+117")
        top.minsize(120, 1)
        top.maxsize(3844, 1061)
        top.resizable(1,  1)
        top.title("Classification")
        top.configure(background="#d8d8d8")
        top.configure(highlightbackground="#d9d9d9")
        top.configure(highlightcolor="black")

        self.top = top
        self.dirTrain = tk.StringVar()
        self.dirTest = tk.StringVar()
        self.combobox = tk.StringVar()
        self.lblPorTrain = tk.StringVar()
        self.resultsVar = tk.StringVar()
        self.porcentajeTrain = tk.DoubleVar()
        self.claBProgreso = tk.IntVar()

        _style_code()
        self.TFrame3 = ttk.Frame(self.top)
        self.TFrame3.place(relx=0.033, rely=0.043, relheight=0.161
                , relwidth=0.944)
        self.TFrame3.configure(relief='groove')
        self.TFrame3.configure(borderwidth="2")
        self.TFrame3.configure(relief="groove")

        self.TLabel8 = ttk.Label(self.TFrame3)
        self.TLabel8.place(relx=0.017, rely=0.133, height=19, width=33)
        self.TLabel8.configure(background="#d9d9d9")
        self.TLabel8.configure(foreground="#000000")
        self.TLabel8.configure(font="TkDefaultFont")
        self.TLabel8.configure(relief="flat")
        self.TLabel8.configure(anchor='w')
        self.TLabel8.configure(justify='left')
        self.TLabel8.configure(text='''Train:''')
        self.TLabel8.configure(compound='left')

        self.TEntry4 = ttk.Entry(self.TFrame3)
        self.TEntry4.place(relx=0.087, rely=0.133, relheight=0.28
                , relwidth=0.637)
        self.TEntry4.configure(textvariable=self.dirTrain)
        self.TEntry4.configure(takefocus="")
        self.TEntry4.configure(cursor="ibeam")

        self.TLabel9 = ttk.Label(self.TFrame3)
        self.TLabel9.place(relx=0.017, rely=0.533, height=19, width=28)
        self.TLabel9.configure(background="#d9d9d9")
        self.TLabel9.configure(foreground="#000000")
        self.TLabel9.configure(font="TkDefaultFont")
        self.TLabel9.configure(relief="flat")
        self.TLabel9.configure(anchor='w')
        self.TLabel9.configure(justify='left')
        self.TLabel9.configure(text='''Test:''')
        self.TLabel9.configure(compound='left')

        self.TEntry5 = ttk.Entry(self.TFrame3)
        self.TEntry5.place(relx=0.087, rely=0.533, relheight=0.28
                , relwidth=0.637)
        self.TEntry5.configure(textvariable=self.dirTest)
        self.TEntry5.configure(takefocus="")
        self.TEntry5.configure(cursor="ibeam")

        self.TButton8 = ttk.Button(self.TFrame3)
        self.TButton8.place(relx=0.748, rely=0.133, height=25, width=36)
        self.TButton8.configure(command=progRice_support.findTrain)
        self.TButton8.configure(takefocus="")
        self.TButton8.configure(text='''Find''')
        self.TButton8.configure(compound='left')

        self.TButton9 = ttk.Button(self.TFrame3)
        self.TButton9.place(relx=0.748, rely=0.533, height=25, width=36)
        self.TButton9.configure(command=progRice_support.findTest)
        self.TButton9.configure(takefocus="")
        self.TButton9.configure(text='''Find''')
        self.TButton9.configure(compound='left')

        self.TButton10 = ttk.Button(self.TFrame3)
        self.TButton10.place(relx=0.835, rely=0.133, height=55, width=56)
        self.TButton10.configure(takefocus="")
        self.TButton10.configure(text='''Load''')
        self.TButton10.configure(compound='left')

        self.Labelframe9 = tk.LabelFrame(self.top)
        self.Labelframe9.place(relx=0.033, rely=0.215, relheight=0.333
                , relwidth=0.443)
        self.Labelframe9.configure(relief='groove')
        self.Labelframe9.configure(foreground="#000000")
        self.Labelframe9.configure(text='''Select Classifier''')
        self.Labelframe9.configure(background="#d8d8d8")
        self.Labelframe9.configure(highlightbackground="#d9d9d9")
        self.Labelframe9.configure(highlightcolor="black")

        self.TCombobox6 = ttk.Combobox(self.Labelframe9)
        self.TCombobox6.place(relx=0.259, rely=0.129, relheight=0.135
                , relwidth=0.678, bordermode='ignore')
        self.TCombobox6.configure(textvariable=self.combobox)
        self.TCombobox6.configure(takefocus="")

        self.TLabel10 = ttk.Label(self.Labelframe9)
        self.TLabel10.place(relx=0.037, rely=0.129, height=19, width=54
                , bordermode='ignore')
        self.TLabel10.configure(background="#d8d8d8")
        self.TLabel10.configure(foreground="#000000")
        self.TLabel10.configure(font="TkDefaultFont")
        self.TLabel10.configure(relief="flat")
        self.TLabel10.configure(anchor='w')
        self.TLabel10.configure(justify='left')
        self.TLabel10.configure(text='''Classifier:''')
        self.TLabel10.configure(compound='left')

        self.TScale1 = ttk.Scale(self.Labelframe9, from_=0, to=1.0)
        self.TScale1.place(relx=0.074, rely=0.71, relheight=0.168
                , relwidth=0.481)
        self.TScale1.configure(command=progRice_support.modificarLabPorcentaje)
        self.TScale1.configure(variable=self.porcentajeTrain)
        self.porcentajeTrain.set(0.9)
        self.TScale1.configure(length="130")
        self.TScale1.configure(takefocus="")

        self.TLabel11 = ttk.Label(self.Labelframe9)
        self.TLabel11.place(relx=0.111, rely=0.516, height=19, width=33
                , bordermode='ignore')
        self.TLabel11.configure(background="#d8d8d8")
        self.TLabel11.configure(foreground="#000000")
        self.TLabel11.configure(font="TkDefaultFont")
        self.TLabel11.configure(relief="flat")
        self.TLabel11.configure(anchor='w')
        self.TLabel11.configure(justify='left')
        self.TLabel11.configure(text='''Train:''')
        self.TLabel11.configure(compound='left')

        self.TLabel12 = ttk.Label(self.Labelframe9)
        self.TLabel12.place(relx=0.259, rely=0.516, height=19, width=55
                , bordermode='ignore')
        self.TLabel12.configure(background="#d8d8d8")
        self.TLabel12.configure(foreground="#000000")
        self.TLabel12.configure(font="TkDefaultFont")
        self.TLabel12.configure(relief="sunken")
        self.TLabel12.configure(anchor='w')
        self.TLabel12.configure(justify='left')
        self.TLabel12.configure(textvariable=self.lblPorTrain)
        self.lblPorTrain.set('''''')
        self.TLabel12.configure(compound='left')

        self.TLabel13 = ttk.Label(self.Labelframe9)
        self.TLabel13.place(relx=0.519, rely=0.516, height=19, width=14
                , bordermode='ignore')
        self.TLabel13.configure(background="#d8d8d8")
        self.TLabel13.configure(foreground="#000000")
        self.TLabel13.configure(font="TkDefaultFont")
        self.TLabel13.configure(relief="flat")
        self.TLabel13.configure(anchor='w')
        self.TLabel13.configure(justify='left')
        self.TLabel13.configure(text='''%''')
        self.TLabel13.configure(compound='left')

        self.TButton11 = ttk.Button(self.Labelframe9)
        self.TButton11.place(relx=0.667, rely=0.452, height=35, width=66
                , bordermode='ignore')
        self.TButton11.configure(command=progRice_support.empezarClasificar)
        self.TButton11.configure(takefocus="")
        self.TButton11.configure(text='''Classify''')
        self.TButton11.configure(compound='left')

        self.TProgressbar1 = ttk.Progressbar(self.Labelframe9)
        self.TProgressbar1.place(relx=0.63, rely=0.71, relwidth=0.296
                , relheight=0.0, height=22, bordermode='ignore')
        self.TProgressbar1.configure(length="80")
        self.TProgressbar1.configure(variable=self.claBProgreso)

        self.Labelframe10 = tk.LabelFrame(self.top)
        self.Labelframe10.place(relx=0.033, rely=0.558, relheight=0.376
                , relwidth=0.443)
        self.Labelframe10.configure(relief='groove')
        self.Labelframe10.configure(foreground="#000000")
        self.Labelframe10.configure(text='''Results''')
        self.Labelframe10.configure(background="#d8d8d8")
        self.Labelframe10.configure(highlightbackground="#d9d9d9")
        self.Labelframe10.configure(highlightcolor="black")

        self.TLabel14 = ttk.Label(self.Labelframe10)
        self.TLabel14.place(relx=0.037, rely=0.114, height=159, width=245
                , bordermode='ignore')
        self.TLabel14.configure(background="#ffffff")
        self.TLabel14.configure(foreground="#000000")
        self.TLabel14.configure(font="TkDefaultFont")
        self.TLabel14.configure(relief="sunken")
        self.TLabel14.configure(anchor='w')
        self.TLabel14.configure(justify='left')
        self.TLabel14.configure(textvariable=self.resultsVar)
        self.resultsVar.set('''''')
        self.TLabel14.configure(compound='left')

        self.Labelframe11 = tk.LabelFrame(self.top)
        self.Labelframe11.place(relx=0.493, rely=0.215, relheight=0.697
                , relwidth=0.493)
        self.Labelframe11.configure(relief='groove')
        self.Labelframe11.configure(foreground="#000000")
        self.Labelframe11.configure(text='''Information''')
        self.Labelframe11.configure(background="#d8d8d8")
        self.Labelframe11.configure(highlightbackground="#d9d9d9")
        self.Labelframe11.configure(highlightcolor="black")

        self.Scrolledtext1 = ScrolledText(self.Labelframe11)
        self.Scrolledtext1.place(relx=0.033, rely=0.062, relheight=0.908
                , relwidth=0.917, bordermode='ignore')
        self.Scrolledtext1.configure(background="white")
        self.Scrolledtext1.configure(font="TkTextFont")
        self.Scrolledtext1.configure(foreground="black")
        self.Scrolledtext1.configure(highlightbackground="#d9d9d9")
        self.Scrolledtext1.configure(highlightcolor="black")
        self.Scrolledtext1.configure(insertbackground="black")
        self.Scrolledtext1.configure(insertborderwidth="3")
        self.Scrolledtext1.configure(selectbackground="#c4c4c4")
        self.Scrolledtext1.configure(selectforeground="black")
        self.Scrolledtext1.configure(wrap="none")

# The following code is added to facilitate the Scrolled widgets you specified.
class AutoScroll(object):
    '''Configure the scrollbars for a widget.'''
    def __init__(self, master):
        #  Rozen. Added the try-except clauses so that this class
        #  could be used for scrolled entry widget for which vertical
        #  scrolling is not supported. 5/7/14.
        try:
            vsb = ttk.Scrollbar(master, orient='vertical', command=self.yview)
        except:
            pass
        hsb = ttk.Scrollbar(master, orient='horizontal', command=self.xview)
        try:
            self.configure(yscrollcommand=self._autoscroll(vsb))
        except:
            pass
        self.configure(xscrollcommand=self._autoscroll(hsb))
        self.grid(column=0, row=0, sticky='nsew')
        try:
            vsb.grid(column=1, row=0, sticky='ns')
        except:
            pass
        hsb.grid(column=0, row=1, sticky='ew')
        master.grid_columnconfigure(0, weight=1)
        master.grid_rowconfigure(0, weight=1)
        # Copy geometry methods of master  (taken from ScrolledText.py)
        methods = tk.Pack.__dict__.keys() | tk.Grid.__dict__.keys() \
                  | tk.Place.__dict__.keys()
        for meth in methods:
            if meth[0] != '_' and meth not in ('config', 'configure'):
                setattr(self, meth, getattr(master, meth))

    @staticmethod
    def _autoscroll(sbar):
        '''Hide and show scrollbar as needed.'''
        def wrapped(first, last):
            first, last = float(first), float(last)
            if first <= 0 and last >= 1:
                sbar.grid_remove()
            else:
                sbar.grid()
            sbar.set(first, last)
        return wrapped

    def __str__(self):
        return str(self.master)

def _create_container(func):
    '''Creates a ttk Frame with a given master, and use this new frame to
    place the scrollbars and the widget.'''
    def wrapped(cls, master, **kw):
        container = ttk.Frame(master)
        container.bind('<Enter>', lambda e: _bound_to_mousewheel(e, container))
        container.bind('<Leave>', lambda e: _unbound_to_mousewheel(e, container))
        return func(cls, container, **kw)
    return wrapped

class ScrolledText(AutoScroll, tk.Text):
    '''A standard Tkinter Text widget with scrollbars that will
    automatically show/hide as needed.'''
    @_create_container
    def __init__(self, master, **kw):
        tk.Text.__init__(self, master, **kw)
        AutoScroll.__init__(self, master)

import platform
def _bound_to_mousewheel(event, widget):
    child = widget.winfo_children()[0]
    if platform.system() == 'Windows' or platform.system() == 'Darwin':
        child.bind_all('<MouseWheel>', lambda e: _on_mousewheel(e, child))
        child.bind_all('<Shift-MouseWheel>', lambda e: _on_shiftmouse(e, child))
    else:
        child.bind_all('<Button-4>', lambda e: _on_mousewheel(e, child))
        child.bind_all('<Button-5>', lambda e: _on_mousewheel(e, child))
        child.bind_all('<Shift-Button-4>', lambda e: _on_shiftmouse(e, child))
        child.bind_all('<Shift-Button-5>', lambda e: _on_shiftmouse(e, child))

def _unbound_to_mousewheel(event, widget):
    if platform.system() == 'Windows' or platform.system() == 'Darwin':
        widget.unbind_all('<MouseWheel>')
        widget.unbind_all('<Shift-MouseWheel>')
    else:
        widget.unbind_all('<Button-4>')
        widget.unbind_all('<Button-5>')
        widget.unbind_all('<Shift-Button-4>')
        widget.unbind_all('<Shift-Button-5>')

def _on_mousewheel(event, widget):
    if platform.system() == 'Windows':
        widget.yview_scroll(-1*int(event.delta/120),'units')
    elif platform.system() == 'Darwin':
        widget.yview_scroll(-1*int(event.delta),'units')
    else:
        if event.num == 4:
            widget.yview_scroll(-1, 'units')
        elif event.num == 5:
            widget.yview_scroll(1, 'units')

def _on_shiftmouse(event, widget):
    if platform.system() == 'Windows':
        widget.xview_scroll(-1*int(event.delta/120), 'units')
    elif platform.system() == 'Darwin':
        widget.xview_scroll(-1*int(event.delta), 'units')
    else:
        if event.num == 4:
            widget.xview_scroll(-1, 'units')
        elif event.num == 5:
            widget.xview_scroll(1, 'units')
def start_up():
    progRice_support.main()

if __name__ == '__main__':
    progRice_support.main()