{"text_format":"1","workbook":"xlsx","n_sheets":8,"sheets":["ImageData","FormLabels","TraitValues","ImageAlertMessage","Instructions for Sheet","DataMap","form_snapshot","R-script (copy)"],"not_rendered":{"charts":0,"images":1,"macros":1,"external_links":0,"defined_names":17,"comments":0,"pivot_tables":0},"unopened":[],"bounds":{"document_bytes":16777216,"sheet_cells":100000,"rows_first":2000,"rows_last":500,"rows_between":2000,"halvings":0,"cell_chars":16384,"cell_head_chars":4096},"cells_cut":0,"cells_raw":0,"read":"whole","date_system":"1900"}

{"sheet":"ImageData","index":0,"n_rows":1,"n_cols":165,"rows_kept":1,"cut":false,"hidden":false,"merged":[]}
["RecordNumber","ImageFilename","ImagePath","ImageRelative","ImageSize","ImageTime","ImageDate","ImageAlert","Frame1","chkFrame1Lock","Frame3","chkFrame3Lock","Conditions1","Conditions2","Conditions3","Conditions4","Conditions5","Conditions6","Conditions7","Conditions8","chkConditionsLock","Trait1","Trait2","Trait3","Trait4","chkTraitsLock","TraitB1","TraitB2","TraitB3","TraitB4","chkTraitsBLock","ConditionsB1","ConditionsB2","ConditionsB3","ConditionsB4","ConditionsB5","ConditionsB6","ConditionsB7","ConditionsB8","chkConditionsBLock","Species1","Species2","Species3","Species4","Species5","Species6","Species7","Species8","Species9","Species10","Species11","Species12","Species13","Species14","Species15","Species16","Species17","Species18","Species19","Species20","Species21","Species22","Species23","Species24","Species25","Species26","Species27","Species28","Species29","Species30","Species31","Species32","Species33","Species34","Species35","Species36","Species37","Species38","Species39","Species40","Species41","Species42","Species43","Species44","Species45","Species46","Species47","Species48","Species49","Species50","Species51","Species52","Species53","Species54","Species55","Species56","Species57","Species58","Species59","Species60","Species61","Species62","Species63","Species64","Species65","Species66","Species67","Species68","chkSpeciesLock","Count1Species","Count1Class1","Count1Class2","Count1Class3","Count1Class4","Count1Class5","Count1Class6","Count1Class7","Count1Total","Count2Species","Count2Class1","Count2Class2","Count2Class3","Count2Class4","Count2Class5","Count2Class6","Count2Class7","Count2Total","Count3Species","Count3Class1","Count3Class2","Count3Class3","Count3Class4","Count3Class5","Count3Class6","Count3Class7","Count3Total","Count4Species","Count4Class1","Count4Class2","Count4Class3","Count4Class4","Count4Class5","Count4Class6","Count4Class7","Count4Total","Count5Species","Count5Class1","Count5Class2","Count5Class3","Count5Class4","Count5Class5","Count5Class6","Count5Class7","Count5Total","chkCountsLock","Comments","chkCommentsLock","Flag1","Flag2","Flag3","Flag4","chkFlagsLock","chkAllLock","LastSavedOn","chkRelative"]

