public void viewImages(Connection conn, Study study, int index, DisplayState.States state, List<Command> commands) {
        this.conn = conn;
        this.study = study;
        
        executedCommands = new LinkedList<Command>();
        redoCommands = new LinkedList<Command>();
        
        ImagePanel p;
        if(state == null || state == DisplayState.States.SINGLE_IMAGE)
            p = new SingleImagePanel();
        else
            p = new QuadImagePanel();
        setImagePanel(p);
        
        this.iterator = imagePanel.createIterator(study.getImages(), index);
        
        if(commands != null)
            for(Command c : commands)
                this.addCommand(c);
        
        this.updateImageUI();
        this.pack();
        this.setVisible(true);
    }