Week+of+4-29+to+5-5

I will now spend a while digesting the CMS GUI and picking apart the code to know what each individual function is responsible for. The first little section of code is what happens before everything is visible. The initialization code is a set of variable initializations that comes standard from GUIDE that is not to be messed with because it uses varargin and varargout to set up the GUI state based on a variable number of inputs and outputs. This code is mostly over my head, but that was my brief attempt at summarizing it. The next part of code that happens before everything is visible is the opening function. This is more standard GUIDE stuff, which sets the default output in the command line for the tool and updates the handles structure. Then, the next function is the ‘varargout’ function which outputs something to the command line if it is called. Now I will progress through the callbacks and create functions in the order in which they are presented in the code itself. Dr. L, if you read this and have any thoughts about the organization, I would be happy as part of my project to reorganize the code. Also, another change that you may or may not see fit is to make the names a little more intuitive if you read through these and feel the names are not very helpful to a reader who is not the original programmer himself. I say this because just in looking at the first few, I have to hunt around all the objects in GUIDE to figure out which function goes with which actual object in the GUI. I will also note before I get deep into this that each function in the GUI has a corresponding function script that is called and as far as I can tell the reason for this is to make the GUI comprehensible and to save space and typing. That being said, I am realizing how gigantic and complex this GUI is, and so I warn that what I write about this GUI will be a fairly simplistic overview of what this code actually does, as it is extremely in-depth and interconnected and well-thought-out. The first function is the ‘Sdraw’ callback. This script is for drawing scatter plots based on selected user preferences. It uses the selection by the user from the ‘Spop’ menu, which is a popup menu that asks for which kind of scatterplot the user wants (2D, 3D, Dot, or 2D Histogram) to designate how the data should be plotted. It also draws off the current state of the ‘Sopen’ checkbox, determining whether it should open the plot in a figure or just graph it in the GUI axis. It also checks on the ‘SHbox’ checkbox to determine whether the hold should be turned on in order to be able to add more data to the same graph with the next selection. My final note about this function is that it always assigns the scatterplot graphs to ‘axes2’ because these axes are located on the right side of the GUI under where all the scatterplot options are, thus the scatterplot should obviously show up under them. The next function is the ‘Spop’ callback. This function does two things: it records which item was chosen from the scatterplot type popup menu, and based on that choice it reveals the proper set of menus for the user to choose which data to display on the plot. For example, if “Dot Scatter” is chosen from the menu, the “X” popup menu object, the “Y” popup menu object, and the “Dot” popup menu object will appear in the options, and if the user then changes the selection to “3D Plot”, the “Dot” popup menu object switches to the “Z” popup menu object. Next is the ‘Spop’ creation function. The create functions will usually just be templates formed by GUIDE based on the object created in the designer. This specific create function just sets the background of the popup menu to white. Next is the ‘SXpop’ callback. The ‘SXpop’ object is the popup menu for what variable will be displayed on the x-axis of the scatterplot. This particular callback actually does nothing, because the choice of which data to display on the x-axis does not do anything in particular, the choice just changes the ‘Value’ variable for the menu and that variable is used by other functions. The one interesting thing to note about this function is that, as the comments put it, “cellstr(get(hObject,'String')) returns SXpop contents as cell array contents{get(hObject,'Value')} returns selected item from SXpop.” In other words, the first option returns the actual letters and words of the current selection in cell array form, while the second option returns which number choice from the menu is selected. After the ‘SXpop’ callback is the ‘SXpop’ create function, which is of the same ilk as the ‘Spop’ create function, merely setting the background color to white. Following this are the callbacks and create functions for ‘SYpop’ and ‘SZpop’, which are identical to those of ‘SXpop’.