Browse code

deal with empty caltbl close #53

mikejiang authored on 30/04/2019 22:07:09
Showing 1 changed files

... ...
@@ -439,9 +439,16 @@ public:
439 439
 			caltbl.setY(y);
440 440
 			caltbl.setX(x);
441 441
 			unsigned nX = x.size();
442
-			bt->maxValue = caltbl.getX()[nX-1];
443
-			bt->channelRange = caltbl.getY()[nX-1];
442
+			if(nX==0)
443
+			{//assign the default values when caltbl is not present in xml
444
+				bt->maxValue = 262144;
445
+				bt->channelRange = 4096;
444 446
 
447
+			}else
448
+			{
449
+				bt->maxValue = caltbl.getX()[nX-1];
450
+				bt->channelRange = caltbl.getY()[nX-1];
451
+			}
445 452
 			transformation * curTran = bt;
446 453
 			/*
447 454
 			 * sometime, the biexp parameters may not be stored properly