From fd29d0c680ae9bf491414ee28b2df32c2f7b5a63 Mon Sep 17 00:00:00 2001 From: devicerandom Date: Mon, 29 Jun 2009 20:21:41 +0000 Subject: [PATCH] (mfp_igor_scripts) Scripts committed --- mfp_igor_scripts/ExportMFP1D.ipf | 167 +++++++++++++++++++++++++++ mfp_igor_scripts/ExportMFP1DMenu.ipf | 4 + 2 files changed, 171 insertions(+) create mode 100644 mfp_igor_scripts/ExportMFP1D.ipf create mode 100644 mfp_igor_scripts/ExportMFP1DMenu.ipf diff --git a/mfp_igor_scripts/ExportMFP1D.ipf b/mfp_igor_scripts/ExportMFP1D.ipf new file mode 100644 index 0000000..0e0c0fe --- /dev/null +++ b/mfp_igor_scripts/ExportMFP1D.ipf @@ -0,0 +1,167 @@ +#pragma rtGlobals=1 // Use modern global access method. +#pragma IgorVersion = 4.0 +#pragma version = 0.3 + +// +// 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 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