{Last modified March 7, 2001. Jim Hall These macros were developed specifically to capture images of Xenopus oocytes at a set rate and obtain the cross sectional area of the oocyte during acquisition. The first macro is used to configure the video system and to obtain a threshold value. The second macro captures images at a specified rate and saves them to disk. Analyzes the ROI within the Camera window and pastes the data to a text file. Abort at any time by pressing the cntrl key and the period key simultaneously. 1) Obtain Threshold Value [1]. 2) Save Images to Disk and Obtain Area [2] } var {Global variables} nFrames,n,Left,Top,Width,Height,threshold:integer; interval,EndTicks,secs:integer; basename,dataname:string; FirstTime:boolean; function ControlKeyDown:boolean; Macro 'Obtain Threshold Value [1]'; Begin GetRoi(Left,Top,Width,Height); if width=0 then begin StartCapturing; PutMessage('1. Adjust Video Contols. 2. Select the ROI in the Camera window. 3. Determine threshold value, and remember value for future use 4. Type "1".'); exit; end; dispose; threshold:=GetNumber('Enter Threshold Value Previously Determined',180); PutMessage('Type "2" when specimen is ready for image aquisition and analysis'); ShowMessage('Type "2" to begin image aquisition and analysis'); end; end; Macro 'Serial Capture and Online Analysis [2]'; Begin GetRoi(Left,Top,Width,Height); if width=0 then begin basename:=GetString('Enter Basename','X1019301'); nFrames:=GetNumber('Enter Number of Frames?',20); secs:=GetNumber ('Enter Delay Between Frames (seconds)?',20.0); dataname:=concat(basename,'.dat'); interval:=round(secs*60); NewTextWindow(dataname); StartCapturing; PutMessage('First select the area of interest in the Camera window, then type "2".'); ShowMessage('Outline region of interest, then type "2"'); exit; { "exit" Terminates macro because region of interest is not defined } end; PutMessage('Ready to go!'); FirstTime:=true; for n:=1 to nFrames do begin StopCapturing; SaveAs(basename'.',n:3); if FirstTime then begin EndTicks:=TickCount+interval; FirstTime:=false; end; MakeRoi(Left,Top,Width,Height); OutlineParticles(true); ScaleSelection(0.969,1); IncludeInteriorHoles(true); IgnoreParticlesTouchingEdge(true); { Note if size of oocyte is outside of the specified range, the macro will fail! } SetParticleSize(1000,1000000); SetOptions('Area'); LabelParticles(false); SetThreshold(threshold); AnalyzeParticles; {PutMessage('OK to here!');} ;CopyResults; SelectWindow(dataname); Paste; ResetCounter; SelectWindow('Camera'); if ControlKeyDown then begin StopCapturing; ResetCounter; Dispose; exit; end; StartCapturing; while TickCount