From MistiWiki
Jump to: navigation, search

Installation and optimization[edit]

  1. Install the Reindeer Graphics tabbed text plugin [[1]]
  2. Download the scripts here. For an brief explanation of the files, check here.
  3. Extract the files to the Photoshop presets/scripts folder (C:\Program Files\Adobe\Adobe Photoshop CS#\Presets\Scripts on Windows machines)
  4. Start Photoshop and navigate to File>Scripts and verify that scripts starting with BC are listed.
  5. Note that the default values for threshold and air correction factor need to be redetermined for your system. This optimization must be performed to insure that bubble counter yields the most accurate results.
  6. Optimizing bubble counter requires samples that have been analyzed utilizing ASTM C457 and for which void frequency and air content have been determined. At least 15 different samples should be used for the optimization.
  7. The optimization script also requires that images of all of the aforementioned samples be analyzed with bubble counter prior to running the script. It is perfectly acceptable to analyze those images with the default threshold and air correction factor as this represents the starting point for the optimization routine.
  8. Analyze images of the optimization samples according to the directions found here.
  9. Having run the analyses and leaving intact the files written by the analysis script in the same folder as the original images, run the BC Optimize script in Photoshop.
  10. The script will prompt you to define the location of the folder containing the images and other files generated during the analyses. Click the Browse button to navigate to the folder.
  11. Upon selecting a location, the script will iterate through the files it finds and you must enter the ASTM C457 air content and void frequency for each of the samples. See below for the csv file alternative to manually entering these in the script dialog.
  12. Once all of the air content and void frequency values are entered (you won't be allowed to proceed until they are) click the Optimize button and take a few sips of coffee. The script is designed to quickly converge on a solution, but "quick" is relative to the vintage of the machine the software is running on. On a modern, multicore PC, it generally completes a 15 image optimization in just a couple minutes.
  13. Upon completion of the optimization routine, you will be presented with a dialog indicating what the routine calculated as an optimum threshold and air correction factor. Reports of the iterations and summary of findings will also be written to the folder containing the images should you need to recover them.
  14. Tell the script to rewrite the default values so that you don;t have to enter them every time an analysis is run. The default values are stored in a file named BC_Defaults.jsxinc located in the Presets\Scripts\BC_Classes folder. This file can be manually edited if required.

Using the optimizer_entries.csv file to semi-automate optimization[edit]

The optimization script uses a csv file to store the manually determined ASTM C457 air content and void frequency values for each of the images used for optimization. The file can be created before running the optimization or you can manually enter the values into the optimization dialog box. It's faster to create the file before running the optimization script, using Excel and saving it as optimizer_entries.csv in the folder containing the images.

The file contains the header line: fileNameOriginalImage,airContent,voidFreq

In Excel, starting at cell A1: fileNameOriginalImage; A2: airContent; A3: voidFreq

Subsequent lines contain the tif image file name, air content and void frequency (voids/mm). All values must be separated by commas. One line is required for each image used in the optimization. In Excel, just put the proper values in the rows below the header, one row for each file used in the optimization. When everything is entered in Excel, save the file in csv format as optimizer_entries.csv in the folder that contains all of the images.

If you're comfortable with the command line, you can simplify the entry of filenames by piping the output from dir to a text file and copying the list of files to Excel. From the command line, after navigating to the folder containing the images, run dir *.tif /B >files.txt. The files.txt text file will contain a list of all of the tif file names, including the _comp image file names, which need to be removed from the optimizer_entries.csv file prior to running optimization.

Time saving (?) procedural stuff[edit]

All images have to be analyzed with existing thresholds before running optimization. The optimization routine uses only the props files and the tab delimited text files. With this in mind, below is the workflow I use to hopefully maximize my efficiency.

  1. Place all of the scanned images in a logically named folder.
  2. Analyze all of the images - don't worry about goofy results, this has to be done prior to optimization.
  3. After all of the images have been analyzed, create a folder within the folder containing all of the analyzed images. Name it BCOptimize.
  4. Copy only the _props.csv and the _comp.txt files of the slabs to perform optimization with into the BCOptimize folder.
  5. In Windows Explorer (or file manager) navigate to the BCOptimize folder.
  6. Copy the path in the address bar (in Win7, click to the right of the path to display system path - want to copy the C:\blah\blah\blah).
  7. Open a command prompt and type cd[space] and then right click in the black area. Select Paste and then hit enter. This is a quick and easy way to navigate to the folder from a command prompt.
  8. Once in the BCOptimize folder at the command prompt, type dir *.txt > files.txt. This dumps the results of a dir command into text file. Since only the txt files were queried, they will be the only listings in the newly created files.txt.
  9. Open files.txt in Excel and parse the text into columns (Data ribbon>Text to Columns). Delete all but the file names columns.
  10. Perform a search and replace, replacing _comp.txt with .tif. This will create a list of the original tif file names that Optimizer uses.
  11. Now create the optimizer_entries.csv file by plugging or copying in the air content and void frequency determined by manual point count/linear traverse. Save it as a csv in the BCOptimize folder.
  12. Run BCOptimize, select the BCOptimize folder and tell the script to use the file it finds there.
  13. Iterate through all of the entries to make sure the script likes what it discovered.
  14. Run the optimization of your choice.

All results will be written to reports in the BCOptimize folder. The original scans aren't touched, nor are the files created during the initial analysis. Update the BC_Defaults file with the new threshold values. Edit the BC Analyze Prepared Images txt only script to have it generate the reports you want. Run it and select the folder with all of the previously analyzed scans in it and sip some coffee.