A
![]() NIST Impex SDK Library for Androidâ„¢
When dealing with biometric data its vital that your company can meet the needs of emerging transfer standards,
IDX BioSuite ensures that your companies biometric solutions instantly meets the ANSI/NIST-ITL 1-2000 and ANSI/NIST-ITL 1-2007 and ANSI/NIST-ITL 1-2011 specification,
making your product capable of data impex with other biometric agencies worldwide including the FBI and Interpol.NIST Specifications
Request 30 day FREE SDK Trial
View SDK Price List
Supported Record Types
Integration
Supports the leading development environments.
Comprehensive SDK documentation Bring your application to market faster FREE NIST Viewer
|
Code Examples
Code Example - Opening a NIST file using Java
// file: opennistfile.java
// This file illustrates the use of the IDX NIST Impex API using Java
import com.netxsolutions.idx.impex.NIST;
// ----- Object creation -----
public class opennistfile {
static {
System.loadLibrary("NISTWrapperJava");
}
public static void main(String argv[]) {
System.out.println ("Creating NIST object:");
NIST nist = new NIST();
System.out.println ("Load NIST File");
int ret = nist.LoadNISTFile("..\\Sample Files\\type-4-14-slaps.an2");
if ( ret == 0 ) {
System.out.println ("NIST file successfully opened");
// ----- Output some values from the open NIST file
System.out.println ("Originating Agency: " + nist.GetFieldValueJava(1,8) );
// ----- Perform a check of the TOT type
if (nist.GetFieldValueJava(1,4).equals("AMN")) {
System.out.println ("Yes tot type is AMN");
} else {
System.out.println ("No this is not an AMN record");
}
}else{
System.out.print ("NIST file failed to open, Error: " );
System.out.println (ret);
}
}
}
// ----- Delete everything -----
Code Example - Exporting Records using Java
// file: exportrecords.java
// This file illustrates the use of the IDX NIST Impex API using Java
import com.netxsolutions.idx.impex.NIST;
// ----- Object creation -----
public class exportrecords {
static {
System.loadLibrary("NISTWrapperJava");
}
public static void main(String argv[]) {
System.out.println ("Creating NIST object:");
NIST nist = new NIST();
System.out.println ("Load NIST File");
int ret = nist.LoadNISTFile("..\\Sample Files\\type-4-14-slaps.an2");
if ( ret == 0 ) {
System.out.println ("NIST file successfully opened");
// ----- Export some records from the open NIST file without modification
nist.SaveBinaryImage(4,0,"C:\\IDX - Example Output\\LeftSlap.wsq");
nist.SaveBinaryImage(4,1,"C:\\IDX - Example Output\\RightSlap.wsq");
// ----- Export some records from the open NIST file and convert image format to PNG
nist.SaveBinaryImage(4,0,"C:\\IDX - Example Output\\LeftSlap.png",NIST.OutputFormat.PNG);
nist.SaveBinaryImage(4,1,"C:\\IDX - Example Output\\RightSlap.png",NIST.OutputFormat.PNG);
System.out.println ("Images have been extracted to:");
System.out.println ("C:\\IDX - Example Output\\");
}else{
System.out.print ("NIST file failed to open, Error: " );
System.out.println (ret);
}
}
}
// ----- Delete everything -----
Code Example - Checking License using Java
// file: checkislicensed.java
// This file illustrates the use of the IDX NIST Impex API using Java
import com.netxsolutions.idx.impex.NIST;
// ----- Object creation -----
public class checkislicensed {
static {
System.loadLibrary("NISTWrapperJava");
}
public static void main(String argv[]) {
System.out.println ("Check is licensed:");
NIST nist = new NIST();
// Check the NIST SDK is IsLicensed
boolean isLicensed = nist.IsLicensed();
if ( isLicensed ) {
System.out.println ("IDX NIST Impex is licensed");
}else{
// It's not licensed lets display the reason
int licenseState = nist.GetLicenceState();
System.out.print ("NIST License state: " );
if (licenseState==-9999)
{
System.out.println ("IDX_NO_LICENCE");
}else if (licenseState==-9998)
{
System.out.println ("IDX_TRIAL_LICENCE_EXPIRED");
}else{
System.out.println (licenseState);
}
}
}
}
Code Example - Create NIST file using Java
// file: createnistfile.java
// This file illustrates the use of the IDX NIST Impex API using Java
import com.netxsolutions.idx.impex.NIST;
// ----- Object creation -----
public class createnistfile {
static {
System.loadLibrary("NISTWrapperJava");
}
public static void main(String argv[]) {
System.out.println ("Creating NIST object:");
NIST nist = new NIST();
System.out.println ("Load NIST File");
int ret = nist.NewNIST();
if ( ret == 0 ) {
System.out.println ("New NIST file successfully created");
// ----- Add some biographic data from the open NIST file
nist.AddField(2,31,"John");
nist.AddField(2,32,"Doe");
// ----- Add a Type 10 Facial Image
nist.AddFacialImage("..\\Sample Files\\type10.jpg","F");
// ----- Add a Type 14 Fingerprint Image
nist.AddFingerprintImage("..\\Sample Files\\RightThumb.bmp",NIST.FingerPosition.RIGHT_THUMB , NIST.ImpressionType.NON_LIVE_SCAN_PLAIN);
nist.AddFingerprintImage("..\\Sample Files\\RightIndex.bmp",NIST.FingerPosition.RIGHT_INDEX_FINGER , NIST.ImpressionType.NON_LIVE_SCAN_PLAIN);
nist.AddFingerprintImage("..\\Sample Files\\RightMiddle.bmp",NIST.FingerPosition.RIGHT_MIDDLE_FINGER , NIST.ImpressionType.NON_LIVE_SCAN_PLAIN);
nist.AddFingerprintImage("..\\Sample Files\\LeftAndRightThumbs.bmp",NIST.FingerPosition.LEFT_AND_RIGHT_THUMBS , NIST.ImpressionType.NON_LIVE_SCAN_PLAIN);
// ----- Add a Type 17 left iris image
nist.AddType17Image("..\\Sample Files\\type17.png", NIST.IrisType.LEFT_IRIS);
// Convert Type 4 records to Type 14
nist.IAFIS_To_NIST();
ret = nist.SaveNISTFile("C:\\IDX - Example Output\\NISTwithRAWFiles.nst");
if ( ret == 0) {
System.out.println ( "NIST file successfully created");
}else{
System.out.print ( "NIST file failed to save, Error: ");
System.out.println (ret);
}
}else{
System.out.print ("NIST file failed to create, Error: ");
System.out.println (ret);
}
}
}
Code Example - Create NIST file and Encode WSQ using Java
// file: createwsqandnistfile.java
// This file illustrates the use of the IDX NIST Impex API and WSQ API using Java
import java.io.File;
import java.io.IOException;
import com.netxsolutions.idx.wsq.WSQWrapper;
import com.netxsolutions.idx.impex.NIST;
// ----- Object creation -----
public class createwsqandnistfile {
static {
System.loadLibrary("NISTWrapperJava");
System.loadLibrary("WSQWrapperJava");
}
// Take a BMP fingerprint and encode it to WSQ, the resulting WSQ image is then stored in the NIST file
private static void EncodeAndStore(NIST nist, String filePath, NIST.FingerPosition fingerPosition, NIST.ImpressionType impressionType)
{
try
{
File tempWSQ = File.createTempFile("temp-file-name", ".tmp");
int ret = WSQWrapper.EncodeWSQFile(filePath, tempWSQ.getAbsolutePath(), (float)2.25, 0, 0, "");
System.out.println (tempWSQ.getAbsolutePath());
if (ret==0)
{
nist.AddFingerprintImage(tempWSQ.getAbsolutePath(),fingerPosition , impressionType);
tempWSQ.delete();
}
}catch(IOException e)
{}
}
public static void main(String argv[]) {
System.out.println ("Creating NIST object:");
NIST nist = new NIST();
System.out.println ("Load NIST File");
int ret = nist.NewNIST();
if ( ret == 0 ) {
System.out.println ("New NIST file successfully created");
// ----- Add some biographic data from the open NIST file
nist.AddField(2,31,"John");
nist.AddField(2,32,"Doe");
// ----- Add a Type 10 Facial Image
nist.AddFacialImage("..\\Sample Files\\type10.jpg","F");
// ----- Add a Type 14 Fingerprint Image
EncodeAndStore(nist,"..\\sample files\\RightThumb.bmp",NIST.FingerPosition.RIGHT_THUMB, NIST.ImpressionType.NON_LIVE_SCAN_PLAIN);
EncodeAndStore(nist,"..\\sample files\\RightIndex.bmp",NIST.FingerPosition.RIGHT_INDEX_FINGER, NIST.ImpressionType.NON_LIVE_SCAN_PLAIN);
EncodeAndStore(nist,"..\\sample files\\RightMiddle.bmp",NIST.FingerPosition.RIGHT_MIDDLE_FINGER, NIST.ImpressionType.NON_LIVE_SCAN_PLAIN);
EncodeAndStore(nist,"..\\sample files\\LeftAndRightThumbs.bmp",NIST.FingerPosition.LEFT_AND_RIGHT_THUMBS, NIST.ImpressionType.NON_LIVE_SCAN_PLAIN);
// ----- Add a Type 17 left iris image
nist.AddType17Image("..\\Sample Files\\type17.png", NIST.IrisType.LEFT_IRIS);
// Convert Type 4 records to Type 14
nist.IAFIS_To_NIST();
ret = nist.SaveNISTFile("C:\\IDX - Example Output\\NISTwithWSQFiles.nst");
if ( ret == 0) {
System.out.println ( "NIST file successfully created");
}else{
System.out.print ( "NIST file failed to save, Error: ");
System.out.println (ret);
}
}else{
System.out.print ("NIST file failed to create, Error: ");
System.out.println (ret);
}
}
}
Code Example - Show record information from NIST file using Java
// file: shownistfileinfo.java
// This file illustrates the use of the IDX NIST Impex API using Java
import com.netxsolutions.idx.impex.NIST;
// ----- Object creation -----
public class shownistfileinfo {
static {
System.loadLibrary("NISTWrapperJava");
}
public static void main(String argv[]) {
System.out.println ("Creating NIST object:");
NIST nist = new NIST();
System.out.println ("Load NIST File");
int ret = nist.LoadNISTFile("..\\Sample Files\\type-4-14-slaps.an2");
if ( ret == 0 ) {
System.out.println ("NIST file successfully opened");
// Display count of the different record types contained in this file
for (int recordType=1;recordType<=99; recordType++)
{
int recordCount = nist.GetRecordCount(recordType);
if (recordCount>0)
{
System.out.println ( String.format("Record Type %d has %d records", recordType , recordCount ));
}
}
// Output all the Type 2 fields
for (int fieldNumber=0;fieldNumber<=2000; fieldNumber++)
{
String theValue = nist.GetFieldValueJava(2,fieldNumber);
if(theValue != null && !theValue.isEmpty())
{
System.out.println ( String.format("%d.%03d: %s", 2, fieldNumber , theValue) );
}
}
}else{
System.out.print ("NIST file failed to open, Error: " );
System.out.println (ret);
}
}
}