{"sheet":"FormLabels","index":1,"n_rows":69,"n_cols":11,"rows_kept":69,"cut":false,"hidden":false,"merged":[]}
["Index","Traits","TraitsB","Conditions","ConditionsB","Frame1","Frame3","Flags","Species","Class"]
["01","MaintDate(M/D/YY)","Temperature","degrees F","2nd opin",null,null,"maintenance visit","pronghorn","unk","1. Colored range for each Data Type indicates the current number of labels used in each frame"]
["02","MaintTime(24hr)","Classifier","rain ","Wow!",null,null,"image failure","markedph","juv/CBP","2. Additional labels can be added beyond colored range if additional optionbuttons, checkboxes or other controls are added to a frame"]
["03","Maint UTM E",null,"pooled water",null,null,null,null,"muledeer","uA/OAgy","3. Labels are assigned in order of TabIndex for each conrol"]
["04","Maint UTM N",null,null,null,null,null,null,"bighorn","adF/Civ","4. At least one Class must be specified otherwise and error will occur on startup"]
["05",null,null,null,null,null,null,null,"javelina","adM","5. At lease one class for counts must be included, even if counts will not be tallied. An \"unspecified\" class is a good option even if other classes will be specified."]
["06",null,null,null,null,null,null,null,"mountainlion",null,"6. each specified trait will create a dropdown menu (list box) each with multiple potential options (specifed on the TraitValues tab)"]
["07",null,null,null,null,null,null,null,"coyote",null,"7. each specified  condition  creats a checkbox that is not mutually exclusive of other conditions (more than one condition can apply)"]
["08",null,null,null,null,null,null,null,"bobcat",null,"8. Each frame specified frame value specifies an checkbox that is mutually exlusive of all other values in the same frame (only one option can be checked)."]
["09",null,null,null,null,null,null,null,"kitfox",null,"9. each flag specified creates a checkbox that is not mutually exclusive"]
["10",null,null,null,null,null,null,null,"greyfox",null,"10. Each species specified will create a check box in the species window, these are not mutually exlusive and more than one species can be in an image"]
["11",null,null,null,null,null,null,null,"badger",null,"11. each species checked as present will open up a count box in the counts field and each species detected can be counted according the classes specified"]
["12",null,null,null,null,null,null,null,"spottedskunk",null,"12.  If absolute counts for a particular species (or all species) are not desired, and only detection data is necessary, add a 0 to the end of the species name (e.g. \"birds0\"). The form will not enforce a \"counts must be >0\" error for detections of these species.  The data will show that the species was detected but not counted.  This can greatly speed-up data entry if only species detections are desired and total counts of each species in each image are not needed."]
["13",null,null,null,null,null,null,null,"ringtail"]
["14",null,null,null,null,null,null,null,"jackrabbit"]
["15",null,null,null,null,null,null,null,"cottontail"]
["16",null,null,null,null,null,null,null,"rodent0"]
["17",null,null,null,null,null,null,null,"raptor"]
["18",null,null,null,null,null,null,null,"birds0"]
["19",null,null,null,null,null,null,null,"herp0"]
["20",null,null,null,null,null,null,null,"goats"]
["21",null,null,null,null,null,null,null,"cattle"]
["22",null,null,null,null,null,null,null,"dogs"]
["23",null,null,null,null,null,null,null,"horseburro"]
["24",null,null,null,null,null,null,null,"otheranimal"]
["25"]
["26",null,null,null,null,null,null,null,"onfoot"]
["27",null,null,null,null,null,null,null,"bicycle"]
["28",null,null,null,null,null,null,null,"horseback"]
["29",null,null,null,null,null,null,null,"motorbike"]
["30",null,null,null,null,null,null,null,"atv"]
["31",null,null,null,null,null,null,null,"car/suv"]
["32",null,null,null,null,null,null,null,"pickup/truck"]
["33",null,null,null,null,null,null,null,"rv"]
["34",null,null,null,null,null,null,null,"hvyequip"]
["35",null,null,null,null,null,null,null,"lightsets"]
["36",null,null,null,null,null,null,null,"otherhuman"]
["37"]
["38"]
["39"]
["40"]
["41"]
["42"]
["43"]
["44"]
["45"]
["46"]
["47"]
["48"]
["49"]
["50"]
["51"]
["52"]
["53"]
["54"]
["55"]
["56"]
["57"]
["58"]
["59"]
["60"]
["61"]
["62"]
["63"]
["64"]
["65"]
["66"]
["67"]
["68"]

{"sheet":"TraitValues","index":2,"n_rows":9,"n_cols":9,"rows_kept":9,"cut":false,"hidden":false,"merged":[]}
["Trait1","Trait2","Trait3","Trait4","TraitB1","TraitB2","TraitB3","TraitB4"]
["NA","NA","NA","NA","NA","NA","NA","NA","keep this row NA if options are not used"]
["NA","NA","NA","NA","NA","NA","NA","NA","keep this row NA if options are not used"]
[]
[]
[null,null,null,null,null,null,null,null,"1. List possible values in the cells below each trait used in the form.  The values in each column will show up in the list box created for each trait.  Traits not used can be ignored"]
[null,null,null,null,null,null,null,null,"2. Good practice to keep this first row of NA's as an option for all Traits but this can be changed to something else,  as it allows for no option to be quickly selected if desired.  NA's are stored if the Trait choice is available but no choice is made."]
[null,null,null,null,null,null,null,null,"3. Keep this second row of NA's if the Trait is not used to avoid an error, This second row can also be overwritten with preferred options for traits."]
[null,null,null,null,null,null,null,null,"4. Trait headings are renamed on the 'FormLabels\" but will retain their original name (e.g. Trait1, Trait2,…) here. Traits are listed in original order"]

{"sheet":"ImageAlertMessage","index":3,"n_rows":2,"n_cols":1,"rows_kept":2,"cut":false,"hidden":false,"merged":[]}
["Enter the message in cell A2 that you would like to appear when the ImageAlert is True"]
["Enter Temperature Data"]

