Commit 3f70d0d1 authored by Andrew Cohen's avatar Andrew Cohen

Merge branch 'master' of git-bioimage.coe.drexel.edu:bioimage/leverjs

parents 972f7b86 689e8344
......@@ -773,6 +773,13 @@ function getExtFamilies(lDB,fnCallback)
} // getExtFamlies
function featureCompare(a,b)
{
if (a.trackID==b.trackID)
return a.time-b.time;
// else
return a.trackID-b.trackID;
}
// getCellFeatures
// called by getFamiliesDB
......@@ -798,10 +805,10 @@ function getCellFeatures(lDB,rowsTracks,fnCallback)
const LeverDB=require('./lever.js');
var leverDB=new LeverDB();
leverDB.lDB=lDB;
leverDB.getConstants(function(err,cx) {
sqlCmd='select tblCellFeatures.*,time,trackID from tblCellFeatures inner join tblCells on '+
' tblCellFeatures.cellID=tblCells.CellID order by trackID asc';
leverDB.getConstants(function(err,cx) {
sqlCmd='select tblCellFeatures.*,time,trackID from tblCellFeatures inner join tblCells on '+
' tblCellFeatures.cellID=tblCells.CellID where trackID in '+trackIDstr;
lDB.all(sqlCmd,function(err,rowFeatures){
if (err) {
// ok if there's no cellFeatures table...keep going...
......@@ -812,16 +819,18 @@ function getCellFeatures(lDB,rowsTracks,fnCallback)
fnCallback(rowsTracks);
return;
}
rowFeatures.sort(featureCompare);
var cxFeatures=cxGetCellFeatures(cx);
var jFeature=0;
for (var i=0;i<rowsTracks.length;i++) {
rowsTracks[i].features=[];
// rowFeatures is sorted by time and trackID so we don't need to iterate
// over the whole list everytime
for (var j=jFeature;j<rowFeatures.length;j++) {
if (rowFeatures[j].trackID<rowsTracks[i].trackID)
continue;
if (rowFeatures[j].trackID>rowsTracks[i].trackID)
break;
break;
jFeature=j+1;
var cellFeature=[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment