#pragma rtGlobals=1 // Use modern global access method. #pragma IgorVersion = 4.0 #pragma version = 0.4 // // ExportMFP1D.ipf - A procedure to export force curves from MFP1D to 'hooke' // // Copyright (c) 2009 Rolf Schmidt, Montreal // rschmidt@alcor.concordia.ca // // This procedure is released under the GNU General Public License version 2 // // History // 2009 07 24: v0.4 // the wave note is now correctly and fully exported in Igor 4 // 2009 06 29: v0.3 // split functionality into ExportMFP1DFolder and ExportMFP1DWaves // ExportMFP1DFolder: export individual Igor binary waves file from a folder // ExportMFP1DWaves: export all currently open waves to a folder // 2009 06 26: v0.2.1 // added the IgorVersion pragma // 2009 06 19: v0.2 // changed the filename finding algorithm to work with Igor 4 and up // Igor 5 users can use the code marked 'the following only works in Igor 5 and up' instead // the procedure now catches 'Cancel' on NewPath // added version information // 2009 05 29: v0.1 // changed the procedure so that it runs in Igor as well as in MFP (ie Igor with MFP plug-in) // How to use ExportMFP1D() // - save all current waves of interest (ExportMFP1D() kills all open waves before exporting files) // - execute ExportMFP1D() from the command line // - browse to a folder containing force curves (a 'force curve' consists of two files: one 'deflection' and one 'LVDT' file // - ExportMFP1D() will now iterate through all the waves in the folder, extract the header information and create four columns: // 1: approach (x) 2: approach (y) 3: retraction (x) 4; retraction (y) // - the resulting files are saved in the same folder and the same base name as the original files (ie without 'deflection' and 'LVDT') // CAUTION: existing files will be overwritten! // - these files can then be analyzed with 'hooke' Function ExportMFP1DFolder() String sList Variable iCount // set the path (used for opening the waves and saving the output files later) NewPath /O /Q /M="Choose the folder that contains the waves" PathExport1D KillWaves /A /Z if(V_flag>=0) // get a list of all Igor binary waves in the folder sList=IndexedFile(PathExport1D,-1,".ibw") // load all waves for(iCount=0; iCount