{"sheet":"Instructions for Sheet","index":4,"n_rows":54,"n_cols":1,"rows_kept":54,"cut":false,"hidden":false,"merged":[]}
["Overview"]
["The goal here is to produce a spreadsheet (ImageData) that contains species image detection data in its rawest formto facilitate mutiple types of analysis in secondary, external processes (e.g. occupancy modelling).  This Excel workbook containes a customizable form and accompanies an R script for digitizing information in photos collected at camera traps.   Briefly, the user identifies data fields to be added to the form to facilitate fast and consistent data entry specific to their project (listbox and checkbox data entry options are provided).   Copies of the R script and the modified Excel workbook are then pasted into any folder containing images or subfolders with images to be processed.  The R script is run, creating a .csv file within in the same folder listing all the images (and their date and time) in the folder and subfolders.  This .csv data is then copied and pasted into the first 8 columns of the first worksheet ('ImageData') of the modified Excel workbook.  The form is the opened allowing structured data entry for every image listed in a rapid and consistent process.  The final datasheet can be merged with datasheets from other root folders, even if those folders contain images processed with a different form.   Most projects should find the available data fields more than enough to fit their needs and smart tricks with the data fields present an near infinite number of options for recording whats observed. "]
[]
["Order of operations"]
["1. You may want to save the original R script and Excel workbook in a safe location where they won't be altered so a functional version is always available."]
["2.  Once you have modified the Excel workbook to meet your needs, save a copy (with no data) in a safe location where it can be readily copied into any folder containing images or subfolders of images to process.  "]
["3.  If you modify the R script (e.g. to specify a subset of images for processing), save that modifed script in  a safe place as well."]
["4.  The Excel form stored in this workbook contains 9 customizable data fields (plus an additional  'comments' field)  to help organize data, although only in Frame1 and Frame3 (legacy names) are data options completely mutually exclusive (only one option can be selected).   Traits and TraitsB data fields can contain up to  4 named listboxs each and each named listbox can contain hundreds of options and these data fields are meant to hold nominal, text, or numeric data.  Conditions and ConditionsB data fields can contain up to 8 named checkboxes, each, and more than one checkbox can be selected at atime and these data fields are meant to organize binomial data (the Flags data fieild is similar but holds only 4 checkboxes).  Frame1 and Frame3 can contain up to 8 named  checkboxes, but only one box can be checked within each frame and these fields are meant to hold data options that are mutually exclusive.  The Species data field  allows up to 68 named checkboxes to be listed and more than one species can be checked (indicating 'detected') in any single photo.  If more than one individual (per species) is detected in a single image, individuals can be parsed into 1 - 7 different classes (e.g., age/sex) and tallied.     If a species name ends in 0 (e.g., \"birds0\", then counts will not be required to be entered before saving the data for an image.  This is useful when only species detections are desired, not counts and greatly speeds up data entry for detections of those species for which counts are not of interest.    "]
["5.  Customize the Excel form labels on the 'FormLabels' sheet for those data types you want to use.  Once you add a label, the from control (checkbox or list box) with your label will appear on the form the next time you open it.  If you do not list a label, it will not appear on the form.  You can edit or delete any example values listed on this form (Note: Delete all the text in the cell not the cell itself)."]
["6.  If you specify any traits (list boxes) on the 'FormLabels' worksheet, you must specify the values that will populate each list box on the \"TraitValues\" worksheet (otherwise only NA values will be listed as options)."]
["7.  You may whish to update the cell descriptions on the 'DataMap' Sheet so that the ImageData can be interpretted for your situation."]
["8.  If you specified images that should show your pop-up alter message.  Insert your alert message on the 'ImageAlertMessage' sheet if desired."]
["9.  Copy the R script and modified Excel form into folder that contains the images or subfolders of images you wish to classify.  It is good practice to have images organized into folders by trapsite and name the folders using the trapsite name.  This way the spatial structure of the image collection is retained and attached to the image data (because the folder name is stored within the ImagePath column of the 'ImageData' worksheet). In the R script you have the option to specify the years, months, days of the month, hours of the day of the images you want to inlcude in the output file on lines defing 'useyears', 'usemonths', 'usedays', 'usehours'.   In the R script  you also have the option to specify whether or not Alert should 'FALSE' or 'TRUE'. If set to 'TRUE', then enter the years, months, days of the month, hours of the day, and minutes of the hour of the images you want an special alert message to pop up on the screen when those images are encountered.  Define the 'alertyears', 'alertmonths', 'alertdays', 'alerthours', and 'alertminutes' in the R script.  This might be useful and save time if a certain data type does not need to be recorded for every image (like snow-cover) but should be recoreded at least once a day.  "]
["10. Open the R script and run the R script making sure the working directory is set to the folder storing the R script and the images you want to process  (when running Rstudio, the working directory is set properly when opening the Rscript within the folder).  A new .csv file will be written to the same directory."]
["11.  Open the .csv file (in Excel) just created by the R script and then open the modified Excel workbook that you have copied into the same folder.  Copy the first  8 columns from the .csv file into the 'ImageData' sheet inn the Excel workbook.  You may find Excel goes very slow on your maching if you have hundreds of thousands of rows.  The option is to break this up into smaller steps using a subset of images by subsetting dats in the R script or by processing only a few subfolders at a time."]
["12.  Hit the 'Open Form' button in cell A1 on the 'ImageData' worksheet.  You may need to place the cursor in the first column of the second row (to make that the 'active' row) if you have a problem."]
["13.  There may be an initial error messag relating to image size or image paths.  Typically these can be ignored but usually using relative image paths is more robust (be sure to check the 'Relative Image Paths' checkbox on the form to make this work')"]
["14.   If batches of images were processed using subsettig or multiple copies of workbook and R script in sets of subfolders.  You can merge all spreadsheets together when finished. Columns and data types will line up exactly, even if some versions of your form included data types not found in other versions.  "]
[]
["More details on functionality"]
["This workbook is meant to be edited by the user to conform to their specific needs, and not used in its default form."]
["This workbook produces a bloated 'ImageData' spreadsheet but that was necessary to ensure the data structure would not be altered even by adding new datat types or options midway through  a study.  When you are ready for anlaysis, delete unused columns."]
["This workbook does not store images but reads links to image files on the local computer.   Nor does this workbook alter image metadata.  It simply shows you the image associated with the file path provided in a particular celll.  It then allows you to store additional data associated with that image path."]
["Any method can be used to past these links into the second and third columns of the ImageData spreadsheet but an associated R script that will do this is provided."]
["All data entered are stored in just the  'ImageData' worksheet.  The other worksheets in this form are meant to faciliate the design and execution of the form used to enter the data. "]
["The worksheet stores the text captions (labels) of data controls rather than 1's and 0's.  This allows for easier interpretion of the final data and greater consistentcy should the data types be changed midway thorugh a study."]
["Each row of ImageData corresponds to one photo, each column can be thought of as a single data type."]
["The ImageData Spreadsheet contains 164 columns.  The original column names are in the first row of the 'DataMap' sheet and these correspond to the oringal names used to layout the controls on the form."]
["It is likely you will not need all 164 columns of data. However, setting up the datatable this way ensures greater consistency and compatibility should you make changes to the form in the middle of your data entry."]
["Each control on the form will store its data in a particular cell.  For round option and square checkboxes, the caption is always stored in the cell."]
["It is useful to become familiar with how data entry is translated into tags stored in cells before analysis.  This may help in designing the most efficient form to compile the data needed in the current study ."]
["Data can be overwritten manually in the 'ImageData' worksheet or by revisting the images using the form and inputting new data."]
["Because Frame1 and Frame3 allow only one checked response each from up to 8 checkboxes,  each of these frames stores data only one  column in the 'ImageData' worksheet"]
["The data column names for the 'ImageData' spreadsheet are fixed and show the full possibility if every option for data entry were utilized.  If options for data entry are unused, these option will simply not appear on the form, but columns corresponding to these options will not disappear from the 'ImageData' spreadsheet.  The unused option columns will be scored blank for each image process.  However, once an data type optin is utilized, the default is to beging storing NA, FALSE or 0 once an option is implemented."]
["The Traits allow as many options as needed but only one option will be stored as a tag for each trait."]
["Maintenance of the column layout in ImageData allows for the user to make changes mid-process (e.g. adding a new species) without creating data compatibility problems."]
["Frames 1, and 3 require a choice if the frame is activated. Should it be the case that no choice is sometimes preferred, make 'NA' or something comparable, a labelled option.  The lock feature on these frames is useful."]
["Greyed out text boxes cannot be editted their values are found internally and then displayed"]
["Checking 'Lock' for any frame will copy the displayed entries forward to the next record after saving the current record but will occur ONLY IF NO DATA IS SAVED IN THE NEXT RECORD.  This is for data integrity to prevent overwriting of existing data."]
["The form uses directory paths to find images and display.  The R script stores the original absolute path as well as a relative path to each image.  This is why it is important to execute the R script from within the same folder as the form"]
[]
["Good Protocol and practice"]
["1. Use plot or schedule features on  cameras to take regular pictures to confirm the trap is operating as expected and unobscured.  The duraction over which a camera is active can be extracted from the dates of pictures collected and used in analysis to define the active sampling period.  "]
["2. Folder names should be meaningful corresponding to a trapsite and trapsession to retain the spatial struuutre of sampling."]
["3. Images should not be renamed or resorted within folders after processing."]
["6.  For processing 100,000's of photos it is best to use multiple copies of this form to keep the number of rows down to a manageable size based on the limits of your system. Once photos have been processed they can be deleted.  "]
[" 8.  add an' NA' option to frames or data regions if no option will apply.  Images that have not been classified will have all blank entries and no 'LastSavedOn' Date.  "]
["9. subfolders of images are allowed and chould be used to organize photos from multiple trapsites into root folders."]
[]
["Pro Tips"]
[" If more than seven classes for distinguishing between individuals of a species are desired, add the species to the FormNames sheet, Species column twice but use a class qualifier bighorn-male, bighorn-female)"]
[" At least one Class must be specified otherwise and error will occur on startup.  If no classes are desired, name one class 'unspecified' or 'total' or 'unknown'"]
["If there is more than one family of class types (but not more than two or three), the name for each class type can be complex, e.g., \"juv/small\" for example if Class 1 sometimes applies to age and sometimes to sizes, depending on the species option selected"]
["Use short names for data options so they will display correctly."]

