| Sub AOI_time_density '<c>2 ret = IpTemplateMode(1) 'Switch template mode on ret = IpAoiShow(FRAME_RECTANGLE) 'Show Rectangular AOI tool ret = IpAoiMove(0, 0) 'Dummy operator to activate template mode for AOI selection ret = IpTemplateMode(0) 'Switch template mode off Dim numfr As Long ret=IpSeqGet(SEQ_NUMFRAMES,numfr)'Get number of frames in sequence If numfr = 1 Then ret = IpMacroStop("Not a sequence image", 0) Exit Sub End If ret = IpSeqPlay(SEQ_FFRA) 'Go to the first frame Dim i As Integer 'Definition of as loop variable Dim hstID As Integer 'Define a variable for Histogram ID hstID = IpHstCreate() 'Create a Histogram window ret = IpHstSetAttr(STATISTICS, 1) 'Set attribute to show statistics in Histogram window ret = IpHstSetAttr(ICAL, 1) 'Set attribute to use intensity calibration for the histogram ReDim stats(10) As Single Dim Mean As Single 'Define array for Histogram statistics ReDim profdat(numfr+1) As Single 'Allocate array for the data For i=0 To numfr-1 ret = IpHstGet(GETSTATS, 0, stats(0)) 'Get Statistical data out of Histogram Mean = stats(0) 'Stats(0) is mean value of Histogram ProfDat(i)=Mean 'Save Mean to the data array ret = IpSeqPlay(SEQ_NEXT) 'Go to the next frame Next i ret=IpHstDestroy() 'Destroy the Histogram Dim plot As Integer 'Define variable for plot ID plot = IpPlotCreate("Mean intensities' graph")'Create new plot window 'Set plot parameters: Style, X and Y labels ret = IpPlotSet(plot,"Line, x label=Frames, y label=Intensity") 'Set the data to plot ret = IpPlotData (plot,1,PDT_FLOAT,profdat(0),i) ret = IpPlotShow(plot,1) 'Show the plot ret = IpAppMenuSelect(0, 7, "", DLG_MENU_COORD)' Send data to Excel ret = IpSeqSet(SEQ_ACTIVEFRAME, 0) End Sub 'End of the macro |