BTK Python wrapper  0.3dev.0
Python bindings for the Biomechanical ToolKit library (BTK)
Public Member Functions | Static Public Attributes | List of all members
btk.btkMergeAcquisitionFilter Class Reference

Merges or concatenates two or more btk::Acquisition objects into a single new one. More...

Public Member Functions

def GetFirstFrameRule
 
def GetInput
 
def GetInputNumber
 
def GetOutput
 
def GetOutputNumber
 
def GetTimestamp
 
def GetValidInputNumber
 
def ResetState
 
def SetFirstFrameRule
 
def SetInput
 
def Update
 

Static Public Attributes

 KeepAllFrames = _btk.btkMergeAcquisitionFilter_KeepAllFrames
 
 KeepFromHighestFirstFrame = _btk.btkMergeAcquisitionFilter_KeepFromHighestFirstFrame
 

Detailed Description

Merges or concatenates two or more btk::Acquisition objects into a single new one.

Merges or concatenates two or more btkAcquisition objects into a single new one.

The difference between the merging or the concatenating depends of the acquisitions' informations.

If the acquisitions are exactly the same (same label for points and analog channels) and the first 
frame of the n+1th acquisition corresponds to the last frame of the nth acquisition, then the 
acquisitions are merged, otherwise, the data are concatenated. Merged acquisitions means that the 
output will have the same number of points, analog channels, events than each output but the number
of frames corresponds to the sum of the input's frame number. 

Rules to merge/concatenate acquisitions are:
 - Must have the same acquisition frequency (or 0).
 - Must have the same number of analog samples per point frame (if there are points and analog channels).
 - Must have the same analog resolution.
 - Must have the same units (Use btkAcquisitionUnitConvert to convert them).
 - Must have the same global frame orientation (check POINT:X_SCREEN and POINT:Y_SCREEN)
 - The first input which has a non-zero acquisition frequency is used.
 - The first input which has analog channels is used to set the analog resolution of the output.

Actions during the merging/concatenation:
 - If the first frame of the nth acquisition correspond to the last frame + 1 of the nth-1 acquisition, 
   AND the points / analog channels correspond exactly, then acquisitions are truncated.
 - If the first frame of two inputs are not the same, the final acquisition is adapted to contain the number of frames plus
   the difference between the first frame of each input.
 - If points have the same label (and the first frames doesn't correspond), then, the second and more are incremented (i.e. from Heel to Heel_2).
 - Idem for the analog channels.
 - Events with the same label, context, id and time are merged.
 - Metadata (if number of inputs greater than 1):
    - Only metadata defined by the user are inserted (i.e. POINT, ANALOG, EVENTS, etc. are not inserted as they are only used in a C3D file.).
    - If metadata are equivalent or equal, then they are merged, else the metadata is appended with a suffix
      (i.e. from STATIC_CALIBRATION:USED to STATIC_CALIBRATION:USED_2)

Moreover, you can set a rule to keep only the data from the higher or the lower first frame.
Use the method SetFirstFrameRule() with the values KeepAllFrames or KeepFromHighestFirstFrame.

Member Function Documentation

def btk.btkMergeAcquisitionFilter.GetFirstFrameRule (   self )
GetFirstFrameRule(self) -> int

Sets the rule for the first frame kept. Two rules are available:
 - KeepAllFrames: Use the lower first frame;
 - KeepFromHighestFirstFrame: Use the higher first frame.
def btk.btkMergeAcquisitionFilter.GetInput (   self,   args  )
GetInput(self, int) -> btkAcquisition

Gets the input registered with this process.
def btk.btkMergeAcquisitionFilter.GetInputNumber (   self )
GetInputNumber(self) -> int

Returns the number of inputs.
def btk.btkMergeAcquisitionFilter.GetOutput (   self )
GetOutput(self) -> btkAcquisition

Returns the output created with this process.
def btk.btkMergeAcquisitionFilter.GetOutputNumber (   self )
GetOutputNumber(self) -> int

Returns the number of outputs.
def btk.btkMergeAcquisitionFilter.GetTimestamp (   self )
GetTimestamp(self) -> unsigned long

Returns the timestamp of the object.
def btk.btkMergeAcquisitionFilter.GetValidInputNumber (   self )
GetValidInputNumber(self) -> int

Returns the number of inputs which are valid (i.e. not null).
def btk.btkMergeAcquisitionFilter.ResetState (   self )
ResetState(self)

Reset the state of the process. Usefull when an exception was thrown during the generation of the data.
def btk.btkMergeAcquisitionFilter.SetFirstFrameRule (   self,   args  )
SetFirstFrameRule(self, int)

Returns the rule for the first frame kept.
def btk.btkMergeAcquisitionFilter.SetInput (   self,   args  )
SetInput(self, int, btkAcquisition)

Sets the input required with this process.
def btk.btkMergeAcquisitionFilter.Update (   self )
Update(self)

Update the pipeline and then all the data inside. Recursive method which
 1) determines the processes to update
 2) generate the data by using the GenerateData() method.

Member Data Documentation

btk.btkMergeAcquisitionFilter.KeepAllFrames = _btk.btkMergeAcquisitionFilter_KeepAllFrames
static

Option to keep all the frames of the given acquisitions during the merging process

btk.btkMergeAcquisitionFilter.KeepFromHighestFirstFrame = _btk.btkMergeAcquisitionFilter_KeepFromHighestFirstFrame
static

Option to keep only the frames starting from the highest first frame extracted from the given acquisitions.