#pragma rtGlobals=1 // Use modern global access method. // in case you find this procedure useful for your research // and of help to any specific publication, please cite: // “Microstructure of Titanium Cement Lithium Disilicate Interface // in CAD CAM Dental Implant Crowns: A Three Dimensional Profilometric Analysis“, // S. Cresti et al., Clin Implant Dent Relat Res. (2013), DOI 10.1111/cid.12133 Menu "Macros" "Convert profilometer data...", ConvertProfilometerData() End Function ConvertProfilometerData() // here the variables and strings useful for loading profilometer data are defined: Variable numlines=100 Variable numpoints=6118 Variable length=1 Variable step=5 String textdatapath="C:WORK:RESEARCH:DENTAL MATs:TESI IMPIANTI:margine corone:" String filenamebase="profil" // here the data input and the respective legends are prepared: Prompt numlines, "Number of scan lines: " Prompt numpoints, "Number of points per line: " Prompt step, "step between profiles (um): " Prompt length, "length of profile (mm): " Prompt textdatapath, "Profilometer files folder: " Prompt filenamebase, "Filename base:" // here the actual input window is started: DoPrompt "Enter profilometer data parameters", numlines, numpoints, step, length, textdatapath, filenamebase // the following is a control check: //print filenamebase if (V_Flag) return -1 // User canceled endif Variable widthinm=numlines*step/1000000 Variable lengthinm=length/1000 // here the folder of the input data files folder is set: NewPath /o textdatapath textdatapath // here all the .dat profilometer files from 001 to numlines are to loaded into one wave each: variable k for (k=1; k9) & (k<100)) filenamenumber="0"+num2str(k) endif if ((k>99) & (k<1000)) filenamenumber=num2str(k) endif // the following is a control check: //print "filenamenumber: "+filenamenumber // second, the whole file name comes, from base + number + extension: String filename filename=filenamebase+"_"+filenamenumber+".dat" // the following is a control check: //print filename // finally, the file is loaded into a wave: LoadWave/J/D/O/L={0, 6, numpoints, 1, 1} /A=$filename /P=textdatapath filename endfor string wave2DName=filenamebase+"2Dmap" // the following is a control check: //print wave2Dname make/O wave2Dmap//$wave2Dname redimension /n=(numpoints,numlines) wave2Dmap //$wave2Dname Variable j, i String wavename, wavenumberprefix for (j=1; j9) & (j<100)) wavenumberprefix="0" endif if ((j>99) & (j<1000)) wavenumberprefix="" endif wavename=filenamebase+"_"+wavenumberprefix+num2str(j)+".dat0" wave w=$wavename for (i=0; i