Differences

This shows you the differences between two versions of the page.

Link to this comparison view

mrtools:scriptinganalyses [2009/07/12 23:15]
127.0.0.1 external edit
mrtools:scriptinganalyses [2009/07/31 06:12] (current)
justin
Line 251: Line 251:
 end end
 </​code>​ </​code>​
 +===== Default Reconcile and Merge Param functions =====
  
-===== Conventions for the parameters ​structure ​=====+The above describes how you write your own reconcile and merge params functions, but sometimes you may just need a bare bones functions that makes sure that your analysis ​structure ​keeps track of any scans that are deleted or added so that your saved analysis will always correctly match the scans in your group. To do that, you can just specify defaultReconcileParams and defaultMergeParams as your reconcile and merge functions. An example can be found either in concatTSeries or eventRelated:​
  
-If you adopt the right convention for your params ​structure then you can simply specify ​'​defaultReconcileParams' ​and '​defaultMergeParams' ​for you reconcile and merge functionsThe convention is...+<​code>​ 
 +erAnal.name = params.saveName;​ 
 +erAnal.type = '​erAnal';​ 
 +erAnal.groupName = params.groupName;​ 
 +erAnal.function = '​eventRelated';​ 
 +erAnal.reconcileFunction = '​defaultReconcileParams'​
 +erAnal.mergeFunction = '​defaultMergeParams'​
 +erAnal.guiFunction = '​eventRelatedGUI';​ 
 +erAnal.params = params; 
 +erAnal.overlays = r2; 
 +erAnal.curOverlay = 1; 
 +erAnal.date = dateString;​ 
 +view = viewSet(view,'​newAnalysis',​erAnal);​ 
 +</​code>​
  
-under construction+Note that your params, should have the following field:
  
 +  params.scanList
 +
 +which contains an array with which scan numbers you have done the analysis over. The defaultReconcileParams function will fill in field that contains the corresponding tseriesFiles which are used for matching the analysis with the current scans (tseriesFilenames are unique, but scan numbers can get changed as you delete and insert scans).
 +
 +If you have created your params using the function [[mrTools:​functionreference#​mrParamsDialog|mrParamsdialog]]
 +then defaultReconcileParams will do some extra validation against the paramsInfo field of params.