Skip to content
Browse files

Coloc jobName; a ValueResult for use in ResultHandler implementations

let's hope the meaningless value of -1 doesn't make folks think some
thing failed... maybe i can hide it....
Don't want to make a whole new type of result, StringResult,  just to
handle the job name, and i want to keep the job name very close to the
value results so its never separated from them in ResultsHandler
  • Loading branch information...
chalkie666 authored and tomka committed Jul 27, 2015
1 parent f1ecf81 commit 75184e88cd6c1e0914ec87caebe97494002bcd4e
Showing with 16 additions and 0 deletions.
  1. +16 −0 src/main/java/algorithms/
@@ -30,6 +30,9 @@
// the saturated pixel ratio of channel 2
double saturatedRatioCh2;

// the coloc job name
String colocJobName;

// general image stats/parameters/values
double ch1Max;
double ch2Max;
@@ -108,6 +111,9 @@ public void execute(DataContainer<T> container)
saturatedRatioCh1 = ch1SaturatedRatio * 100.0;
saturatedRatioCh2 = ch2SaturatedRatio * 100.0;

// get job name so the ResultsHandler implementation can have it.
colocJobName = container.getJobName();

// add warnings if values are not in tolerance range
if ( Math.abs(zeroZeroRatio) > maxZeroZeroRatio ) {

@@ -130,6 +136,16 @@ public void execute(DataContainer<T> container)
public void processResults(ResultHandler<T> handler) {

// Here is a good place to have the coloc job name handled by the
// ResultsHandler implementation in use, since this class is always run.
// I'm going to abuse a ValueResult for this,
// even though the jobName has no numerical value...only it's String name...
// because i want ot keep the jobName close to all the value results
// so they get shown together by whatever implementation of ResultsHandler.
handler.handleValue(colocJobName, -1.0, 0);

// Make the ResultsHander implementation deal with the results.
handler.handleValue("% zero-zero pixels", zeroZeroPixelRatio, 2);
handler.handleValue("% saturated ch1 pixels", saturatedRatioCh1, 2);
handler.handleValue("% saturated ch2 pixels", saturatedRatioCh2, 2);

0 comments on commit 75184e8

Please sign in to comment.
You can’t perform that action at this time.