{"sheet":"DataMap","index":5,"n_rows":7,"n_cols":165,"rows_kept":7,"cut":false,"hidden":false,"merged":[]}
["RecordNumber","ImageFilename","ImagePath","ImageRelative","ImageSize","ImageTime","ImageDate","ImageAlert","Frame1","chkFrame1Lock","Frame3","chkFrame3Lock","Conditions1","Conditions2","Conditions3","Conditions4","Conditions5","Conditions6","Conditions7","Conditions8","chkConditionsLock","Trait1","Trait2","Trait3","Trait4","chkTraitsLock","TraitB1","TraitB2","TraitB3","TraitB4","chkTraitsBLock","ConditionsB1","ConditionsB2","ConditionsB3","ConditionsB4","ConditionsB5","ConditionsB6","ConditionsB7","ConditionsB8","chkConditionsBLock","Species1","Species2","Species3","Species4","Species5","Species6","Species7","Species8","Species9","Species10","Species11","Species12","Species13","Species14","Species15","Species16","Species17","Species18","Species19","Species20","Species21","Species22","Species23","Species24","Species25","Species26","Species27","Species28","Species29","Species30","Species31","Species32","Species33","Species34","Species35","Species36","Species37","Species38","Species39","Species40","Species41","Species42","Species43","Species44","Species45","Species46","Species47","Species48","Species49","Species50","Species51","Species52","Species53","Species54","Species55","Species56","Species57","Species58","Species59","Species60","Species61","Species62","Species63","Species64","Species65","Species66","Species67","Species68","chkSpeciesLock","Count1Species","Count1Class1","Count1Class2","Count1Class3","Count1Class4","Count1Class5","Count1Class6","Count1Class7","Count1Total","Count2Species","Count2Class1","Count2Class2","Count2Class3","Count2Class4","Count2Class5","Count2Class6","Count2Class7","Count2Total","Count3Species","Count3Class1","Count3Class2","Count3Class3","Count3Class4","Count3Class5","Count3Class6","Count3Class7","Count3Total","Count4Species","Count4Class1","Count4Class2","Count4Class3","Count4Class4","Count4Class5","Count4Class6","Count4Class7","Count4Total","Count5Species","Count5Class1","Count5Class2","Count5Class3","Count5Class4","Count5Class5","Count5Class6","Count5Class7","Count5Total","chkCountsLock","Comments","chkCommentsLock","Flag1","Flag2","Flag3","Flag4","chkFlagsLock","chkAllLock","LastSavedOn","chkRelative"]
[]
["created by R. sequential from 1 to number of images in folder","created by R. used as a relative path to image from form","created by R. used as an absolute path to image. Folder directory should provide info on location of images","created by R. the relative path to image from the current Excelworkbook","created by R. size of image in bytes.","Created by R, 24 hour clock \"HH:MM:SS\"","created by R. stored as \"YYYY-MM-DD\"","Create by R according to conditions set by user.  T or F. If T, than the message stored in cell A2 on ImageAlertMessage sheet will show.","caption of selection in Frame 1. only one allowed","T or F, if lock for Frame 1 is checked","caption of selection in Frame 3. only one allowed","T or F, if lock for Frame 3 is checked","caption of Condition 1 if selected","caption of Condition 2 if selected","caption of Condition 3 if selected","caption of Condition 4 if selected","caption of Condition 5 if selected","caption of Condition 6if selected","caption of Condition 7 if selected","caption of Condition 8if selected","T or F if lock selected","Trait 1 selection from combobox, if made","Trait 2 selection from combobox, if made","Trait 3 selection from combobox, if made","Trait 4 selection from combobox, if made","T or F if lock selected","TraitB 1 selection from combobox, if made","TraitB 2 selection from combobox, if made","TraitB 3 selection from combobox, if made","TraitB 4 selection from combobox, if made","T or F if lock selected","caption of ConditionB 1 if selected","caption of ConditionB 2 if selected","caption of ConditionB 3 if selected","caption of ConditionB 4 if selected","caption of ConditionB 5 if selected","caption of ConditionB 6if selected","caption of ConditionB 7 if selected","caption of ConditionB 8if selected","T or F if lock selected","if selected, caption of Species1","if selected, caption of Species2","if selected, caption of Species3","if selected, caption of Species4","if selected, caption of Species5","if selected, caption of Species6","if selected, caption of Species7","if selected, caption of Species8","if selected, caption of Species9","if selected, caption of Species10","if selected, caption of Species11","if selected, caption of Species12","if selected, caption of Species13","if selected, caption of Species14","if selected, caption of Species15","if selected, caption of Species16","if selected, caption of Species17","if selected, caption of Species18","if selected, caption of Species19","if selected, caption of Species20","if selected, caption of Species21","if selected, caption of Species22","if selected, caption of Species23","if selected, caption of Species24","if selected, caption of Species25","if selected, caption of Species26","if selected, caption of Species27","if selected, caption of Species28","if selected, caption of Species29","if selected, caption of Species30","if selected, caption of Species31","if selected, caption of Species32","if selected, caption of Species33","if selected, caption of Species34","if selected, caption of Species35","if selected, caption of Species36","if selected, caption of Species37","if selected, caption of Species38","if selected, caption of Species39","if selected, caption of Species40","if selected, caption of Species41","if selected, caption of Species42","if selected, caption of Species43","if selected, caption of Species44","if selected, caption of Species45","if selected, caption of Species46","if selected, caption of Species47","if selected, caption of Species48","if selected, caption of Species49","if selected, caption of Species50","if selected, caption of Species51","if selected, caption of Species52","if selected, caption of Species53","if selected, caption of Species54","if selected, caption of Species55","if selected, caption of Species56","if selected, caption of Species57","if selected, caption of Species58","if selected, caption of Species59","if selected, caption of Species60","if selected, caption of Species61","if selected, caption of Species62","if selected, caption of Species63","if selected, caption of Species64","if selected, caption of Species65","if selected, caption of Species66","if selected, caption of Species67","if selected, caption of Species68","T or F if lock selected","the first species selected for counting, if any","count of class 1 for 1st species detected","count of class 2 for 1st species detected","count of class 3 for 1st species detected","count of class 4 for 1st species detected","count of class 5 for 1st species detected","count of class 6 for 1st species detected","count of class 7 for 1st species detected","Total count of 1st species detected","2nd species detected","count of class 1 for 2nd species detected","count of class 2 for 2nd species detected","count of class 3 for 2nd species detected","count of class 4 for 2nd species detected","count of class 5 for 2nd species detected","count of class 6 for 2nd species detected","count of class 7 for 2nd species detected","Total count of 2nd species detected","3rd species detected","count of class 1 for 3rd species detected","count of class 2 for 3rd species detected","count of class 3 for 3rd species detected","count of class 4 for 3rd species detected","count of class 5 for 3rd species detected","count of class 6 for 3rd species detected","count of class 7 for 3rd species detected","Total count of 3rd species detected","4th species detected","count of class 1 for 4th species detected","count of class 2 for 4th species detected","count of class 3 for 4th species detected","count of class 4 for 4th species detected","count of class 5 for 4th species detected","count of class 6 for 4th species detected","count of class 7 for 4th species detected","Total count of 4th species detected","5th species detected","count of class 1 for 5th species detected","count of class 2 for 5th species detected","count of class 3 for 5th species detected","count of class 4 for 5th species detected","count of class 5 for 5th species detected","count of class 6 for 5th species detected","count of class 7 for 5th species detected","Total count of 5th species detected","T or F if lock selected","comments text box","T or F if lock selected","caption of flag 1 if selected","caption of flag 2 if selected","caption of flag 3 if selected","caption of flag 4 if selected","T or F if selected","T or F if selected. Sets all locks to locked or unlocked if selected","data and time of last save for current roq","T or F for if Relative paths for images is selected"]
[]
["The cell values in the first row of this sheet are fixed and show the original colum names that identifies the source of the data from the form"]
["The second row can be used to create an alternative header row with specialized labels AFTER images have been processed"]
["The third row is a description of the source of the data stored in that column"]

