Initial commit
Added description of the repo
Program optimization

profiled Main.m, biggest hoggers are
BNS_LoadImageFrame
imaqdevice.getsnapshot
FocusEff
sped up BNS_LoadImageFrame
rate-limiting method is handles.slm_lut
When the LUT is linear.LUT, this step does no more than convert the data
type of ImageMatrix from double to uint8.
commented out the above method. and used unit8(ImageMatrix) to force
conversion.
forced ImageMatrix to be uint8 in Mosaic.m to speed up even more
sped up imaqdevice.getsnapshot
This function is slow. See the following post
http://www.mathworks.com/matlabcentral/newsreader/view_thread/129705
changed to

set(vidobj, 'FramesPerTrigger', 1);
set(vidobj, 'TriggerRepeat', Inf);
triggerconfig(vidobj, 'manual');
start(vidobj);
for
trigger(vidobj);
snapshot = getdata(vidobj);
end
sped up FocusEff
Make sure focus efficiency doesn't drop

added if statement at line 84 to make sure focus efficiency is greater
than or equal to the last focus efficiency.
bug fix

added previousEmax and previousImageData initialization.
Added blank control and force working sequence

A picture of a blank control is now taken after each phase mask. CCD now
captures image 0.1s after BNS_SendImageFrameToSLM command to ensure
phase mask is displayed before an image is captured.
Using 2x2 rectangles

Added if statement to write less images to save time
created loadFocusEfficiency.m

changed statusReport.m too.
added sendEmail.m

Sending email after the program finished running
Added iteration ability

The program is now able to iterate many times each time starting with
the optimized phase mask from last iteration.
random half algorithm added