-
Notifications
You must be signed in to change notification settings - Fork 1
/
CORDUROY_ANALYSIS_gui.ipf
executable file
·1121 lines (867 loc) · 47.9 KB
/
CORDUROY_ANALYSIS_gui.ipf
1
#pragma rtGlobals=2 // Use modern global access method./////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// CORDUROY_ANALYSIS_gui// Contains the code for the GUI interface for the ROI based analysis// All code for analysis functions is contained in CORDUROY_ANALYSIS_LIBRARY//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Function CORD_InitializeAnalysis()/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// String thisDF = GetDataFolder(1) CORD_CreatePaths()// Create folders for the panel NewDataFolder/O root:Analysis NewDataFolder/O root:Analysis:Panels NewDataFolder/O/S root:Analysis:Panels:AnalysisPanel// Create the ROI start and stop variables variable/G ROI1_tstart=0, ROI1_tstop=0, ROI2_tstart=0, ROI2_tstop=0, ROI3_tstart=0, ROI3_tstop=0, ROI4_tstart=0, ROI4_tstop=0, ROI5_tstart=0, ROI5_tstop=0 string/G ROI1_analysis="None",ROI2_analysis="None",ROI3_analysis="None",ROI4_analysis="None",ROI5_analysis="None" variable/G Delta = 0, Repeats = 1, Initial=0 string/G ExperimentType="CC_IO;VC_IO;Stim_IO;TimeCourse;Add Type...", CurrExperimentType="TimeCourse" CORD_CreateFunctionList()// Restore initial data folder SetDataFolder thisDFEnd///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Function CORD_DisplayAnalysisPanel(initFlag)/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Variable initFlag String thisDF = GetDataFolder(1)// Create globals that will need to be accessed by the panel if(initFlag==1) CORD_InitializeUtilityVars() CORD_InitializeAnalysis() CORD_InitializeModules() endif// Launch the main Analysis Control panel for ROI based analysis DoWindow/F CORD_AnalysisControlPanel if (V_Flag!=0) DoWindow/K CORD_AnalysisControlPanel endif Execute "CORD_AnalysisControlPanel()" Execute "ModifyPanel cbRGB = (20000,20000,20000)"// Launch the XML info panel if the experiment has associated XML data CORD_DisplayELN()// Restore initial data folder SetDataFolder thisDFEnd///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Function CORD_InitializeModules()/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// String thisDF = GetDataFolder(1) SetDataFolder root:Analysis:Panels:AnalysisPanel string/G PreloadAMOD="" NewDataFolder/O/S root:Analysis:Modules string/G None = "CORD_SetROIValues(0,0,0,0,0,0,0,0,0,0,\"None\",\"None\",\"None\",\"None\",\"None\",\"TimeCourse\",0,10,1)" SetDataFolder root:Analysis:Modules// Load saved modules from resident files in the directory $HOME/Corduroy/Modules/Analysis/ LoadData /D/L=4 /O/Q/P=ModulePath "Analysis" string temp = StringList("*",";") print "Modules found: "+temp PreloadAMOD = temp// Update the panel in the event the reinitialize command is called ControlUpdate/W=CORD_AnalysisControlPanel AMOD_loadmod// Restore initial data folder SetDataFolder thisDFEnd//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// CONTROL PANEL ACTION FUNCTIONS/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Function CORD_StoreCursorValues(ctrlName) : ButtonControl/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// string ctrlName String thisDF = GetDataFolder(1) string parseCntrl = StringFromList(0,ctrlName,"_") string newStart = "root:Analysis:Panels:AnalysisPanel:"+parseCntrl+"_"+"tstart" string newStop = "root:Analysis:Panels:AnalysisPanel:"+parseCntrl+"_"+"tstop" NVAR tstart = $newStart NVAR tstop = $newStop tstart = xcsr(A) tstop = xcsr(B) ControlUpdate/A/W=CORD_AnalysisControlPanel SetDataFolder thisDFEnd///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Function CORD_SelectAnalysis(cntrlName,popNum,popStr) : PopupMenuControl/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// string cntrlName variable popNum string popStr if(stringmatch(popStr,"Add*")) Abort "In order to add analysis functions of your own first consult the manual. Once entered in the library open CORDUROY_ANALYSIS_library.ipf and add to the list in the first function." else String thisDF = GetDataFolder(1) string parseCntrl = StringFromList(0,cntrlName,"_") string newStart = "root:Analysis:Panels:AnalysisPanel:"+parseCntrl+"_"+"analysis" SVAR AnalysisName = $newStart AnalysisName = popStr SetDataFolder thisDF endif End///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Function CORD_SelectExpType(cntrlName,popNum,popStr) : PopupMenuControl/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// string cntrlName variable popNum string popStr String thisDF = GetDataFolder(1) if(stringmatch(popStr,"Add Type...")) Abort "not yet possible" else SVAR ExpType = root:Analysis:Panels:AnalysisPanel:CurrExperimentType ExpType = popStr endif SetDataFolder thisDFEnd///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Function CORD_StoreModuleButton(ctrlName) : ButtonControl/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// string ctrlName String thisDF = GetDataFolder(1) CORD_DisplayStringPanel() PauseForUser CORD_EnterStringPanel SVAR NewModuleName = root:Analysis:Modules:NewModuleName CORD_StoreModuleAs(NewModuleName) SetDataFolder thisDFEnd///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Function CORD_AnalysisPanelButtons(ctrlName) : ButtonControl/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// string ctrlName String thisDF = GetDataFolder(1) strswitch(ctrlName) case "MAIN_run": NVAR batchFlag = root:Analysis:batchParams:batchFlag batchFlag = 0 CORD_AnalysisPanelRun() break case "MAIN_edit": CORD_AnalysisPanelEdit() break case "MAIN_view": CORD_AnalysisPanelView() break case "MAIN_batch": CORD_AnalysisPanelBatch() break endswitch SetDataFolder thisDFEnd//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// TOP-LEVEL ANALYSIS FUNCTIONS/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Function CORD_AnalysisPanelRun()/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// This function controls the indexing of the waves and the sequential calls to the analysis library functions// Does nothing with the variables that are generated other than passing an index variable to the analysis function// Analysis functions are responsible creating indexed waves with variables// This function creates what is the corresponding x axis wave specific to the experiment type (time course, input/output, etc.)// Wvaes to be analyzed are grabbed from the top window (graph) and the relevant anlyses defined by the control panel// /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// String thisDF = GetDataFolder(1) SVAR prefix1 = root:Analysis:Panels:AnalysisPanel:ROI1_Analysis string roi1call SVAR prefix2 = root:Analysis:Panels:AnalysisPanel:ROI2_Analysis string roi2call SVAR prefix3 = root:Analysis:Panels:AnalysisPanel:ROI3_Analysis string roi3call SVAR prefix4 = root:Analysis:Panels:AnalysisPanel:ROI4_Analysis string roi4call SVAR prefix5 = root:Analysis:Panels:AnalysisPanel:ROI5_Analysis string roi5call NVAR roi1_tstart = root:Analysis:Panels:AnalysisPanel:ROI1_tstart NVAR roi1_tstop = root:Analysis:Panels:AnalysisPanel:ROI1_tstop NVAR roi2_tstart = root:Analysis:Panels:AnalysisPanel:ROI2_tstart NVAR roi2_tstop = root:Analysis:Panels:AnalysisPanel:ROI2_tstop NVAR roi3_tstart = root:Analysis:Panels:AnalysisPanel:ROI3_tstart NVAR roi3_tstop = root:Analysis:Panels:AnalysisPanel:ROI3_tstop NVAR roi4_tstart = root:Analysis:Panels:AnalysisPanel:ROI4_tstart NVAR roi4_tstop = root:Analysis:Panels:AnalysisPanel:ROI4_tstop NVAR roi5_tstart = root:Analysis:Panels:AnalysisPanel:ROI5_tstart NVAR roi5_tstop = root:Analysis:Panels:AnalysisPanel:ROI5_tstop // MUST BE ABLE TO TOGGLE BETWEEN TOPGRAPH AND BATCH VERSION THAT SELECTS CHANNELS AUTOMATICALLY NVAR batchFlag = root:Analysis:batchParams:batchFlag variable bindex=0 string currMatch="" string list_of_waves_tmp="" if(!NVAR_Exists(batchFlag)) batchFlag=0 endif // First get the list of waves from the TopGraph if(batchFlag) SVAR dfList = root:Analysis:batchParams:dfList SVAR currDfName = root:Analysis:batchParams:currDfName SVAR batchTargetName = root:Analysis:batchParams:batchTargetName SVAR chanToAnalyze = root:Analysis:batchParams:chanToAnalyze SetDataFolder currDfName for(bindex=0;bindex<ItemsInList(chanToAnalyze);bindex+=1) currMatch = "Record"+StringFromList(bindex,chanToAnalyze)+"*" list_of_waves_tmp += WaveList(currMatch, ";","") endfor else list_of_waves_tmp = TraceNameList("", ";", 1) print list_of_waves_tmp endif string list_of_waves = SortList(list_of_waves_tmp,";",16) WAVE w = $(StringFromList(0, list_of_waves)) string the_df = GetWavesDataFolder(w,1)// Get the name of the top graph and set/make data folder to hold analysis if(WaveExists(w)!=0) //Find the location of the top wave and set as active so analysis will be stored here print "Analysis will be stored in "+the_df SetDataFolder $the_df else Abort "Cannot seem to find any waves for analysis in the top graph? Please try again, but if this persists report as a bug." endif// Loop through all the waves and call the respective analysis functions for each string wave_name="" Make/O/N=1 NumWaves = ItemsInList(list_of_waves) Make/O/N=1 chanCnt = 1 variable index=0, channel=0 for(index=0;index<NumWaves[channel];index+=1) wave_name = StringFromList(index, list_of_waves) if(stringmatch(prefix1,"*None*")) Abort "Must have at least one ROI defined with an analysis or you should define ROIs from first position" else roi1call = "CORD_"+prefix1+"_execute(\""+wave_name+"\","+num2str(roi1_tstart)+","+num2str(roi1_tstop)+","+num2str(index)+","+num2str(NumWaves[channel])+",1)" print roi1call Execute roi1call endif if( !(stringmatch(prefix2,"*None*")) ) roi2call = "CORD_"+prefix2+"_execute(\""+wave_name+"\","+num2str(roi2_tstart)+","+num2str(roi2_tstop)+","+num2str(index)+","+num2str(NumWaves[channel])+",2)" Execute roi2call else continue endif if( !(stringmatch(prefix3,"*None*")) ) roi3call = "CORD_"+prefix3+"_execute(\""+wave_name+"\","+num2str(roi3_tstart)+","+num2str(roi3_tstop)+","+num2str(index)+","+num2str(NumWaves[channel])+",3)" Execute roi3call else continue endif if( !(stringmatch(prefix4,"*None*")) ) roi4call = "CORD_"+prefix4+"_execute(\""+wave_name+"\","+num2str(roi4_tstart)+","+num2str(roi4_tstop)+","+num2str(index)+","+num2str(NumWaves[channel])+",4)" Execute roi4call else continue endif if( !(stringmatch(prefix5,"*None*")) ) roi5call = "CORD_"+prefix5+"_execute(\""+wave_name+"\","+num2str(roi5_tstart)+","+num2str(roi5_tstop)+","+num2str(index)+","+num2str(NumWaves[channel])+",5)" Execute roi5call endif endfor // the loop through each wave// Create the the x-axis wave based upon information given in the analysis panel SVAR XwaveType = root:Analysis:Panels:AnalysisPanel:CurrExperimentType NVAR initial = root:Analysis:Panels:AnalysisPanel:Initial NVAR delta = root:Analysis:Panels:AnalysisPanel:Delta NVAR repeats = root:Analysis:Panels:AnalysisPanel:Repeats Make/O/N=(NumWaves[0]) xwave if(!stringmatch(XWaveType,"ChannelB") ) variable xindex=0, count=0 if(repeats==1) xwave = initial + (p*delta) else for(xindex=0;xindex<NumWaves;xindex+=repeats) xwave[xindex,(xindex+(repeats-1))] = initial + (delta*count) count += 1 print xindex endfor endif else // Use channel B to get values of the x wave at the given roi's SetDataFolder thisDF Edit/K=1 xwave Abort "Analysis is complete but the xwave generation is not yet implemented, must do manually. Table is open beneath this window." endif SetDataFolder $the_dfEnd///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Function CORD_AnalysisPanelEdit()/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// String thisDF = GetDataFolder(1)// Search for a unique feature of analysis output within the given folder string AnalysisList = WaveList("*_roi*",";",""), currWave="" variable ListLength = ItemsInList(AnalysisList), index=0 if(ListLength==0) Abort "Corduroy cannot find any analysis files to place in a table. Try changing data folders." endif DoWindow/K AnalysisGUIEdit for(index=0;index<ListLength;index+=1) currWave = StringFromList(index,AnalysisList) if( index==0 ) Edit/K=1/W=(0,0,1000,200) $currWave as "Analysis Waves Viewer" DoWindow/C AnalysisGUIEdit else AppendToTable/W=AnalysisGUIEdit $currWave endif endfor SetDataFolder thisDFEnd///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Function CORD_AnalysisPanelView()/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// String thisDF = GetDataFolder(1) // Kill existing output graphs String ExistingOutputGraphs = WinList("output*",";",""), CurrentOutputGraph="" variable killi=0 for(killi=0;killi<ItemsInList(ExistingOutputGraphs);killi+=1) CurrentOutputGraph = StringFromList(killi,ExistingOutputGraphs) DoWindow/K $CurrentOutputGraph endfor// Search for a unique feature of analysis output within the given folder string AnalysisList = WaveList("*_roi*",";","") string LabelList = WaveList("*output*",";","") // Use a popup to allow the user to select waves that want to be viewed// Should probably switched to a panel that allows the specific dimension to be selected string popList = AnalysisList string plot1,plot2,plot3,plot4,plot5 Prompt plot1,"Graph 1 wave:",popup,"None;"+popList Prompt plot2,"Graph 2 wave:",popup,"None;"+popList Prompt plot3,"Graph 3 wave:",popup,"None;"+popList Prompt plot4,"Graph 4 wave:",popup,"None;"+popList Prompt plot5,"Graph 5 wave:",popup,"None;"+popList DoPrompt "Select output waves to view...",plot1,plot2,plot3,plot4,plot5 if (V_Flag) return -1 endif // Decide on the appropriate number of graphs and sizes and go... string fullList = plot1+";"+plot2+";"+plot3+";"+plot4+";"+plot5 string plotList = ListMatch(fullList, "!None",";") variable count = ItemsInList(plotList) // Generate evenly spaced graphs variable EachGraphHeight = round(700 / 5), EachGraphWidth = round(1024 / 3), spacing=70 string CurrentWave, ex_string variable index = 0,left=0,top,right=EachGraphWidth,bottom=70 for(index=0;index<count;index+=1) CurrentWave = StringFromList(index,plotList)+"[][0]" top = bottom bottom = top + EachGraphHeight ex_string = "Display /K=1 /L /N=output /W=("+num2str(left)+","+num2str(top)+","+num2str(right)+","+num2str(bottom)+") "+CurrentWave+" vs xwave as \""+CurrentWave+"\"" //output"+num2str(index)+"::"+CurrentWave+"\"" Execute ex_string ModifyGraph font="Verdana", grid=1, fsize=10 endfor SetDataFolder thisDFEnd///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Function CORD_AnalysisPanelBatch()/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// String thisDF = GetDataFolder(1) NewDataFolder/O root:Analysis NewDataFolder/O root:Analysis:batchParams variable/G root:Analysis:batchParams:batchFlag=1 // set the batch properties for total run interactively with the user string chToAnalyze="",batchTarget="" Prompt chToAnalyze,"Enter the channel to analyze (CURRENTLY ONLY SINGLE CHANNEL IS SUPPORTED, BUT SOON MULTICHANNEL): " Prompt batchTarget,"Enter a target name for batch results: " DoPrompt "BATCH ANALYSIS | PARAMETERS",chToAnalyze,batchTarget if (V_Flag) return -1 endif if(strlen(chToAnalyze)!=1) Abort "Please select only one channel to batch analyze at this time. Future releases will allow multichannel support." endif string/G root:Analysis:batchParams:batchTargetName = batchTarget string/G root:Analysis:batchParams:chanToAnalyze = chToAnalyze CORD_CreateList() SVAR SelectedWaves = root:Analysis:UtilityPanel:SelectedWaves string/G root:Analysis:batchParams:dfList = SelectedWaves SVAR dfList = root:Analysis:batchParams:dfList SVAR batchTargetName = root:Analysis:batchParams:batchTargetName SVAR chanToAnalyze = root:Analysis:batchParams:chanToAnalyze variable index=0 string list="", matchName="" // step through the batch folders and run the analysis for(index=0;index<ItemsInList(dfList);index+=1) // the following values must be set for each df of data that will be run in batch mode string/G root:Analysis:batchParams:currDfName = StringFromList(index,dfList) SVAR dfToSet = root:Analysis:batchParams:currDfName SetDataFolder $dfToSet print GetDataFolder(0) matchName = "Record"+chToAnalyze+"*" list = WaveList(matchName, ";", "") // plot the relevant channel if(stringmatch(chToAnalyze, "A")) DisplayWaveListOneChannel(list,1) elseif(stringmatch(chToAnalyze, "B")) DisplayWaveListOneChannel(list,2) else Abort "I am not sure what channel you want to use. Talk to Josh..." endif // run the analysis CORD_AnalysisPanelRun() endfor // loop through again and collect together the results of the analysis across the bacth dfs CORD_CombineMultipleAnalyses(dfList,batchTargetName)End///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Function CORD_CombineMultipleAnalyses(dfList,batchTargetName)///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// For any analysis that was done go in to the data folder and generate summary data to combne the analyses together into individual matrices where columns// are repetitions instead of different variables. string dfList string batchTargetName variable index, jndex, kndex, cols string currDF, allAnalyses, currWave, compiledName, compiledNameBase NewDataFolder/O/S $("root:"+batchTargetName) string/G lastDfListUsed = dfList for(index=0;index<ItemsInList(dfList);index+=1) // indexing each directory containing analysis currDF = StringFromList(index, dfList) SetDataFolder $currDF allAnalyses = WaveList("*roi*",";","") for(jndex=0;jndex<ItemsInList(allAnalyses);jndex+=1) // indexing each analysis matrix currWave = StringFromList(jndex,allAnalyses) print currWave WAVE local = $currWave if(DimSize(local,1)<=1) cols = 1 endif for(kndex=0;kndex<cols;kndex+=1) // through each column of the analysis matrix compiledNameBase = "root:"+batchTargetName+":CMP_"+StringFromList(3,currWave,"_")+"_"+StringFromList(4,currWave,"_") +"_"+StringFromList(5,currWave,"_") compiledName = compiledNameBase+"_"+num2str(kndex) print compiledName if(index==0) Make/O/N=(DimSize(local,0),ItemsInList(dfList)) $compiledName endif WAVE destination = $compiledName destination[][index] = local[p][kndex] endfor endfor endforEnd///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Function CORD_MeanAllOfMatrixDir()/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// string listOfAllMatrices = WaveList("CMP*",";","") variable lengthOfAll = ItemsInList(listOfAllMatrices) string newName="", tmpSuffix="", CurrMatrix="" variable index=0 for(index=0;index<lengthOfAll;index+=1) CurrMatrix = StringFromList(index, listOfAllMatrices) WAVE local = $CurrMatrix CORD_MeanAMatrix(local) sscanf CurrMatrix, "CMP%s", tmpSuffix newName = "CMM"+tmpSuffix+"_cM" Rename colMean, $newName newName = "CMM"+tmpSuffix+"_cE" Rename colSEM, $newName newName = "CMM"+tmpSuffix+"_rM" Rename rowMean, $newName newName = "CMM"+tmpSuffix+"_rE" Rename rowSEM, $newName endforEnd///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Function CORD_MeanAMatrix(matrix)/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Wave matrix // discover the dimensions variable rows = DimSize(matrix,0) variable cols = DimSize(matrix,1) print rows, cols // create the row-wise mean and column-wise mean of a matrix variable index=0 for(index=0;index<cols;index+=1) // column wise means // create a temporary copy of the matrix column as a wave if(index==0) Make/O/N=(cols) tmpWave Make/O/N=(cols) colMean Make/O/N=(cols) colSEM endif // get stats on the temporary copy tmpWave[] = matrix[p][index] WaveStats/Q tmpWave colMean[index] = V_avg colSEM[index] = V_sdev/sqrt(V_npnts-1) endfor for(index=0;index<rows;index+=1) // row wise means // create a temporary copy of the matrix column as a wave if(index==0) Make/O/N=(rows) tmpWave Make/O/N=(rows) rowMean Make/O/N=(rows) rowSEM endif tmpWave[] = matrix[index][p] // get the stats on the temporary wave WaveStats/Q tmpWave rowMean[index] = V_avg rowSEM[index] = V_sdev/sqrt(V_npnts-1) endfor End//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// WORKING WITH MODULES/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Function CORD_SetROIValues(var11,var12,var21,var22,var31,var32,var41,var42,var51,var52,anal1,anal2,anal3,anal4,anal5,exptype,initial,delta,reps)/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// variable var11,var12,var21,var22,var31,var32,var41,var42,var51,var52 string anal1,anal2,anal3,anal4,anal5 string exptype variable initial, delta, reps String thisDF = GetDataFolder(1) DoWindow/F CORD_AnalysisControlPanel if (V_Flag!=0) DoWindow/K CORD_AnalysisControlPanel endif NVAR tstart1 = root:Analysis:Panels:AnalysisPanel:ROI1_tstart tstart1 = var11 NVAR tstop1 = root:Analysis:Panels:AnalysisPanel:ROI1_tstop tstop1 = var12 SVAR analg1 = root:Analysis:Panels:AnalysisPanel:ROI1_analysis analg1 = anal1 NVAR tstart2 = root:Analysis:Panels:AnalysisPanel:ROI2_tstart tstart2 = var21 NVAR tstop2 = root:Analysis:Panels:AnalysisPanel:ROI2_tstop tstop2 = var22 SVAR analg2 = root:Analysis:Panels:AnalysisPanel:ROI2_analysis analg2 = anal2 NVAR tstart3 = root:Analysis:Panels:AnalysisPanel:ROI3_tstart tstart3 = var31 NVAR tstop3 = root:Analysis:Panels:AnalysisPanel:ROI3_tstop tstop3 = var32 SVAR analg3 = root:Analysis:Panels:AnalysisPanel:ROI3_analysis analg3 = anal3 NVAR tstart4 = root:Analysis:Panels:AnalysisPanel:ROI4_tstart tstart4 = var41 NVAR tstop4 = root:Analysis:Panels:AnalysisPanel:ROI4_tstop tstop4 = var42 SVAR analg4 = root:Analysis:Panels:AnalysisPanel:ROI4_analysis analg4 = anal4 NVAR tstart5 = root:Analysis:Panels:AnalysisPanel:ROI5_tstart tstart5 = var51 NVAR tstop5 = root:Analysis:Panels:AnalysisPanel:ROI5_tstop tstop5 = var52 SVAR analg5 = root:Analysis:Panels:AnalysisPanel:ROI5_analysis analg5 = anal5 SVAR setExp = root:Analysis:Panels:AnalysisPanel:CurrExperimentType setExp = exptype NVAR initA = root:Analysis:Panels:AnalysisPanel:Initial initA = initial NVAR deltaA = root:Analysis:Panels:AnalysisPanel:Delta deltaA = delta NVAR repA = root:Analysis:Panels:AnalysisPanel:Repeats repA = reps CORD_DisplayAnalysisPanel(0) SetDataFolder thisDFEnd///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Function CORD_SelectAnalysisMod(cntrlName,popNum,popStr) : PopupMenuControl/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// string cntrlName variable popNum string popStr String thisDF = GetDataFolder(1) CORD_LoadMod(popStr) SetDataFolder thisDFEnd///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Function CORD_LoadMod(modName)/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// string modName String thisDF = GetDataFolder(1) SetDataFolder root:Analysis:Modules SVAR ex_string = $modName Execute ex_string SetDataFolder thisDFEnd///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Window CORD_EnterStringPanel() : Panel/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// PauseUpdate; Silent 1 // building the window... NewPanel/W=(400,340,700,440)/K=1 as "Please name this module..."// Use a string global and a SetVariable to get the data in SetVariable ModuleNameSetVar bodywidth=200,noproc,pos={240,10},title="",value=root:Analysis:Modules:NewModuleName// Create a button that closes the window to cotinue execution of procedure with this function embedded Button ModuleNameButton, pos={110,70}, size={80,20}, proc=CORD_EnterStringKill, title="Close"End///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Function CORD_DisplayStringPanel()/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// String thisDF = GetDataFolder(1)// Launch the panel SetDataFolder root:Analysis:Modules String/G NewModuleName = "Enter the name here" Execute "CORD_EnterStringPanel()"// Restore initial data folder SetDataFolder thisDFEnd///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Function CORD_EnterStringKill(ctrlName) : ButtonControl/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// String ctrlName DoWindow/K CORD_EnterStringPanelEnd///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Window CORD_CheckCursorPanel() : Panel/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// PauseUpdate; Silent 1 // building the window... NewPanel/W=(400,340,700,440)/K=1 as "Are cursors in correct position?"// Use a string global and a SetVariable to get the data in SetVariable CursorLeft bodywidth=100,noproc,pos={100,10},title="start",value=root:Analysis:CheckCursorDialogue:CheckCursorLeft SetVariable CursorRight bodywidth=100,noproc,pos={230,10},title="end",value=root:Analysis:CheckCursorDialogue:CheckCursorRight// Create a button that closes the window to cotinue execution of procedure with this function embedded Button StoreCsrButton, pos={110,40}, size={80,20}, proc=CORD_StoreCheckCursorValues, title="Store Csr" Button ContinueButton, pos={110,70}, size={80,20}, proc=CORD_CheckCursorKill, title="Continue"End///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Function CORD_StoreCheckCursorValues(ctrlName) : ButtonControl/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// string ctrlName String thisDF = GetDataFolder(1) NVAR left = root:Analysis:CheckCursorDialogue:CheckCursorLeft NVAR right = root:Analysis:CheckCursorDialogue:CheckCursorRight left = xcsr(A) right = xcsr(B) ControlUpdate/A/W=CORD_CheckCursorPanel SetDataFolder thisDFEnd///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Function CORD_DisplayCheckCursorPanel(guess1,guess2)/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// variable guess1, guess2 String thisDF = GetDataFolder(1)// Get name of first trace on top graph string FirstName = StringFromList(0,TraceNameList("",";",1))// Set the cursors to the guess positions on the top graph Cursor/A=1 A, $FirstName, guess1 Cursor/A=1 B, $FirstName, guess2// Set up necessary variables/strings NewDataFolder/O/S root:Analysis:CheckCursorDialogue Variable/G CheckCursorLeft = guess1 Variable/G CheckCursorRight = guess2 Variable/G IsDefault = 0 string TargetWin = WinName(0,1)// Launch the panel Execute "CORD_CheckCursorPanel()"// Wait until the dialogue is killed to continue PauseForUser CORD_CheckCursorPanel, $TargetWin // Restore initial data folder SetDataFolder thisDFEnd///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Function CORD_CheckCursorKill(ctrlName) : ButtonControl/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// String ctrlName DoWindow/K CORD_CheckCursorPanelEnd///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Function CORD_SetCursorDefault(cntrlName,popNum,popStr) : PopupMenuControl/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// string cntrlName variable popNum string popStr NVAR IsDefault = root:Analysis:CheckCursorDialogue:IsDefault IsDefault = popNum End//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Function CORD_DisplayZoom2(cntrlName) : ButtonControl////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// string cntrlName variable zoomlevel = 2 string tmp1 = StringFromList(0,cntrlName,"_") string tmp2 = "root:Analysis:Panels:AnalysisPanel:"+tmp1+"_tstart" string tmp3 = "root:Analysis:Panels:AnalysisPanel:"+tmp1+"_tstop" NVAR left = $tmp2 NVAR right = $tmp3 CORD_DisplayZoomEX(left,right,zoomlevel)end///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Function CORD_StoreModuleAs(name)/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// string name String thisDF = GetDataFolder(1) NVAR tstart1 = root:Analysis:Panels:AnalysisPanel:ROI1_tstart NVAR tstart2 = root:Analysis:Panels:AnalysisPanel:ROI2_tstart NVAR tstart3 = root:Analysis:Panels:AnalysisPanel:ROI3_tstart NVAR tstart4 = root:Analysis:Panels:AnalysisPanel:ROI4_tstart NVAR tstart5 = root:Analysis:Panels:AnalysisPanel:ROI5_tstart NVAR tstop1 = root:Analysis:Panels:AnalysisPanel:ROI1_tstop NVAR tstop2 = root:Analysis:Panels:AnalysisPanel:ROI2_tstop NVAR tstop3 = root:Analysis:Panels:AnalysisPanel:ROI3_tstop NVAR tstop4 = root:Analysis:Panels:AnalysisPanel:ROI4_tstop NVAR tstop5 = root:Analysis:Panels:AnalysisPanel:ROI5_tstop NVAR type1 = root:Analysis:Panels:AnalysisPanel:Initial NVAR type2 = root:Analysis:Panels:AnalysisPanel:Delta NVAR type3 = root:Analysis:Panels:AnalysisPanel:Repeats ControlInfo/W=CORD_AnalysisControlPanel ROI1_popupA string anal1 = S_Value ControlInfo/W=CORD_AnalysisControlPanel ROI2_popupA string anal2 = S_Value ControlInfo/W=CORD_AnalysisControlPanel ROI3_popupA string anal3 = S_Value ControlInfo/W=CORD_AnalysisControlPanel ROI4_popupA string anal4 = S_Value ControlInfo/W=CORD_AnalysisControlPanel ROI5_popupA string anal5 = S_Value ControlInfo/W=CORD_AnalysisControlPanel TYPE_popup string type4 = S_Value string/G $name = "CORD_SetROIValues("+num2str(tstart1)+","+num2str(tstop1)+","+num2str(tstart2)+","+num2str(tstop2)+","+num2str(tstart3)+","+num2str(tstop3)+","+num2str(tstart4)+","+num2str(tstop4)+","+num2str(tstart5)+","+num2str(tstop5)+",\""+anal1+"\",\""+anal2+"\",\""+anal3+"\",\""+anal4+"\",\""+anal5+"\",\""+type4+"\","+num2str(type1)+","+num2str(type2)+","+num2str(type3)+")" SVAR test = root:Analysis:Modules:$name if(SVAR_exists(test)) string OW_Flag prompt OW_Flag, "Do you want to overwrite the existing module?",popup,"Yes;No" DoPrompt "Module already exists...", OW_Flag if (V_Flag) return -1 elseif(stringmatch(OW_Flag,"No")) KillStrings/Z NewModuleName Abort else KillStrings/Z root:Analysis:Modules:$name endif endif print "Stored module call as: "+name MoveString $name, root:Analysis:Modules:$name SetDataFolder root:Analysis:Modules KillStrings/Z NewModuleName PathInfo ModulePath// FROM IGOR PRO HELP... // Warning: If you use the /O flag and if the target already exists, it will be overwritten without any warning. // If you use /O with /D=2, you will completely overwrite the target folder and all of its contents, including subfolders. // Do not use /O with /D unless you are absolutely sure you know what your doing. SaveData /D=1/O/Q/P=ModulePath /L=4 "Analysis" CORD_InitializeModules() CORD_DisplayAnalysisPanel(0) SetDataFolder thisDFEnd//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// PANEL DESCRIPTION/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Window CORD_AnalysisControlPanel() : Panel/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// PauseUpdate; Silent 1 // building the window... variable dispX = str2num(StringFromList(3, StringByKey("SCREEN1", IgorInfo(0)),",")) NewPanel/W=(dispX-350,355,dispX,725)/K=1 as "Corduroy Analysis - Analysis Control"//// DoWindow/C Synaptics// SetDrawLayer ProgBack// Print "Corduroy Analysis Control Panel launched at "+time()+" on "+date() SetDrawLayer UserBack SetDrawEnv fstyle=2// TITLE// SetDrawEnv fname="Lucida Grande", fstyle=0, fsize=18, linefgc=(65278,55512,34438),textrgb=(65278,47802,17219),textxjust=1// DrawText 175,40,". : CORDUROY ANALYSIS : ."// BEGIN DEFINING THE ROI GUIs variable start_y = 30, spacing = 30, index=0, width=80, height=30, left=10, right=(width+20), cursorleft=213, popupleft=287 GroupBox ROI_Group,pos={6,(start_y-25)},size={338,180},font="Verdana",fColor=(60000,20000,40000),fstyle=0,fsize=11,title="ROI Specification",labelBack=(60000,20000,40000) SetVariable ROI1_start,pos={left,(index*spacing)+start_y},size={width,height},title="tstart",font="Verdana", limits={0,Inf,0},value=root:Analysis:Panels:AnalysisPanel:ROI1_tstart, fsize=10 SetVariable ROI1_stop,pos={right,(index*spacing)+start_y},size={width,height},title="tstop",font="Verdana", limits={0,Inf,0},value=root:Analysis:Panels:AnalysisPanel:ROI1_tstop, fsize=10 Button ROI1_cursorB, pos={cursorleft,(index*spacing)+start_y-3}, size={20,20}, proc=CORD_StoreCursorValues, title="C", fsize=10 Button ROI1_zoomB, pos={cursorleft-25,(index*spacing)+start_y-3}, size={20,20}, proc=CORD_DisplayZoom2, title="Z", fsize=10 PopupMenu ROI1_popupA,bodyWidth=100,font="Verdana",proc=CORD_SelectAnalysis,pos={popupleft,(index*spacing)+start_y-3},title="",mode=1,popvalue=root:Analysis:Panels:AnalysisPanel:ROI1_analysis,value=root:Analysis:Panels:AnalysisPanel:AnalysisFunctionList, fsize=10 index+=1 SetVariable ROI2_start,pos={left,(index*spacing)+start_y},size={width,height},title="tstart",font="Verdana", limits={0,Inf,0},value=root:Analysis:Panels:AnalysisPanel:ROI2_tstart, fsize=10 SetVariable ROI2_stop,pos={right,(index*spacing)+start_y},size={width,height},title="tstop",font="Verdana", limits={0,Inf,0},value=root:Analysis:Panels:AnalysisPanel:ROI2_tstop, fsize=10 Button ROI2_cursorB, pos={cursorleft,(index*spacing)+start_y-3}, size={20,20}, proc=CORD_StoreCursorValues, title="C", fsize=10 Button ROI2_zoomB, pos={cursorleft-25,(index*spacing)+start_y-3}, size={20,20}, proc=CORD_DisplayZoom2, title="Z", fsize=10 PopupMenu ROI2_popupA,bodyWidth=100,font="Verdana",proc=CORD_SelectAnalysis,pos={popupleft,(index*spacing)+start_y-3},title="",mode=1,popvalue=root:Analysis:Panels:AnalysisPanel:ROI2_analysis,value=root:Analysis:Panels:AnalysisPanel:AnalysisFunctionList, fsize=10 index+=1 SetVariable ROI3_start,pos={left,(index*spacing)+start_y},size={width,height},title="tstart",font="Verdana", limits={0,Inf,0},value=root:Analysis:Panels:AnalysisPanel:ROI3_tstart, fsize=10 SetVariable ROI3_stop,pos={right,(index*spacing)+start_y},size={width,height},title="tstop",font="Verdana", limits={0,Inf,0},value=root:Analysis:Panels:AnalysisPanel:ROI3_tstop, fsize=10 Button ROI3_cursorB, pos={cursorleft,(index*spacing)+start_y-3}, size={20,20}, proc=CORD_StoreCursorValues, title="C", fsize=10 Button ROI3_zoomB, pos={cursorleft-25,(index*spacing)+start_y-3}, size={20,20}, proc=CORD_DisplayZoom2, title="Z", fsize=10 PopupMenu ROI3_popupA,bodyWidth=100,font="Verdana",proc=CORD_SelectAnalysis,pos={popupleft,(index*spacing)+start_y-3},title="",mode=1,popvalue=root:Analysis:Panels:AnalysisPanel:ROI3_analysis,value=root:Analysis:Panels:AnalysisPanel:AnalysisFunctionList, fsize=10 index+=1 SetVariable ROI4_start,pos={left,(index*spacing)+start_y},size={width,height},title="tstart",font="Verdana", limits={0,Inf,0},value=root:Analysis:Panels:AnalysisPanel:ROI4_tstart, fsize=10 SetVariable ROI4_stop,pos={right,(index*spacing)+start_y},size={width,height},title="tstop",font="Verdana", limits={0,Inf,0},value=root:Analysis:Panels:AnalysisPanel:ROI4_tstop, fsize=10 Button ROI4_cursorB, pos={cursorleft,(index*spacing)+start_y-3}, size={20,20}, proc=CORD_StoreCursorValues, title="C", fsize=10 Button ROI4_zoomB, pos={cursorleft-25,(index*spacing)+start_y-3}, size={20,20}, proc=CORD_DisplayZoom2, title="Z", fsize=10 PopupMenu ROI4_popupA,bodyWidth=100,font="Verdana",proc=CORD_SelectAnalysis,pos={popupleft,(index*spacing)+start_y-3},title="",mode=1,popvalue=root:Analysis:Panels:AnalysisPanel:ROI4_analysis,value=root:Analysis:Panels:AnalysisPanel:AnalysisFunctionList, fsize=10 index+=1 SetVariable ROI5_start,pos={left,(index*spacing)+start_y},size={width,height},title="tstart",font="Verdana", limits={0,Inf,0},value=root:Analysis:Panels:AnalysisPanel:ROI5_tstart, fsize=10 SetVariable ROI5_stop,pos={right,(index*spacing)+start_y},size={width,height},title="tstop",font="Verdana", limits={0,Inf,0},value=root:Analysis:Panels:AnalysisPanel:ROI5_tstop, fsize=10 Button ROI5_cursorB, pos={cursorleft,(index*spacing)+start_y-3}, size={20,20}, proc=CORD_StoreCursorValues, title="C", fsize=10 Button ROI5_zoomB, pos={cursorleft-25,(index*spacing)+start_y-3}, size={20,20}, proc=CORD_DisplayZoom2, title="Z", fsize=10 PopupMenu ROI5_popupA,bodyWidth=100,font="Verdana",proc=CORD_SelectAnalysis,pos={popupleft,(index*spacing)+start_y-3},title="",mode=1,popvalue=root:Analysis:Panels:AnalysisPanel:ROI5_analysis,value=root:Analysis:Panels:AnalysisPanel:AnalysisFunctionList, fsize=10 index+=1 GroupBox TYPE_Group,pos={6,(index*spacing)+start_y+8},size={338,50},font="Verdana",fColor=(20000,60000,40000),fstyle=0,fsize=11,title="CREATE X Wave",labelBack=(20000,60000,40000) index+=1 PopupMenu TYPE_popup,bodyWidth=100,font="Verdana",proc=CORD_SelectExpType,pos={left+55,(index*spacing)+start_y},title="",mode=1,popvalue=root:Analysis:Panels:AnalysisPanel:CurrExperimentType,value=root:Analysis:Panels:AnalysisPanel:ExperimentType, fsize=10 SetVariable TYPE_initial,pos={right+20,(index*spacing)+start_y},size={width-25,height},title="initial",font="Verdana", limits={-Inf,Inf,0},value=root:Analysis:Panels:AnalysisPanel:Initial, fsize=10 SetVariable TYPE_delta,pos={right+90,(index*spacing)+start_y},size={width-25,height},title="delta",font="Verdana", limits={-Inf,Inf,0},value=root:Analysis:Panels:AnalysisPanel:Delta, fsize=10 SetVariable TYPE_repeat,pos={cursorleft+55,(index*spacing)+start_y},size={width-25,height},title="reps",font="Verdana", limits={0,Inf,0},value=root:Analysis:Panels:AnalysisPanel:Repeats, fsize=10 index+=1 Button MAIN_run, pos={cursorleft+5,(index*spacing)+start_y+17}, size={110,20}, proc=CORD_AnalysisPanelButtons, title="RUN" Button MAIN_edit, pos={cursorleft+5,(index*spacing)+start_y+42}, size={110,20}, proc=CORD_AnalysisPanelButtons, title="EDIT" Button MAIN_view, pos={cursorleft+5,(index*spacing)+start_y+67}, size={110,20}, proc=CORD_AnalysisPanelButtons, title="VIEW" Button MAIN_batch, pos={cursorleft+5,(index*spacing)+start_y+92}, size={110,20}, proc=CORD_AnalysisPanelButtons, title="BATCH"GroupBox AMOD_Group,pos={6,(index*spacing)+start_y+2},size={188,110},font="Verdana",fColor=(20000,40000,60000),fstyle=0,fsize=11,title="MODULE Loader",labelBack=(20000,40000,60000) index+=1 PopupMenu AMOD_loadmod,bodyWidth=100,font="Verdana",proc=CORD_SelectAnalysisMod,pos={left+118,(index*spacing)+start_y},title="Module: ",mode=1,popvalue="None",value=root:Analysis:Panels:AnalysisPanel:PreloadAMOD, fsize=10 index+=1 Button AMOD_save, pos={left+10,(index*spacing)+start_y-5}, size={160,20}, proc=CORD_StoreModuleButton, title="save current as...", font="Verdana", fsize=10 index+=1 Button AMOD_combine, pos={left+10,(index*spacing)+start_y-9}, size={160,20}, proc=noproc, title="load existing...", font="Verdana", fsize=10EndMacro///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Window CORD_InfoPanel() : Panel/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// PauseUpdate; Silent 1 // building the window... variable dispX = str2num(StringFromList(3, StringByKey("SCREEN1", IgorInfo(0)),",")) variable dispY = str2num(StringFromList(4, StringByKey("SCREEN1", IgorInfo(0)),",")) NewPanel/W=(10,40,360,dispY-20)/K=1 as "Corduroy Analysis - Experimental Details" SetDrawLayer UserBack SetDrawEnv fstyle=2 variable height1=20, height2=40, height3=40GroupBox XML_Group,pos={6,6},size={338,dispY-60},font="Verdana",fColor=(20000,40000,60000),fstyle=0,fsize=11,title="Extracted XML data",labelBack=(20000,40000,60000) ListBox CatList,frame=2,fsize=10,listWave=root:ExpDetails:ELNlabels,mode=1,pos={15,28},size={155,dispY-90} ListBox ValList,frame=2,fsize=10,listWave=root:ExpDetails:ELNvalues,mode=1,pos={178,28},size={155,dispY-90} EndMacro//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// DEPRECATED//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////function TestSimpleFunc() string s1 string currWave = "LineScanData0_roi1_A_peak" s1 = "CMP_"+StringFromList(1,currWave,"_")+StringFromList(2,currWave,"_")+StringFromList(3,currWave,"_") print s1end///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Function CORD_AnalysisPanelExport()/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// String thisDF = GetDataFolder(1)////// Search for a unique feature of analysis output within the given folder// string AnalysisList = WaveList("*_roi*",";",""), currWave="", fileNameStr=""// variable ListLength = ItemsInList(AnalysisList), index=0// // if(ListLength==0)// Abort "Corduroy cannot find any analysis files to place in a table. Try changing data folders or running analysis."// endif// //// For each folder there should be a corresponding header type text wave that is generated and gives info// WAVE xml_wave = root:ExpDetails:XML_values// fileNameStr = currWave+".crx" // signifies the header text wave that contains info about the data// Save /C /O/P=AnalysisDir xml_wave as fileNameStr// // for(index=0;index<ListLength;index+=1)// currWave = StringFromList(index,AnalysisList)// WAVE local = $currWave//// // For each wave write a binary version of the wave in the exported analysis directory of Corduroy (this will be grabbed and accumulated in Igor Experiments for compiling data)// /////////// SWITCH TO HDF5 /////////////////// fileNameStr = currWave+".crb" // the actual binary data// Save /C /O/P=AnalysisDir local as fileNameStr//// endfor//// SetDataFolder thisDF//End