NifTK
16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
|
These functions are used to retrieve information that has been stored in the ndicapi object. None of these functions communicate with the device itself, and none of them cause the error indicator to be set.
The DeviceName and DeviceHandle are set when the device is first opened by ndiOpen().
All other information is set by sending the appropriate command to the device through ndiCommand() or through one of the command macros. The information persists until the next time the command is sent.
For example, if the TX command is sent to the device then the information returned by the methods that start with GetTX will be set and will subsequently remain unchanged until the next TX command is sent.
These functions are used to retrieve information that has been stored in the polaris object. None of these functions communicate with the POLARIS itself, and none of them cause the error indicator to be set.
The DeviceName and DeviceHandle are set when the device is first opened by plOpen().
All other information is set by sending the appropriate command to the POLARIS through plCommand() or through one of the command macros. The information persists until the next time the command is sent.
For example, if the PSTAT command is sent to the POLARIS then the information returned by the methods that start with GetPSTAT will be set and will subsequently remain unchanged until the next PSTAT command is sent.
NDIFileHandle ndiGetDeviceHandle | ( | ndicapi * | pol | ) |
Get the device handle for the serial port that the device is attached to. This device handle is the value returned by the UNIX open() function or the Win32 CreateFile() function.
char* ndiGetDeviceName | ( | ndicapi * | pol | ) |
Get the name of the serial port device that the device is attached to.
Get error code from the last command. An error code of NDI_OKAY signals that no error occurred. The error codes are listed in Error Codes.
NDIErrorCallback ndiGetErrorCallback | ( | ndicapi * | pol | ) |
Get the current error callback function, or NULL if there is none.
Get the current error callback data, or NULL if there is none.
Get the camera frame number for the latest transform.
pol | valid NDI device handle |
port | one of '1', '2', '3' (active ports only) |
The frame number is only updated when the GX command is called with the NDI_FRAME_NUMBER (0x0008) bit, and then only for the ports specified by the NDI_PASSIVE (0x8000) and NDI_PASSIVE_EXTRA (0x2000) bits.
Get additional information about the tool markers.
pol | valid NDI device handle |
port | one of '1', '2', '3' or 'A' to 'I' |
marker | one of 'A' through 'T' for the 20 markers |
The tool marker information is only updated when the GX command is called with the NDI_ADDITIONAL_INFO (0x0002) mode bit set, and then only for the ports specified by the NDI_PASSIVE (0x8000) and NDI_PASSIVE_EXTRA (0x2000) bits.
Get the number of passive stray markers detected.
pol | valid NDI device handle |
The passive stray information is updated when a GX command is sent with the NDI_PASSIVE_STRAY (0x1000) and NDI_PASSIVE (0x8000) bits set in the reply mode. The information persists until the next time GX is sent with these bits set.
If no information is available, the return value is zero.
Copy the coordinates of the specified stray marker into the supplied array.
pol | valid NDI device handle |
i | a number between 0 and 19 |
coord | array to hold the coordinates |
Use ndiGetGXNumberOfPassiveStrays() to get the number of stray markers that are visible.
The passive stray marker coordinates are updated when a GX command is sent with the NDI_PASSIVE_STRAY (0x1000) and NDI_PASSIVE (0x8000) bits set in the reply mode. The information persists until the next time GX is sent with these bits set.
Get the 8-bit status value for the specified port.
pol | valid NDI device handle |
port | one of '1', '2', '3' or 'A' to 'I' |
The status of the ports is updated according to the same rules as specified for ndiGetGXTransform().
Get the coordinates of a stray marker on an active tool. This command is only meaningful for active tools that have a stray marker.
pol | valid NDI device handle |
port | one of '1', '2', '3' |
coord | array to hold the three coordinates |
The stray marker position is only updated when the GX command is called with the NDI_SINGLE_STRAY (0x0004) bit set.
Get an 8-bit status bitfield for the system.
pol | valid NDI device handle |
The system stutus information is updated whenever the GX command is called with the NDI_XFORMS_AND_STATUS (0x0001) bit set in the reply mode.
Get additional information about the tool transformation.
pol | valid NDI device handle |
port | one of '1', '2', '3' or 'A' to 'I' |
The tool information is only updated when the GX command is called with the NDI_ADDITIONAL_INFO (0x0002) mode bit, and then only for the ports specified by the NDI_PASSIVE (0x8000) and NDI_PASSIVE_EXTRA (0x2000) bits.
Get the transformation for the specified port. The first four numbers are a quaternion, the next three numbers are the coodinates in millimetres, and the final number is a unitless error estimate.
pol | valid NDI device handle |
port | one of '1', '2', '3' or 'A' to 'I' |
transform | space for the 8 numbers in the transformation |
If NDI_DISABLED or NDI_MISSING is returned, then the values in the supplied transform array will be left unchanged.
The transforms for ports '1', '2', '3' are updated whenever the GX comand is sent with the NDI_XFORMS_AND_STATUS (0x0001) bit set in the reply mode. The passive ports 'A', 'B', 'C' are updated if the NDI_PASSIVE (0x8000) bit is also set, and ports 'A' though 'I' are updated if both NDI_PASSIVE (0x8000) and NDI_PASSIVE_EXTRA (0x2000) are also set.
The transformation for any particular port will remain unchanged until it is updated by a GX command with an appropriate reply mode as specified above.
Check to see whether environmental infrared was detected.
pol | valid NDI device handle |
This information is only updated if the IRCHK command is called with the NDI_DETECTED (0x0001) format bit set.
Get the number of infrared sources seen by one of the two sensors.
pol | valid NDI device handle |
side | one of NDI_LEFT or NDI_RIGHT |
return the number of infrared sources seen by the specified sensor
This information is valid only immediately after the IRCHK command has been called with the NDI_SOURCES (0x0002) format bit set. Otherwise, the return value will be zero.
Get the coordinates of one of the infrared sources seen by one of the two sensors.
pol | valid NDI device handle |
side | one of NDI_LEFT or NDI_RIGHT |
xy | space to store the returned coordinates |
return NDI_OKAY or NDI_MISSING
If there is no available information, then the xy array will be left unchanged and the value NDI_MISSING will be returned. Otherwise, the return value will be NDI_OKAY.
This information is valid only immediately after the IRCHK command has been called with the NDI_SOURCES (0x0002) format bit set.
Get the 8-bit value specifying the tool accessories.
pol | valid NDI device handle |
If there is no available information for the specified port, or if an illegal port specifier value is used, the return value is zero.
The return value is updated only when a PHINF command is sent with the NDI_ACCESSORIES (0x0008) bit set in the reply mode.
unsigned long ndiGetPHINFCurrentTest | ( | ndicapi * | pol | ) |
Return the results of a current test on the IREDS on an active POLARIS tool.
ts | valid NDI device handle |
The information is updated only when a PHINF command is sent with the NDI_TESTING (0x0002) bit set in the reply mode.
Get the 8-bit GPIO status for this tool.
pol | valid NDI device handle |
The return value is updated only when a PHINF command is sent with the NDI_GPIO_STATUS (0x0040) bit set in the reply mode.
Get an 8-bit value describing the marker type for the tool. The low three bits descibe the wavelength, and the high three bits are the marker type code.
pol | valid NDI device handle |
The return value is updated only when a PHINF command is sent with the NDI_MARKER_TYPE (0x0010) bit set in the reply mode.
Get a 20-byte string that contains the part number of the tool.
pol | valid NDI device handle |
part | array that part number is returned in (the resulting string is not null-terminated) |
If a terminated string is required, then set part[20] to '\0' before calling this function.
The information is updated only when a PHINF command is sent with the NDI_PART_NUMBER (0x0004) bit set in the reply mode.
Get a 14-byte description of the physical location of the tool on the system.
pol | valid NDI device handle |
The return value is updated only when a PHINF command is sent with the NDI_PORT_LOCATION_TYPE (0x0020) bit set in the reply mode.
Get the 8-bit status value for the port handle.
pol | valid NDI device handle |
The return value is updated only when a PHINF command is sent with the NDI_BASIC (0x0001) bit set in the reply mode.
Get a 31-byte string describing the tool.
piol | valid NDI device handle |
information | array that information is returned in (the resulting string is not null-terminated) |
The returned string will not be null-terminated by default. You must set information[31] to 0 in order to terminate the string. If the port is unoccupied then the contents of the information string are undefined.
The information is updated only when a PHINF command is sent with the NDI_BASIC (0x0001) bit set in the reply mode.
Get the port handle returned by a PHRQ command.
pol | valid NDI device handle |
An SROM can be written to the port handle wit the PVWR command.
Get one of the port handles returned by a PHSR command.
pol | valid NDI device handle |
i | a value between 0 and n where is the value returned by ndiGetPHSRNumberOfHandles(). |
The PHINF command can be used to get detailed information about the port handle.
Get the information for a port handle returned by a PHSR command.
pol | valid NDI device handle |
i | a value between 0 and n where is the value returned by ndiGetPHSRNumberOfHandles(). |
The PHINF command can be used to get detailed information about the port handle.
Get the number of port handles as returned by a PHSR command.
pol | valid NDI device handle |
Get the 8-bit value specifying the accessories for the specified tool.
pol | valid NDI device handle |
port | one of '1', '2', '3' (active ports only) |
If there is no available information for the specified port, or if an illegal port specifier value is used, the return value is zero. The return value is always zero for passive ports.
The return value is updated only when a PSTAT command is sent with the NDI_ACCESSORIES (0x0008) bit set in the reply mode.
Return the results of a current test on the IREDS on the specified tool.
ts | valid NDI device handle |
port | one of '1', '2', '3' |
The information is updated only when a PSTAT command is sent with the NDI_TESTING (0x0002) bit set in the reply mode.
Get an 8-bit value describing the marker type for the tool. The low three bits descibe the wavelength, and the high three bits are the marker type code.
pol | valid NDI device handle |
port | one of '1', '2', '3' (active ports only) |
If there is no available information for the specified port, or if an illegal port specifier value is used, the return value is zero.
The return value is updated only when a PSTAT command is sent with the NDI_MARKER_TYPE (0x0010) bit set in the reply mode.
Get a 20-byte string that contains the part number of the tool.
pol | valid NDI device handle |
port | one of '1', '2', '3' or 'A' to 'I' |
part | array that part number is returned in (the resulting string is not null-terminated) |
If a terminated string is required, then set part[20] to '\0' before calling this function.
The information is updated only when a PSTAT command is sent with the NDI_PART_NUMBER (0x0004) bit set in the reply mode.
Get the 8-bit status value for the specified port.
pol | valid NDI device handle |
port | one of '1', '2', '3' or 'A' to 'I' |
If there is no available information for the specified port, or if an illegal port specifier value is used, the return value is zero. The return value is updated only when a PSTAT command is sent with the NDI_BASIC (0x0001) bit set in the reply mode.
Get a 30-byte string describing the tool in the specified port.
pol | valid NDI device handle |
port | one of '1', '2', '3' or 'A' to 'I' |
information | array that information is returned in (the resulting string is not null-terminated) |
The returned string will not be null-terminated by default. You must set information[30] to 0 in order to terminate the string. If the port is unoccupied then the contents of the information string are undefined.
The information is updated only when a PSTAT command is sent with the NDI_BASIC (0x0001) bit set in the reply mode.
Get the status of the control processor.
pol | valid NDI device handle |
This information is updated only when the SSTAT command is sent with the NDI_CONTROL (0x0001) bit set in the reply mode.
Get the status of the sensor processors.
pol | valid NDI device handle |
This information is updated only when the SSTAT command is sent with the NDI_SENSORS (0x0002) bit set in the reply mode.
Get the status of the sensor processors.
pol | valid NDI device handle |
This information is updated only when the SSTAT command is sent with the NDI_TIU (0x0004) bit set in the reply mode.
Check the current theading mode. The default is 0 (no multithreading).
Get the camera frame number for the latest transform.
pol | valid NDI device handle |
ph | valid port handle in range 0x01 to 0xFF |
This information is updated each time that the TX command is sent to the device.
Get additional information about the tool markers.
pol | valid NDI device handle |
ph | valid port handle in range 0x01 to 0xFF |
marker | one of 'A' through 'T' for the 20 markers |
The tool marker information is only updated when the TX command is called with the NDI_ADDITIONAL_INFO (0x0002) mode bit set.
Get the number of passive stray markers detected.
pol | valid NDI device handle |
The passive stray marker coordinates are updated when a TX command is sent with the NDI_PASSIVE_STRAY (0x1000) bit set in the reply mode.
Copy the coordinates of the specified stray marker into the supplied array.
pol | valid NDI device handle |
i | a number between 0 and 19 |
coord | array to hold the coordinates |
Use ndiGetTXNumberOfPassiveStrays() to get the number of stray markers that are visible.
The passive stray marker coordinates are updated when a TX command is sent with the NDI_PASSIVE_STRAY (0x1000) bit set in the reply mode.
Get the 16-bit status value for the specified port handle.
pol | valid NDI device handle |
ph | valid port handle in range 0x01 to 0xFF |
This information is updated each time that the TX command is sent to the device.
Get the coordinates of a stray marker on a wired POLARIS tool. This command is only meaningful for tools that have a stray marker.
pol | valid NDI device handle |
ph | valid port handle in range 0x01 to 0xFF |
coord | array to hold the three coordinates |
The stray marker position is only updated when the GX command is called with the NDI_SINGLE_STRAY (0x0004) bit set.
Get an 16-bit status bitfield for the system.
pol | valid NDI device handle |
The system stutus information is updated whenever the TX command is called with the NDI_XFORMS_AND_STATUS (0x0001) bit set in the reply mode.
Get additional information about the tool transformation.
pol | valid NDI device handle |
ph | valid port handle in range 0x01 to 0xFF |
The tool information is only updated when the TX command is called with the NDI_ADDITIONAL_INFO (0x0002) mode bit.
Get the transformation for the specified port. The first four numbers are a quaternion, the next three numbers are the coodinates in millimetres, and the final number is a unitless error estimate.
pol | valid NDI device handle |
ph | valid port handle in range 0x01 to 0xFF |
transform | space for the 8 numbers in the transformation |
If NDI_DISABLED or NDI_MISSING is returned, then the values in the supplied transform array will be left unchanged.
The transformations for each of the port handles remain the same until the next TX command is sent to device.
|
static |
Get the device handle for the serial port that the POLARIS is attached to. This device handle is the value returned by the UNIX open() function or the Win32 CreateFile() function.
|
static |
Get the name of the serial port device that the POLARIS is attached to.
Get error code from the last command. An error code of PL_OKAY signals that no error occurred. The error codes are listed in Error Codes.
Get the camera frame number for the latest transform.
pol | pointer to a valid polaris object |
port | one of '1', '2', '3' (active ports only) |
The frame number is only updated when the GX command is called with the PL_FRAME_NUMBER (0x0008) bit, and then only for the ports specified by the PL_PASSIVE (0x8000) and PL_PASSIVE_EXTRA (0x2000) bits.
Get additional information about the tool markers.
pol | pointer to a valid polaris object |
port | one of '1', '2', '3' or 'A' to 'I' |
marker | one of 'A' through 'T' for the 20 markers |
The tool marker information is only updated when the GX command is called with the PL_ADDITIONAL_INFO (0x0002) mode bit set, and then only for the ports specified by the PL_PASSIVE (0x8000) and PL_PASSIVE_EXTRA (0x2000) bits.
Get the number of passive stray markers detected.
pol | pointer to a valid polaris object |
The passive stray information is updated when a GX command is sent with the PL_PASSIVE_STRAY (0x1000) and PL_PASSIVE (0x8000) bits set in the reply mode. The information persists until the next time GX is sent with these bits set.
If no information is available, the return value is zero.
Copy the coordinates of the specified stray marker into the supplied array.
pol | pointer to a valid polaris object |
i | a number between 0 and 19 |
coord | array to hold the coordinates |
Use plGetGXNumberOfPassiveStrays() to get the number of stray markers that are visible.
The passive stray marker coordinates are updated when a GX command is sent with the PL_PASSIVE_STRAY (0x1000) and PL_PASSIVE (0x8000) bits set in the reply mode. The information persists until the next time GX is sent with these bits set.
Get the 8-bit status value for the specified port.
pol | pointer to a valid polaris object |
port | one of '1', '2', '3' or 'A' to 'I' |
The status of the ports is updated according to the same rules as specified for plGetGXTransform().
Get the coordinates of a stray marker on an active tool. This command is only meaningful for active tools that have a stray marker.
pol | pointer to a valid polaris object |
port | one of '1', '2', '3' |
coord | array to hold the three coordinates |
The stray marker position is only updated when the GX command is called with the PL_SINGLE_STRAY (0x0004) bit set.
Get an 8-bit status bitfield for the system.
pol | pointer to a valid polaris object |
The system stutus information is updated whenever the GX command is called with the PL_XFORMS_AND_STATUS (0x0001) bit set in the reply mode.
Get additional information about the tool transformation.
pol | pointer to a valid polaris object |
port | one of '1', '2', '3' or 'A' to 'I' |
The tool information is only updated when the GX command is called with the PL_ADDITIONAL_INFO (0x0002) mode bit, and then only for the ports specified by the PL_PASSIVE (0x8000) and PL_PASSIVE_EXTRA (0x2000) bits.
Get the transformation for the specified port. The first four numbers are a quaternion, the next three numbers are the coodinates in millimetres, and the final number is a unitless error estimate.
pol | pointer to a valid polaris object |
port | one of '1', '2', '3' or 'A' to 'I' |
transform | space for the 8 numbers in the transformation |
If PL_DISABLED or PL_MISSING is returned, then the values in the supplied transform array will be left unchanged.
The transforms for ports '1', '2', '3' are updated whenever the GX comand is sent with the PL_XFORMS_AND_STATUS (0x0001) bit set in the reply mode. The passive ports 'A', 'B', 'C' are updated if the PL_PASSIVE (0x8000) bit is also set, and ports 'A' though 'I' are updated if both PL_PASSIVE (0x8000) and PL_PASSIVE_EXTRA (0x2000) are also set.
The transformation for any particular port will remain unchanged until it is updated by a GX command with an appropriate reply mode as specified above.
Check to see whether environmental infrared was detected.
pol | pointer to a valid polaris object |
This information is only updated if the IRCHK command is called with the PL_DETECTED (0x0001) format bit set.
Get the number of infrared sources seen by one of the two sensors.
pol | pointer to a valid polaris object |
side | one of PL_LEFT or PL_RIGHT |
return the number of infrared sources seen by the specified sensor
This information is valid only immediately after the IRCHK command has been called with the PL_SOURCES (0x0002) format bit set. Otherwise, the return value will be zero.
Get the coordinates of one of the infrared sources seen by one of the two sensors.
pol | pointer to a valid polaris object |
side | one of PL_LEFT or PL_RIGHT |
xy | space to store the returned coordinates |
return PL_OKAY or PL_MISSING
If there is no available information, then the xy array will be left unchanged and the value PL_MISSING will be returned. Otherwise, the return value will be PL_OKAY.
This information is valid only immediately after the IRCHK command has been called with the PL_SOURCES (0x0002) format bit set.
Get the 8-bit value specifying the accessories for the specified tool.
pol | pointer to a valid polaris object |
port | one of '1', '2', '3' (active ports only) |
If there is no available information for the specified port, or if an illegal port specifier value is used, the return value is zero. The return value is always zero for passive ports.
The return value is updated only when a PSTAT command is sent with the PL_ACCESSORIES (0x0008) bit set in the reply mode.
Return the results of a current test on the IREDS on the specified tool.
pol | pointer to a valid polaris object |
port | one of '1', '2', '3' |
The information is updated only when a PSTAT command is sent with the PL_TESTING (0x0002) bit set in the reply mode.
Get an 8-bit value describing the marker type for the tool. The low three bits descibe the wavelength, and the high three bits are the marker type code.
pol | pointer to a valid polaris object |
port | one of '1', '2', '3' (active ports only) |
If there is no available information for the specified port, or if an illegal port specifier value is used, the return value is zero.
The return value is updated only when a PSTAT command is sent with the PL_MARKER_TYPE (0x0010) bit set in the reply mode.
Get a 20-byte string that contains the part number of the tool.
pol | pointer to a valid polaris object |
port | one of '1', '2', '3' or 'A' to 'I' |
part | array that part number is returned in (the resulting string is not null-terminated) |
If a terminated string is required, then set part[20] to '\0' before calling this function.
The information is updated only when a PSTAT command is sent with the PL_PART_NUMBER (0x0004) bit set in the reply mode.
Get the 8-bit status value for the specified port.
pol | pointer to a valid polaris object |
port | one of '1', '2', '3' or 'A' to 'I' |
If there is no available information for the specified port, or if an illegal port specifier value is used, the return value is zero. The return value is updated only when a PSTAT command is sent with the PL_BASIC (0x0001) bit set in the reply mode.
Get a 30-byte string describing the tool in the specified port.
pol | pointer to a valid polaris object |
port | one of '1', '2', '3' or 'A' to 'I' |
information | array that information is returned in (the resulting string is not null-terminated) |
The returned string will not be null-terminated by default. You must set information[30] to 0 in order to terminate the string. If the port is unoccupied then the information string will read "UNOCCUPIED".
The information is updated only when a PSTAT command is sent with the PL_BASIC (0x0001) bit set in the reply mode.
Get the status of the control processor.
pol | pointer to a valid polaris object |
This information is updated only when the SSTAT command is sent with the PL_CONTROL (0x0001) bit set in the reply mode.
Get the status of the sensor processors.
pol | pointer to a valid polaris object |
This information is updated only when the SSTAT command is sent with the PL_SENSORS (0x0002) bit set in the reply mode.
Get the status of the sensor processors.
pol | pointer to a valid polaris object |
This information is updated only when the SSTAT command is sent with the PL_TIU (0x0004) bit set in the reply mode.