Creates an emulated COM object for C3Dserver.
- Syntax:
itf = btkEmulateC3Dserver()
- Return values
-
itf | Matlab structure containing handle to functions. |
- Detailed description:
- Returns a structure which emulates the COM object generated by the function
'actxserver
('C3Dserver.C3D')'. So, it gives the possibility to run scripts which use C3Dserver by using BTK. More details are proposed in this webpage: http://code.google.com/p/b-tk/wiki/C3DServerEmulationForMatlab
The documentation below presents the differences between C3Dserver and the emulation made with BTK.
In some case, BTK did't make the same choice than C3Dserver to extract C3D informations. Then, you will find some slight differences between both:
- This emulation use function handles and then required for every functions to be used with parenthesis (you cannot call 'itf.Close' but 'itf.Close()'). Use parenthesis keep your code compatible with C3Dserver.
- A C3D file is always opened in mode 3.
- The events in BTK use the new format proposed in the C3D documentation (using the group EVENT and EVENT_CONTEXT) which removes the limits of 18 events (and also the possibility to write event's label with more than 4 characters). All the events stored in the C3D header are automatically converted. However, at this moment, the event's status is not kept (can be added if necessary). Then, using the following code with BTK: 'itf.SetEventStatus(0,'0')' sends a warning and do nothing. To remove the warning, you have to add this command: 'warning('OFF','btk:C3Dserver:SetEventStatus')'
- The group and parameter number are generated from the index instead of using the ID stored in the C3D file. Like that, the user doesn't need to manage this number. So, if you set the group or parameter number, a warning will inform you of the impossibility to do it. To remove this warning, type the following command: 'warning('OFF','btk:C3Dserver:UniqueNumber')' Removing this warning has an effect on the functions SetGroupNumber, SetParameterNumber. But also on the function AddGroup when you set manually the number.
- The function 'CompressParameterBlocks' is alway activated in BTK as the group/parameter are regenerated when you write the C3D. Trying to deactivate the compression (by using CompressParameterBlocks(0)) will send a warning. To remove the warning, you have to add the command: 'warning('OFF','btk:C3Dserver:CompressParameterBlocks')'.
- If some groups and parameters has the same name in the C3D file (which is the case with the group PROCESSING and its parameter for C3D files generated with Vicon Nexus 1.4), then BTK remove the duplication (which is not the case of C3Dserver).
- When you delete a group, it is not possible to keep the associated parameters (They are stored in the group). If you try to do it, then a warning will be displayed and the parameters are removed. To remove the warning, use the command: 'warning('OFF','btk:C3Dserver:DeleteGroup')'.
- The parameters are sorted by groups. Then if you select parameter by using hardcoded indices, you could have unexpected results.
- The parameters' values are managed automatically inside BTK. In the case of parameter with the type 'Char', BTK trims (remove leading and trailing white space) values when you open the C3D file. If you set a number in a parameter with the type Char, then the number is converted into a string.
- When you modify the parameter's type, then BTK adapts its values. In lots of conversion you can come back to the original value. However, transforming a string which doesn't contain a number creates the value 0. If you convert a Real into an Integer, you lost the floating information. If you convert an Integer into a Byte and the value is not in the range [-128, 127], then you lost the most significant part of the number. For example, the conversion (Char->Integer) for 'FOO' creates the number 0. But the conversion (Char->Integer) for '1234' creates the number 1234. The conversion (Integer->Byte) for the number 12456 creates the number 168.
- Modifying the parameter's type, adapts also its dimensions. For example, transforming a integer parameter into a char parameter add 1 dimension corresponding to the number of characters. Or, in the other case, transforming a char parameter into an integer, remove.
- Retrieving a parameter in another index than the original will keep the group for this index.
- Trying to retrieve a parameter which has the same name than one in the destination group (other than the original group) will throw an error.
- An AV ratio equal to 0 in BTK is automatically converted to 1. The number of analog frames is at least equal to the number of video frames.
- Starting with BTK 0.2, the camera mask is no longer supported. Trying to extract or set a mask will display a warning. The returned masks from the functions GetPointMask and GetPointMaskEx are fake masks and always set to '0000000'. To remove the warning, you have to add the command: 'warning('OFF','btk:C3Dserver:FakeMask')'.