Changeset 7989
- Timestamp:
- 04/19/12 10:38:34 (8 years ago)
- Location:
- trunk/projects/slim-plugin/src/main/java/loci/slim
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/projects/slim-plugin/src/main/java/loci/slim/SLIMProcessor.java
r7970 r7989 400 400 401 401 double chiSqTarget = m_uiPanel.getChiSquareTarget(); 402 // System.out.println("prompt is " + prompt + " and fitting cursor thinks prompt " + _fittingCursor.getHasPrompt()); 402 403 if (null != prompt && _fittingCursor.getHasPrompt()) { 403 404 double[] results = CursorEstimator.estimateCursors … … 573 574 private boolean updateExcitation(IUserInterfacePanel uiPanel, Excitation excitation) { 574 575 boolean success = false; 575 System.out.println("###update excitation " + excitation);576 // System.out.println("###update excitation " + excitation); 576 577 if (null != excitation) { 577 578 if (null != m_excitationPanel) { … … 643 644 m_path = dialog.getDirectory(); 644 645 m_file = dialog.getFileName(); 645 System.out.println("directory is " + dialog.getDirectory());646 System.out.println("file is " + dialog.getFileName());646 // System.out.println("directory is " + dialog.getDirectory()); 647 // System.out.println("file is " + dialog.getFileName()); 647 648 return true; 648 649 } … … 1266 1267 m_startBin = fittingCursor.getDataStartBin(); 1267 1268 m_stopBin = fittingCursor.getTransientStopBin(); 1268 System.out.println("m_startBin is " + m_startBin + " m_stopBin " + m_stopBin); 1269 System.out.println("_fittingCursor " + _fittingCursor.getTransientStartValue() + " " + _fittingCursor.getTransientStartBin() + " " + _fittingCursor.getTransientStopValue()); 1269 // System.out.println("m_startBin is " + m_startBin + " m_stopBin " + m_stopBin); 1270 // System.out.println("FYI FWIW prompt delay is " + _fittingCursor.getPromptDelay()); 1271 // System.out.println("prompt start is " + _fittingCursor.getPromptStartValue() + " stop " + _fittingCursor.getPromptStopValue()); 1272 // System.out.println("_fittingCursor start value " + _fittingCursor.getTransientStartValue() + " bin " + _fittingCursor.getTransientStartBin() + " stop value " + _fittingCursor.getTransientStopValue() + " bin " + _fittingCursor.getTransientStopBin()); 1270 1273 return fitPixel(uiPanel, x, y); 1271 1274 } … … 1300 1303 photons += yCount[c]; 1301 1304 } 1302 System.out.println("PHOTONS " + photons);1305 // System.out.println("PHOTONS " + photons); 1303 1306 1304 1307 curveFitData.setYCount(yCount); … … 1309 1312 curveFitData.setDataStartIndex(dataStartIndex); 1310 1313 curveFitData.setTransEndIndex(transStopIndex); 1311 System.out.println("uiPanel.getFunction is " + uiPanel.getAlgorithm() + " SLIMCURVE_RLD_LMA is " + FitAlgorithm.SLIMCURVE_RLD_LMA);1314 // System.out.println("uiPanel.getFunction is " + uiPanel.getAlgorithm() + " SLIMCURVE_RLD_LMA is " + FitAlgorithm.SLIMCURVE_RLD_LMA); 1312 1315 1313 1316 yFitted = new double[m_bins]; … … 1329 1332 1330 1333 // show decay graph for visible channel 1331 String title = " Pixel " + x + " " + y;1334 String title = "Fitted Pixel " + x + " " + y; 1332 1335 if (1 < m_channels) { 1333 1336 title += " Channel " + (m_channel + 1); … … 1457 1460 Image<DoubleType> image = null; 1458 1461 1459 System.out.println("channels width height params " + channels + " " + width + " " + height + " " + parameters);1462 // System.out.println("channels width height params " + channels + " " + width + " " + height + " " + parameters); 1460 1463 1461 1464 // create image object … … 1670 1673 } 1671 1674 curveFitter.setInstrumentResponse(excitation); 1672 } 1675 // System.out.println("$$$ EXCITATION $$$"); 1676 } 1677 // else System.out.println("$$$ NO EXCITATION $$$"); 1673 1678 return curveFitter; 1674 1679 } … … 1765 1770 1766 1771 // look for changes, current vs. saved cursor values 1767 boolean refit = false;1768 1772 if (null == _transStart 1769 1773 || null == _dataStart … … 1778 1782 || promptStop != _promptStop 1779 1783 || promptBaseline != _promptBaseline) { 1780 refit = true; 1781 } 1782 1783 // trigger refit 1784 if (refit) { 1784 1785 // trigger refit 1786 System.out.append("*** REFIT ***"); 1787 1785 1788 // update saved cursor values for next time 1786 1789 _transStart = transStart; -
trunk/projects/slim-plugin/src/main/java/loci/slim/heuristics/CursorEstimator.java
r7970 r7989 147 147 */ 148 148 public static int[] estimateDecayCursors(double xInc, double[] decay) { 149 // System.out.println("estimateDecayCursors"); 149 150 int maxIndex = findMax(decay); 150 151 double[] diffed = new double[maxIndex]; … … 175 176 public static double[] estimateCursors(double xInc, double[] prompt, 176 177 double[] decay, double chiSqTarget) { 177 System.out.println("xInc " + xInc + " prompt " + prompt + " decay " + decay + " chiSqTarget " + chiSqTarget);178 // System.out.println("xInc " + xInc + " prompt " + prompt + " decay " + decay + " chiSqTarget " + chiSqTarget); 178 179 double[] returnValue = new double[6]; 179 180 double baseline; … … 269 270 } 270 271 271 System.out.println("steepest prompt " + steepp + " steepest transient " + steept);272 System.out.println("startt is " + startt);273 System.out.println(" startp " + startp + " endp " + endp + " baseline " + baseline);272 // System.out.println("steepest prompt " + steepp + " steepest transient " + steept); 273 // System.out.println("startt is " + startt); 274 // System.out.println(" startp " + startp + " endp " + endp + " baseline " + baseline); 274 275 275 276 // "Now we've got estimates we can do some Marquardt fitting to fine-tune … … 290 291 returnValue[DATA_START] = startt; 291 292 returnValue[TRANSIENT_STOP] = transEndIndex; 292 293 dump(returnValue); 293 294 return returnValue; //TODO "do_estimate_resets; do_estimate_frees; " 294 295 } 295 296 296 System.out.println("prompt " + prompt.length + " decay " + decay.length);297 // System.out.println("prompt " + prompt.length + " decay " + decay.length); 297 298 298 299 double[] adjustedPrompt = adjustPrompt(prompt, startp*xInc, endp*xInc, baseline, xInc); … … 301 302 302 303 transFitStartIndex = transStartIndex; 303 System.out.println("transStartIndex " + transStartIndex + " transFitStartIndex " + transFitStartIndex + " transEndIndex " + transEndIndex);304 // System.out.println("transStartIndex " + transStartIndex + " transFitStartIndex " + transFitStartIndex + " transEndIndex " + transEndIndex); 304 305 305 306 int fitStart = transFitStartIndex - transStartIndex; // e.g. always zero 306 307 int fitStop = transEndIndex - transStartIndex; 307 308 int nData = transEndIndex - transStartIndex; 308 System.out.println(" fitStart " + fitStart + " fitStop " + fitStop + " nData " + nData);309 // System.out.println(" fitStart " + fitStart + " fitStop " + fitStop + " nData " + nData); 309 310 310 311 CurveFitData curveFitData = new CurveFitData(); … … 338 339 } 339 340 340 System.out.println("i " + i + " Z " + param[1] + " A " + param[2] + " T " + param[3]);341 // System.out.println("i " + i + " Z " + param[1] + " A " + param[2] + " T " + param[3]); 341 342 342 343 curveFitter.setFitAlgorithm(FitAlgorithm.SLIMCURVE_LMA); … … 345 346 346 347 if (ret >= 0) { 347 System.out.println("for start " + fitStart + " stop " + fitStop + " chiSq is " + data[0].getChiSquare());348 // System.out.println("for start " + fitStart + " stop " + fitStop + " chiSq is " + data[0].getChiSquare()); 348 349 chiSqTable[i] = data[0].getParams()[0]; //TODO ARG s/b same or better yet not kept in two places: data[0].getChiSquare(); 349 350 } 350 351 else { 351 System.out.println("ret from fitData is " + ret);352 // System.out.println("ret from fitData is " + ret); 352 353 chiSqTable[i] = 1e10f; // "silly value" 353 354 } … … 356 357 // "Find the minimum chisq in this range" 357 358 index = findMin(chiSqTable, 2 * ATTEMPTS + 1); 358 System.out.println("min chisq index is " + index + " value " + chiSqTable[index]);359 // System.out.println("min chisq index is " + index + " value " + chiSqTable[index]); 359 360 360 361 if (chiSqTable[index] > 9e9f) { // "no luck here..." 361 System.out.println("no luck here return");362 for (double chiSq : chiSqTable) {363 System.out.println("chiSq is " + chiSq);364 }365 System.out.println("index is " + index);362 // System.out.println("no luck here return"); 363 // for (double chiSq : chiSqTable) { 364 // System.out.println("chiSq is " + chiSq); 365 // } 366 // System.out.println("index is " + index); 366 367 367 368 returnValue[PROMPT_START] = startp; … … 371 372 returnValue[DATA_START] = startt; 372 373 returnValue[TRANSIENT_STOP] = transEndIndex; 373 System.out.print("1 ");374 // System.out.print("1 "); 374 375 dump(returnValue); 375 376 return returnValue; //TODO do estimate resets/frees??? … … 392 393 returnValue[DATA_START] = transFitStartIndex; 393 394 returnValue[TRANSIENT_STOP] = transEndIndex; 394 System.out.print("2 ");395 // System.out.print("2 "); 395 396 dump(returnValue); 396 397 return returnValue; … … 398 399 399 400 private static void dump(double[] value) { 400 System.out.print("prompt "); 401 System.out.print("start " + value[PROMPT_START]); 402 System.out.print("end " + value[PROMPT_STOP]); 403 System.out.print("transient "); 404 System.out.print("start " + value[TRANSIENT_START]); 405 System.out.print("data start " + value[DATA_START]); 406 System.out.println("end " + value[TRANSIENT_STOP]); 401 // System.out.print("prompt "); 402 // System.out.print("start " + value[PROMPT_START]); 403 // System.out.print("end " + value[PROMPT_STOP]); 404 // System.out.print("transient "); 405 // System.out.print("start " + value[TRANSIENT_START]); 406 // System.out.print("data start " + value[DATA_START]); 407 // System.out.println("end " + value[TRANSIENT_STOP]); 408 if (value[DATA_START] < value[TRANSIENT_START]) { 409 if (value[DATA_START] < 0.0) { 410 System.out.println("Calculated data start is less than zero!!!"); 411 value[DATA_START] = 0.0; 412 413 } 414 double tmp = value[DATA_START]; 415 value[DATA_START] = value[TRANSIENT_START]; 416 value[TRANSIENT_START] = tmp; 417 } 407 418 } 408 419 … … 423 434 int startIndex = (int) Math.ceil(start / inc); 424 435 int stopIndex = (int) Math.floor(stop / inc) + 1; 425 System.out.println("stop is " + stop + " stopIndex " + stopIndex);436 // System.out.println("stop is " + stop + " stopIndex " + stopIndex); 426 437 int length = stopIndex - startIndex; 427 438 if (length <= 0) { … … 441 452 adjusted[i - startIndex] = (prompt[i] - baseline) / scaling; 442 453 } 443 System.out.println("adjusted " + adjusted[0] + " " + adjusted[1] + " " + adjusted[2]);454 // System.out.println("adjusted " + adjusted[0] + " " + adjusted[1] + " " + adjusted[2]); 444 455 return adjusted; 445 456 } … … 570 581 private static int findMax(double[] values, int startIndex, int endIndex) { 571 582 if (endIndex > values.length) { 572 System.out.println("CursorEstimator.findMax endIndex is " + endIndex + " values.length is " + values.length);583 // System.out.println("CursorEstimator.findMax endIndex is " + endIndex + " values.length is " + values.length); 573 584 endIndex = values.length; 574 585 } 575 586 if (startIndex > values.length) { 576 System.out.println("CursorEstimator.findMax startIndex is " + startIndex + " values.length is " + values.length);587 // System.out.println("CursorEstimator.findMax startIndex is " + startIndex + " values.length is " + values.length); 577 588 startIndex = values.length; 578 589 } 579 590 if (values.length == 0) { 580 System.out.println("CursorEstimator.findMax but values is length zero");591 // System.out.println("CursorEstimator.findMax but values is length zero"); 581 592 return startIndex; 582 593 } -
trunk/projects/slim-plugin/src/main/java/loci/slim/ui/UserInterfacePanel.java
r7983 r7989 660 660 String selectedItem = (String) _promptComboBox.getSelectedItem(); 661 661 boolean isExcitationLoaded = false; 662 if (EXCITATION_NONE.equals(selectedItem)) { 663 if (null != _listener) { 664 _listener.cancelExcitation(); 665 } 666 } 667 else if (EXCITATION_FILE.equals(selectedItem)) { 662 if (EXCITATION_FILE.equals(selectedItem)) { 668 663 OpenDialog dialog = new OpenDialog("Load Excitation File", ""); 669 664 String directory = dialog.getDirectory(); … … 693 688 _promptBaselineField.setText("0.0"); 694 689 enablePromptCursors(false); 690 if (null != _listener) { 691 _listener.cancelExcitation(); 692 } 695 693 } 696 694 }
Note: See TracChangeset
for help on using the changeset viewer.