function saveAsDlibPts(){
    var ptsData;
    if(!imgSelected){
        showSnackBar("This option is applicable on the image loaded in workarea.");
        return;
    }else if(selectedElements.length === 1){
        //TODO: bug element gets unselected when select any tool
        ptsData = toDlibPts( labellingData[ imgSelected ].shapes[ selectedElements[0].id ] );
    }else if(Object.keys(labellingData[imgSelected].shapes).length == 1){
        var shapeId = Object.keys(labellingData[imgSelected].shapes)[0];
        ptsData = toDlibPts( labellingData[imgSelected].shapes[ shapeId ] );
    }else{
        showSnackBar("Please create or select one label.");
        return;
    }

    askFileName(imgSelected+ "_imglab.pts", function(fileName){
        download(ptsData, fileName, "text/plain");
    });
}
/**
 * Save feature point detail of selected label as DLIB supported point file (pts).
 */
Save feature point detail of selected label as DLIB supported point file (pts).
Save feature point detail of selected label as DLIB supported point file ( pts ) .
function saveAsDlibPts(){
    var ptsData;
    if(!imgSelected){
        showSnackBar("This option is applicable on the image loaded in workarea.");
        return;
    }else if(selectedElements.length === 1){
        ptsData = toDlibPts( labellingData[ imgSelected ].shapes[ selectedElements[0].id ] );
    }else if(Object.keys(labellingData[imgSelected].shapes).length == 1){
        var shapeId = Object.keys(labellingData[imgSelected].shapes)[0];
        ptsData = toDlibPts( labellingData[imgSelected].shapes[ shapeId ] );
    }else{
        showSnackBar("Please create or select one label.");
        return;
    }
    askFileName(imgSelected+ "_imglab.pts", function(fileName){
        download(ptsData, fileName, "text/plain");
    });
}
function saveAsDlibPts ( ) { var ptsData ; if ( ! imgSelected ) { showSnackBar ( "This option is applicable on the image loaded in workarea." ) ; return ; } else if ( selectedElements . length === 1 ) { ptsData = toDlibPts ( labellingData [ imgSelected ] . shapes [ selectedElements [ 0 ] . id ] ) ; } else if ( Object . keys ( labellingData [ imgSelected ] . shapes ) . length == 1 ) { var shapeId = Object . keys ( labellingData [ imgSelected ] . shapes ) [ 0 ] ; ptsData = toDlibPts ( labellingData [ imgSelected ] . shapes [ shapeId ] ) ; } else { showSnackBar ( "Please create or select one label." ) ; return ; } askFileName ( imgSelected + "_imglab.pts" , function ( fileName ) { download ( ptsData , fileName , "text/plain" ) ; } ) ; }
Save feature point detail of selected label as DLIB supported point file (pts).
Save feature point detail of selected label as DLIB supported point file ( pts ) .
//TODO: bug element gets unselected when select any tool