{"sheet":"form_snapshot","index":6,"n_rows":0,"n_cols":0,"rows_kept":0,"cut":false,"hidden":false,"merged":[]}

{"sheet":"R-script (copy)","index":7,"n_rows":101,"n_cols":9,"rows_kept":101,"cut":false,"hidden":false,"merged":[]}
["This page contains a duplicate copy of the R script."]
[]
["## 23Jan2017"]
["## D. Christianson"]
["##"]
["## This R Script when executed in R will create a .csv file (Comma seperated values) that stores the"]
["## name, date and time of every photo in a folder.  All the data from this .csv file can then be copied into the "]
["## Excel form for photo classification."]
["## "]
["## This script should be stored in a directory with the photos to be classified. The photos can be in the same "]
["##","directory as this script and in subfolders within this directory."]
["## "]
["## If images are organized by trap-site, then naming image storage folders after each trap-site is good practice as "]
["## the impage path (with the trapsite folder names) will be included in the data produced by this script."]
["## the name of the folder can be extracted from the image path using simple R commands (e.g., \"substr()\" or \"rep()\")"]
["## or Excel functions (e.g. \"=MID()\") and trapsite names can be linked to trapsite covariates stored in anotther"]
["## spreadsheet or file (using \"match\" in R or \"vLOOKUP\" in Excel)"]
["##"]
["## There are two sets of optional settings."]
["##",null,"1. define a subset of the available images to include based on time (rather than all images)"]
["##",null,"2. define a schedule when an custome pop-up alter message will appear on the excel form."]
["##"]
["## If these options are not desired, the entire script can be run in R without alteration. the code is annoated to proved "]
["## an explanation of the process, should this need to be update"]
[" "]
["## R SCRIPT"]
[]
["## get the current directory, if this script was copied into the image storage folder, then"]
["## the working directory is that folder."]
[null,"currentfolder<-getwd()"]
[]
["## make a list of all the JPEGs in the file, if images are stored in some other format, update the code below"]
[null,"imagefiles<-list.files(path=getwd(),full.names=T,pattern=c(\".JPG|.jpg\"),include.dirs = T,recursive=T)"]
[]
["## create a data.frame from the list of all image files and extract metadata associated with each image"]
[null,"imagefilesinfo<-as.data.frame(do.call(\"rbind\",lapply(imagefiles,file.info)))"]
[null,"imagefilesinfo<-imagefilesinfo[,c(\"size\",\"mtime\")]"]
[null,"imagefilesinfo$ImagePath<-imagefiles"]
[null,"imagefilesinfo$ImageRelative<-do.call(\"rbind\",lapply(strsplit(imagefiles,split=paste(currentfolder,\"/\",sep=\"\")),rev))[,1]"]
[null,"imagefilesinfo$ImageFilename<-do.call(\"rbind\",lapply(strsplit(imagefiles,split=\"/\"),rev))[,1]"]
[null,"imagefilesinfo$ImageTime<-gsub(\"[[:space:]]\", \"\",substr(as.character(imagefilesinfo$mtime),regexpr(\":\",imagefilesinfo$mtime)-2,regexpr(\":\",imagefilesinfo$mtime)+5))"]
[null,"imagefilesinfo$ImageDate<-gsub(\"[[:space:]]\", \"\",substr(as.character(imagefilesinfo$mtime),1,10))"]
[null,"imagefilesinfo$RecordNumber<-seq(1:length(imagefilesinfo$ImagePath))"]
[null,"imagefilesinfo$ImageSize<-as.numeric(imagefilesinfo$size)"]
[null,"imagefilesinfo<-imagefilesinfo[,c(8,5,3,4,9,6,7)]"]
[]
["#remove images of size 0 - some cameras have image write-errors that cannot be processed"]
[null,"imagefilesinfo<-imagefilesinfo[imagefilesinfo$ImageSize!=0,]"]
[]
["## OPTIONAL - DEFINE A SUBSET OF IMAGES TO PROCESS BASED ON A REGULAR TIME SCHEDULE"]
[null,"#Make list of images to include by listing all years wanted (must be four-digit years: 2015,2016,...)"]
[null,null,"useyears = c(\"2012\",\"2013\",\"2014\",\"2015\",\"2016\")"]
[null,"#Make list of images to include by listing all months wanted (quotes are necessary as it must be two-digit months: c(\"01\",\"02\",...))"]
[null,null,"usemonths = c(\"01\",\"02\",\"03\",\"04\",\"05\",\"06\",\"07\",\"08\",\"09\",\"10\",\"11\",\"12\")"]
[null,"#Make list of images to include by listing all days of the month wanted (must be two-digit days: 01,02,...)"]
[null,null,"usedays = c(\"01\",\"02\",\"03\",\"04\",\"05\",\"06\",\"07\",\"08\",\"09\",\"10\",\"11\",\"12\",\"13\",\"14\",\"15\",\"16\",\"17\",\"18\",\"19\",\"20\",\"21\",\"22\",\"23\",\"24\",\"25\",\"26\",\"27\",\"28\",\"29\",\"30\",\"31\")"]
[null,"#Make list of images to include by listing all hous of the day wanted (must be two-digit hours: 01,02,...)"]
[null,null,"usehours = c(\"00\",\"01\",\"02\",\"03\",\"04\",\"05\",\"06\",\"07\",\"08\",\"09\",\"10\",\"11\",\"12\",\"13\",\"14\",\"15\",\"16\",\"17\",\"18\",\"19\",\"20\",\"21\",\"22\",\"23\")"]
[null,"#Now subset the list of all images to just those matching the time criteria above"]
[null,null,"imagefilesinfo<-imagefilesinfo[which(substr(imagefilesinfo$ImageDate,1,4) %in% useyears &"]
[null,null,null,null,null,null,null," ","substr(imagefilesinfo$ImageDate,6,7) %in% usemonths &"]
[null,null,null,null,null,null,null," ","substr(imagefilesinfo$ImageDate,9,10) %in% usedays &"]
[null,null,"                        substr(imagefilesinfo$ImageTime,1,2) %in% usehours),]"]
[]
["## OPTIONAL - SET A TIME FOR A CUSTOM ALERT MESSAGE TO DISPLAY ON THE EXCEL FORM"]
[null,"# set an alert based on time or date, These images will all be included but the 'ImageAlert' will be set to True. If no Alert is Desired, set Alert=F."]
[null,"# when an alert is set, a custom message can be defined to 'pop-up' on the excel form for every image with Altert set to TRUE."]
[null,"# this feature is nice for reminding the user to record certain data types that are not necessarily recorded for every image (e.g. temperature)"]
[null,"# by default all years, months, days of the month, hours of the day, and minutes of the hour are listed for alerts which would slow down data entry"]
[null,"# as it would post the alert message on every image"]
[null,"Alert=F"]
[]
[null,"# If an alert is desired:"]
[null,null,"#Make list of images to alert by listing all years when alerts are wanted (must be four-digit years: 2015,2016,...)"]
[null,null,"alertyears = as.character(c(2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020))"]
[null,null,"#Make list of images to alert by listing all months when alerts are wanted (quotes are necessary as it must be two-digit months: c(\"01\",\"02\",...))"]
[null,null,"alertmonths = c(\"01\",\"02\",\"03\",\"04\",\"05\",\"06\",\"07\",\"08\",\"09\",\"10\",\"11\",\"12\")"]
[null,null,"#Make list of images to alert by listing all days of the month when alerts are wanted (must be two-digit days: 01,02,...)"]
[null,null,"alertdays = c(\"01\",\"02\",\"03\",\"04\",\"05\",\"06\",\"07\",\"08\",\"09\",\"10\",\"11\",\"12\",\"13\",\"14\",\"15\",\"16\",\"17\",\"18\",\"19\",\"20\",\"21\",\"22\",\"23\",\"24\",\"25\",\"26\",\"27\",\"28\",\"29\",\"30\",\"31\")"]
[null,null,"#Make list of images to alert by listing all hours of the day when alerts are wanted (must be two-digit hours: 01,02,...)"]
[null,null,"alerthours = c(\"00\",\"01\",\"02\",\"03\",\"04\",\"05\",\"06\",\"07\",\"08\",\"09\",\"10\",\"11\",\"12\",\"13\",\"14\",\"15\",\"16\",\"17\",\"18\",\"19\",\"20\",\"21\",\"22\",\"23\")"]
[null,null,"#Make list of images to alert by listing all minutes of the hour wanted (must be two-digit minutes: 01,02,...)"]
[null,null,"alertminutes = c(\"00\",\"01\",\"02\",\"03\",\"04\",\"05\",\"06\",\"07\",\"08\",\"09\",\"10\",\"11\",\"12\",\"13\",\"14\",\"15\",\"16\",\"17\",\"18\",\"19\",\"20\",\"21\",\"22\",\"23\",\"24\","]
[null,null,null,null,null,null," \"25\", \"26\", \"27\", \"28\", \"29\", \"30\", \"31\", \"32\", \"33\", \"34\", \"35\", \"36\", \"37\", \"38\", \"39\", \"40\", \"41\", \"42\", \"43\", \"44\","]
[null,null,null,null,null,null," \"45\",\"46\", \"47\", \"48\", \"49\", \"50\", \"51\", \"52\", \"53\", \"54\", \"55\", \"56\", \"57\", \"58\", \"59\")"]
[null,"  ","# this code will set the ImageAlert to \"TRUE\" for all images matching the above specified time conditions"]
[null,null,null,"if (Alert==T){"]
[null,null,null,"  imagefilesinfo$ImageAlert <- c(substr(imagefilesinfo$ImageDate,1,4) %in% alertyears & "]
[null,null,null,"                                   substr(imagefilesinfo$ImageDate,6,7) %in% alertmonths & "]
[null,null,null,"                                   substr(imagefilesinfo$ImageDate,9,10) %in% alertdays & "]
[null,null,null,"                                   substr(imagefilesinfo$ImageTime,1,2) %in% alerthours & "]
[null,null,null,"                                   substr(imagefilesinfo$ImageTime,4,5) %in% alertminutes)"]
[null,null,null,"} else {"]
[null,null,null,"  imagefilesinfo$ImageAlert<- FALSE"]
[null,null,null,"}"]
[]
["## write a .csv file named after the working directory containing the image data.  All the data from this .csv file should be copied into the "]
["## Excel form.  The .csv file will show up in the same directory as this script once this script is run."]
[]
[null,"excelfilename<-paste(rev(strsplit(currentfolder,split=\"/\")[[1]])[1],\".csv\",sep=\"\")"]
[null,"write.csv(imagefilesinfo,excelfilename,row.names=F)"]