/* A little script to take images from a directory and add them to an expression column. The method assumes the data table has a column with the file names for the images to be added. */ Names Default To Here( 1 ); dt = Current Data Table(); /* Define the column with the image locaitons. If it's in the same directory this can just be the file name. The equation expects tha the file extension will be missing from the information in the column.*/ imageLoc = "Image"; /* Define the file extension for the images.*/ fileType = "tif"; /* Give the image column a name.*/ columnName = "Micrograph"; ///////////////////////////////////////////////////////////////////////////// //Method is below // build the commands as a string to avoid issues with evaluating on column commands imageCol = "dt << New Column( \!"" || columnName || "\!", Expression, Formula( New Image( :" || imageLoc || " || " || filetype || " ) ) );"; Eval( Parse( imageCol ) ); /* License Agreement for Corrective Code or Additional Functionality SAS INSTITUTE INC. IS PROVIDING YOU WITH THE COMPUTER SOFTWARE CODE INCLUDED WITH THIS AGREEMENT ("CODE") ON AN "AS IS" BASIS, AND AUTHORIZES YOU TO USE THE CODE SUBJECT TO THE TERMS HEREOF. BY USING THE CODE, YOU AGREE TO THESE TERMS. YOUR USE OF THE CODE IS AT YOUR OWN RISK. SAS INSTITUTE INC. MAKES NO REPRESENTATION OR WARRANTY, EXPRESS OR IMPLIED,INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT AND TITLE, WITH RESPECT TO THE CODE. The Code is intended to be used solely as part of a product ("Software") you currently have licensed from SAS or one of its subsidiaries or authorized agents ("SAS"). The Code is designed to either correct an error in the Software or to add functionality to the Software, but has not necessarily been tested. Accordingly, SAS makes no representation or warranty that the Code will operate error-free. SAS is under no obligation to maintain or support the Code. Neither SAS nor its licensors shall be liable to you or any third party for any general, special, direct, indirect, consequential, incidental or other damages whatsoever arising out of or related to your use or inability to use the Code, even if SAS has been advised of the possibility of such damages. Except as otherwise provided above, the Code is governed by the same agreement that governs the Software. If you do not have an existing agreement with SAS governing the Software, you may not use the Code. (SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. Other brand and product names are registered trademarks or trademarks of their respective companies.) */