// Pairs Comparison Calculator // JMP Discovery Summit 2018 // Evan Bittner // Last Edited: 9/21/2018 // This script presents the pairs comparison pairs from images in a directory to the user // Requests the user to input the score for each pairs // Computes the average ratio calculation for the set of samples (images) // Open the Excel file with the unique pairs listed by row - Try making a jsl script for this! dt = Open( "\\NA.corning.com\CVUD-MTE$\UD3\bittnere\My Documents\MPE Proj Review\Proj Rev Scoresheet.xls", "invisible" ); // Create a matrix with the pairs pairs = [](0, 2); For Each Row( pairs |/= Matrix( {{dt:Left Sample, dt:Right Sample}} ) ); //Show( pairs ); npairs = N Row( pairs ); //Initialize a list for scores leftScores = {}; // Do this for each pair For( a = 1, a <= npairs, a++, // Concatenate string for the file path of the current left and right image in the loop // *** This is for file names containing just a number fileL = "\\NA.corning.com\CVUD-MTE$\UD3\bittnere\My Documents\JMP\JMP Discovery Summit 2018\Presentation\Data and Script\Testing\Images\Number\" || Char( pairs[a, 1] ) || ".tif"; Show( fileL ); fileR = "\\NA.corning.com\CVUD-MTE$\UD3\bittnere\My Documents\JMP\JMP Discovery Summit 2018\Presentation\Data and Script\Testing\Images\Number\" || Char( pairs[a, 2] ) || ".tif"; files = {fileL, fileR}; // Show( files ); // Read in each image of the pair For( b = 1, b <= 2, b++, fileName = files[b]; img = New Image( fileName ); If( b == 1, imgL = img ); If( b == 2, imgR = img ); ); // Create the dialog box to view the images in the pair and input the score // *** Note: Must go in order and enter a score for each pair dialog = New Window( "Score Entry", <