This readme file provides logs of modifications made to different versions of DigitSeis script. For instructions on how to use DigitSeis, please see the Users's Manual. version 1.1: February, March, April 2017 - minor bug fixes and updates - rearranged the icon order in the main window (01/31/2017) - implemented initial question, whether the user wants to load image or an existing analysis. The initial window setup is consequently moved to load_image function. (01/31/2017) - changed Get_DATE_TIME function so that it no longer uses uicalendar function. The function did not work when the code was compiled. (02/01/2017) - changed callback function for edit boxes for time and length measurements at the beginning so that when all four boxes are populated, the Identify Traces pushbutton becomes active. (02/01/2017) - modified the odd/even trace selection as well as the behaviour of All button for adjust_traces function so that odd/even switches between the two (i.e., no separate buttons needed), and All will always choose all or none. Also added another button with ^ string to do batch y-value shifting of the zero-line traces. (02/01/2017) - modified correct_trace function so that objects of non-target trace is masked by default. This implied that ability to change the mask was needed and hence implemented. There is also a new icon in the correct_trace window that allows the user to see the original image. (02/02/2017) - fixed index issue in digitize_traces function (02/02/2017) - implemented an option to trace a line manually through defining points along the trace in correct_trace function and updated the rest of the DigitSeis function accordingly. The objects that were defined by manual tracing now have S.ID value of 2 (trace) or 3 (time mark). (02/04/2017) - changed activation of the time end determination (star/end of traces and 1st/last time marks) to after digitization rather than after classification (02/05/2017) - added a checkbox that allows user to find gaps in digitized traces (becomes active only after digitization has been completed), updates after corrected traces are applied, removes timebounds or removed by timebounds visibility (02/05,06,07/2017) - updated and improved trace selection in digitize_trace to be similar to the trace selection for adjust_trace function, and added an option to reset all trace assignments for digitize_trace function (02/05,06/2017) - added time mark position callback function so that when it is pressed after digitization is done, the trace number assignments of all time marks are reset (02/05/2017) - added a routine to check for consistency in the time information input (check on the duration of each trace and the number of time marks) in Create_Time function (02/05/2017) - modified pixels2time function so that for files that have been created using DigitSeis of at least version 1.0 will rely on trace number assignment of time mark objects rather than the box locations when identifying time marks for a given trace (02/05/2017) - fixed bugs in correct_classification where in some cases, Trace Number is not assigned to the objects (i.e., S(i).TraceNum = []). Also, to make sure this doesn't cause issues when digitizing, some lines of codes have been added so that any empty S.TraceNum will be assigned with the value -1 (02/06/2017) - fixed bug that caused an error and didn't allow data to be saved in Saveresults if the input filename was shorter than 10 characters long (02/06/2017) - added an option to change box and figure sizes associated with correct_trace function (02/07/2017) - added closeDigitSeis function that is called when the DigitSeis window is closed so that any remaining windows that are still open are automatically closed (02/07/2017) - added a scheme to make sure no more than one correct_trace or edit classification window is open at any one time (02/07/2017) - added a function that is called when the correct_trace window is deleted (rather than closed) so that errors associated with tracing points will not be generated (02/07/2017) - modified the objects in the left column of the main DigitSeis window so that objects that are not often used are simplified or hidden (02/08/2017) - fixed a bug that occurs when the length of pt_traces and ptrace are different (can happen when the beginning/ending positions of the traces are defined, i.e., if one tries correct trace after working on timing parts) (02/08/2017) - fixed a bug that didn't allow SAC files to be saved if the digitization was performed with an older version of DigitSeis and the STD traces didn't exist (02/08/2017) - reorganized the left column with options: (02/09/2017) 1. made four boxes for length/time information smaller and put them in a single row 2. aded + button associated with identify traces to allow selection of # of vertical stripes for trend calculation 3. moved luminance threshold edit box left of Edit Classification button (and removed text explaining the edit box) 4. moved digitization range edit box into a + button beside Digitize button (and removed text explaining the edit box) 5. moved Edit pushbuttons associated with Ends of Traces, 1st Mark, and Last Mark pushbuttons to the left of them. 6. removed explanation text for # of traces edit box - modified digitize_trace_and_tickmarks.m so that the range of values to test for merging time marks and main traces takes advantage of the fact that time marks are shifted by similar amount. The digitize_traces function of the DigitSeis function has also been modified to store the time shift information and provide appropriate value for starting shift and range of values for digitize_trace_and_tickmarks function (02/10/2017) - added an option to check for vertical lines (i.e., time mark offset that were improperly classified). This is, by far, not very effective, but it does look for vertical offsets that were about the length of the offset between the main trace and the time mark (02/11/2017) - removed the time panel from the left column of options (02/12/2017) - added options in digitize_options function/window so that individual traces and STD can be visualized (02/12/2017) - added option in digitize_options to recalculate/recover traces using specified x range (02/13/2017) - added background colour to "Correct trace" button to help avoid clicking wrong buttons since it is potentially used often (02/14/2017) - changed the activation timing of the reference time pushbutton, 1st and last time mark positions, and timing position for each time mark (checkbox) to after ends of the traces have been marked (02/14/2017) - added changing default font size for uicontrol objects when the screen is large (02/14/2017) - fixed an issue with find_gaps function when the Ends of Traces have been performed and pt_traces and ptrace have different lengths (02/14/2017) - fixed correct_trace function so that when pt_traces are shorter than new ptrace, the zero-lines will be either extended or put back (this only happens when ends of the traces are determined before going into correct_trace function). Also introduced a new variable pt_tracesY that keeps all values of zero-line Y from when it was initially determined (otherwise, it will be cut and need to be linearly interpolated). The variable pt_tracesY0 is also saved (02/14/2017) - fixed a bug in correct_trace function where noise objects were not removed when objects were updated with new SCLA objects defined through correct_trace activities (02/15/2017) - fixed bugs in find_gaps, correct_traces, and adjust_traces that had to do with pt_tracesY0 not being updated when adjust_traces adds/deletes traces (02/23/2017) - changed order of icons in correct trace window (02/23/2017) - fixed digitize_traces_without_tickmarks.m so that digitize_regionSTD function is also packaged in the same file (02/23/2017) - added "+ Image Modification" pushbutton at the top of the left column and moved polarity, rotation, and large-scale background removal options (used to be on the toolbar of the main DigitSeis window) to the new image modification option window. (02/23/2017) - added resetZoom function to correct_trace function to reset zoom/pan functions and to suppress error messages (02/24/2017) - added an variable Iorig that keeps the original image (after cropping) and an option to recover the original image using an icon on the toolbar of the main window (02/25/2017) - added a popup error message if the user pushes Apply button in the correct trace window when there is no digitized trace (02/25/2017) - added an option to perform piecewise contrast adjustments automatically in "+ Image Modification" window. Divided this function into two - "Piecewise Contrast" pushbutton automatically runs the piecewise contrast update and "+" button allows other options (including number of divisions for piecewise contrast modification) to be accessed (02/25/2017) - added zoom/pan off to toolbar icons (removing region, adding region, image modification) (02/25/2017) - fixed a bug for manual tracing in the correct trace window when there are multiple objects for a given segment identified (this happens when the lines have very high gradient). Also added an option to switch between spline interpolation and linear interpolation using the correct trace option window (02/26/2017) - changed position of the "Close" and "Apply" buttons in the correct trace window and modified the apply algorithm so that it no longer asks the user whether the NaN's should be skipped or not. Instead, there are two "Apply" buttons corresponding to the two options (02/26/2017) - modified the behaviour of correct trace options window so that while it is open, the End of Traces button becomes inactive (to avoid inadvertently pushing it) (02/27/2017) - changed the load_analysis so that when the analysis is loaded, any additional open windows (e.g., classification window, options windows) will be closed automatically (02/27/2017) - fixed bugs for tracing using points, and when trace and STD information is available for the trace, use the difference to determine the width of the line (02/28/2017) - added a function that checks the input value of the luminance threshold (edit box beside "Edit Classification" button), and also algorithm to check for this value in correct_classification and correct_trace functions. Most of the time, the check in the correct_X functions is not necessary except when the user changes the value and immediately clicks on one of these buttons (03/01/2017) - fixed a bug that produced error message when the user clicked region outside of the image axes when selecting classification type (red/white/green) in correct_classification and correct_trace functions (03/01/2017) - disabled trace identification and modification buttons once digitization is complete. Digitization assigns trace number to each object, so changing traces, especially the number of traces or order of traces will cause problems (03/01/2017) - added a new icon to the main Digitization window that allows switching between original and processed images (03/01/2017) - removed confirmation dialogue when the classification is recalculated in the correct trace function (03/05/2017) - modified the icon for time mark position and allowed it to change image when clicked so that it is easier to see if the time mark setting is up or down (03/06/2017) - changed load_image function so that when a new image is loaded, the question about complementing image is asked at the beginning rather than after the image has been read. This will allow the user to input all necessary information and then wait for it to load rather than waiting for a while, choosing an answer, and then waiting for a while (03/06/2017) - added "Recover" pushbutton to the correct trace options window in case there was an error that didn't go through the correct trace function, i.e., the correct trace function button is disabled. The Recover pushbutton is invisible until the correct trace pushbutton becomes disabled, and it allows the user to quit the current correct trace session and recovers the functionality of the correct trace pushbutton (03/07/2017) - updated load_analysis function so that the vertical analysis axes object does not appear even for files created with an older version, and that the other axes objects are in the new position (03/10/2017) - modified imageMod function so that the I0 variable is updated only if all the regions have been successfully updated. Also, added an algorithm that tries to ignore intensities with very small number counts at the bottom and top of the range (i.e., from 0 and from 255) in case the image intensity range is narrow, as well as general improvements (03/10/2017) - modified structure object selection when regions or lines are removed in correct_classification function for better efficiency (03/10/2017) - modified region and line removal functions in correct_classification function so that unnecessary updates are removed. Also, modified the region and line removal codes so that they are more efficient and that there are no warnings when the zoom or pan toggle buttons are on (03/12/2017) - modified correct_classification function so that when image is zoomed in, the image shown is actually the image processed, rather than the entire image, so that the imfreehand function runs much faster. This requires additional functions to be in the same directory, see below for the list of functions needed (03/12,13,15/2017) - added some commands that turn all the icons inactive in correct_trace function when the user is modifying classification of objects (03/15/2017) - modified find_gaps function so that when there are rectangles left over in the main axes object (when the box is unchecked), then whatever remaining rectangles will be deleted (03/28/2017) - modified reclaculate_callback function within the correct_classification function so that whenever the classification is recalculated, the time mark length is read from the main window (otherwise the user must close the Edit Classification window whenever the time mark length is changed) (03/28/2017) - fixed pixels2time function so that when H.version>0, the entries of CALL are not removed as time marks for each trace are identified (03/29/2017) - changed the location of the pushbutton for setting the time for the first time trace so that the work flow is more continuous from top to bottom on the left column (03/30/2017) - removed the option to select region outside of the box/freehand area before modImage function is called (hence the question box no longer appears). The outside region option wasn't working well, and with the piecewise contrast correction, the ability to work on a large region has become less necessary. (04/24/2017) - modified modImage.m and corresponding parts in DigitSeis.m so that there is an option to recover the original image in modImage function. (04/26/2017) % % % current matlab scripts needed for DigitSeis to work % DigitSeis.m % digitize_trace_and_tickmarks.m % digitize_trace_without_tickmarks.m % ginput.m % modImage.m % putdowntextN.m % rgv2hsv_fast.m % updateSmallImage.m % writesac.m % and a directory "icon" where all image files for icons can be found % version 1.0: January 2017 % - minor bugs, spelling errors corrected % - modified the selection of first and last time marks so that the time % mark classification information is taken into account and the initial % suggestions made automatically. The user needs to change colour of the % positions that do not belong in the "first" or the "last" set (which will % turn their values to NaN while preserving their existence), correct any % locations that are misidentified, and double click on the bottommost % point to finish the selection session. Note that the vertices are no % longer deletable, making the process a little more robust (time % calculation requires the same number of vertices as the number of % traces). % - modified the timing calculation component so that the user can now % correct the time mark locations by moving the yellow vertical bars % sideways to where the correct position should be (which gets incorporated % into time calculation). % - added trace-specific trend correction (quadratic polynomial fit) to % data exported as SAC files. Also removed path-dependence on the SAC % filenames. % - removed mouse-tracking function and modified the behaviour of data % cursor tool so that the x and y values are visible with large font. The % top-right text showing the x and y positions (if turned on) also shows % the data cursor position rather than mouse position. % - turned off the top pull down menues in the main work window and % classification editing window so that the users will be forced to % use icons for various commands. % - implmented an algorithm to recover handles needed for digitized traces % and STD in load_analysis function. % - incorporated regional image modification (new viewimage function) % - removed Reload Image icon % - removed Cursor Coordinates % - removed print icon from the main analysis window % - turned off the option to automatically adjust image contrast when image % is loaded in initially % - incorporated trace assignment when the objects are used to digitize % (without assignments) % - turned off the question box that asks user if the trace is curved in % correct_trace function. It now checks whether curvature needs to be % applied by checking the status of the curvature icon. % - updated Edit Classification icons. Icons for data cursor, print, save, % loading different gray-scale image, adding pixels, assigning trace number % to objects, and check box have been removed and the order of icon % appearance has been changed. % - implemented an option to choose the end of the time mark for the % beginning of a minute (left vs. right) % - modified load_analysis function to retrieve some of the settings (e.g., % position of the time mark, number of time marks between 1st and last % selected time marks, etc.) Also the "enable" properties of some of the % pushbuttons are imported from saved version. % - updated mark_start function so that it does both the start of the line % and the end of the line. Also, when objects are available, the start and % end points are automatically selected (the positions can still be % modified) using the trace and time mark positions. Removed end of trace % selection/edit pushbuttons. % - reorganized toolbar for correct_trace function (removed some icons) and % added the ability to zoom out to the entire image used in the correction % after zooming in % - provide an estimated number of time marks in the edit box when % "Identify Trace" routine (find_traces function) is run. % - reorganized left column so that the order reflects more of the work % flow and also the activation of buttons so that they are not active until % they are ready to be used. % - removed option to save as SAC as part of the normal save routine and % added a pushbutton to extract SAC information (becomes only active after % time calculation has been performed). % - modified correct_trace function so that remove region tool can be used % continuously until undo or some of the other tools is clicked. Also, the % binary threshold change can now be made in the correct trace window % itself rather than having have to go back to the main window. % - modified digitize_traces and correct_trace functions so that noise % objects are deleted before digitization. % - removed axes object (H.ax3) that displayed the time mark trend. % - modified Get_DATE_TIME function to allow modification to the date % rather than having have to do the full selection each time. % - modified digitize_traces so that trace assignments are combined with % objects without any trace assignments. Moved functions % digitize_traces_with_assignments and digitize_traces_without_assignments % to DigitSeis_oldFcn.m. % - modified correct_trace function so that objects are properly returned % to the S structure based upon their x position and trace number rather % than window of the correct traces. The former approach caused problems % when objects from the same trace existed outside of the box chosen. % - added version field to H structure to keep track of versions of % DigitSeis used for analysis. If minimum version is >=1, then all objects % have assigned trace number, and this is used in identifying the ends of % the traces and starting/ending time marks. % - modified correct_classification routine so that the binary image % threshold selected in the Edit Classification window is exported back to % the main DigitSeis window. % % current matlab scripts needed for DigitSeis to work % DigitSeis.m % digitize_trace_and_tickmarks.m % digitize_trace_without_tickmarks.m % ginput.m % modImage.m % rgv2hsv_fast.m % writesac.m % and a directory "icon" where all image files for icons can be found % Version 0.80 % - Curverd traces now supported (testing version) % - Classification of seperate trace processing now is reflected to the % global classification structtre (testing version) % - minor fixes/updates/changes here and there % % Version 0.75 % - Added buttons in the "adjust traces" dialog for fast selections. % % Version 0.72 % - Remove region in Correct classification gui (binary image) % - Added contrast interactive tool in correct trace gui % - Added buttons in the "select traces to digitize" dialog for fast % selections. % - changed in digitize_trace_and_tickmarks.m the bounds of minimization to be more robust when objects are % not in the middle % - minor bug fixes and improvements. % % Version 0.692 % - Bug fixes in correct trace gui (zoom out, change classification, others) % - performance improvements % - when applying the corrected trace, there is an option to replace only % the numeric values (skip NaNs). % % Version 0.69 % - Now digitization returns also the std of the digitized column. It is % included in a second block of data i.e., DATA2 at the SAC structure. % > Files digitize_trace_without_tickmarks.m, % digitize_trace_and_tickmarks.m have also changed. % > File digitize_regionSTD.m has been added % - minor improvements - bug fixes when loading previous analyses % % Version 0.68 % - Added the option to correct portion of a trace instead of the whole % trace. % - minor modifications here and there. % % Version 0.67 % - Added an input dialog that allows purging all small objects in binary % image during the identification of traces and time marks procedure. % - Added option to filter the image for get ridding the salt & pepper % noise using either 2-D median or Wiener filter. % - Added a button to reset zoom to the whole image in the "edit % classification" gui % - Added a button to purge red-noise objects at the "edit classification" gui % % Version 0.65 % - Support for seismograms without time marks added. -->set time mark % length < 0 to indicate that there are no time marks. % - Added the option the user to select the traces to be digitized. % - fixed small bugs here and there % % Version 0.6 % - object asignments to traces now allows for multiple assignments per object % - minor bugs fixed % % Version 0.55 % - error handling imrpoved in the case of tight trunccated image % - minor improvements in individual trace correction. % % Version 0.54 % - Bug with additional instances of buttons in single trace tratment corrected % - minor bugs corrected % % Version 0.53 % - Bugs fixed with assignments % - Remove background button-function added % % Version 0.52 % - Corrected bug of previous version that sometimes was giving error % in timing when timarks down % - Assignemnt of objects to traces moved under the classification % proccedure. S structrure now includes the new field TraceNum which stores % the trace that this object is assigned to. It is empty for red objects % You should 1st complete the classification and then start working with % assignments. % - Added the option for the user to correct object assignments. % - other minor bug fixes. % % Version 0.51 % - Corrected function name to DigitSeis from DigitizeSeis % - Bugs corrected, including y' and index-0 error in tightly cropped images. % - Corrected bug with load file % - Corrected timing bug % - Edit classification GUI improved. % - put recalculate classification button and level spinner to the % right in order to avoid accidental engagement % - put confirmation dialog to recalculate classification. % - added option to use a different image just for the classification % purpose (button added, including confirmation dialog). % - added functionality to add true pixels instead of just removing % them. % - added undo option for add & remove pixels along path. % - added button to deal with RGB- colorblindness as an additional % color scheme. %