Orientation plot limits
Hi again! Is it possible to adjust the minimum and maximum axis values for the Orientation plot created by motion tracking? We would like to be able to compare results between samples, but keep the same relative X and Y coordinates between samples (to demonstrate that one set of cells is moving far more slowly than another set, and so the tracks are much closer to the origin).
It would be nice if we could force the below to go from -200 to 200 on both axes.
It would be nice if we could force the below to go from -200 to 200 on both axes.
0
Best Answer
-
The orientation plot is auto-scaled to the extends of the existing tracks, so it's not possible to define the axis ranges.
As a workaround, you can add a track that would define the max extends of the displacement.
Here is the macro that will add a new "Ref" track to auto-scale the orientation plot to -200...200 range for X and Y axes:Public Function AddMaxTrack() As SimpleScript AddMaxTrack = New SimpleScript Dim trdoc1, obj1 'define the range of the max displacement Dim r As Double=200 With Application.DocumentCommands.Active(AddMaxTrack) .Run(trdoc1) End With With Measure.TrackingCommands.AddManualTrack(AddMaxTrack) .Points = New System.Collections.Generic.List(Of System.Drawing.PointF) .Points.Add(New System.Drawing.PointF(0,0)) .Points.Add(New System.Drawing.PointF(-r,0)) .Points.Add(New System.Drawing.PointF(-r,-r)) .Points.Add(New System.Drawing.PointF(r,-r)) .Points.Add(New System.Drawing.PointF(r,r)) .Points.Add(New System.Drawing.PointF(-r,r)) .StartFrame = 0 .TrackName = "Ref" .Run(trdoc1, obj1) End With End Function
Yuri0
Answers
Public Function AddMaxTrack() As SimpleScript AddMaxTrack = New SimpleScript Dim trdoc1, obj1 'define the range of the max displacement Dim r As Double=200 With Application.DocumentCommands.Active(AddMaxTrack) .Run(trdoc1) End With With Measure.TrackingCommands.AddManualTrack(AddMaxTrack) .Points = New System.Collections.Generic.List(Of System.Drawing.PointF) .Points.Add(New System.Drawing.PointF(0,0)) .Points.Add(New System.Drawing.PointF(-r,0)) .Points.Add(New System.Drawing.PointF(-r,-r)) .Points.Add(New System.Drawing.PointF(r,-r)) .Points.Add(New System.Drawing.PointF(r,r)) .Points.Add(New System.Drawing.PointF(-r,r)) .StartFrame = 0 .TrackName = "Ref" .Run(trdoc1, obj1) End With With Automate.ScriptingCommands.CodeCommand(AddMaxTrack) If .Run() Then 'set track color obj1.Color=System.Drawing.Color.White End If End With End Function
Yuri