Skip to content

Commit

Permalink
BUG: skip measurements that cause issues on write
Browse files Browse the repository at this point in the history
This came up with "nan" generated by PET measurements plugin.

Related issue: QIICR/QuantitativeReporting#186
  • Loading branch information
fedorov committed May 18, 2018
1 parent 6fd6e94 commit 4f70fdc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/sr/tid1500writer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,10 @@ int main(int argc, char** argv){
// TODO - add measurement method and derivation!
const CMR_TID1411_in_TID1500::MeasurementValue numValue(measurement["value"].asCString(), json2cev(measurement["units"]));

CHECK_COND(measurements.addMeasurement(json2cev(measurement["quantity"]), numValue));
if(!measurements.addMeasurement(json2cev(measurement["quantity"]), numValue).good()){
std::cerr << "WARNING: Skipping measurement with the value of " << measurement["value"].asCString() << std::endl;
continue;
}

if(measurement.isMember("derivationModifier")){
CHECK_COND(measurements.getMeasurement().setDerivation(json2cev(measurement["derivationModifier"])));
Expand Down

0 comments on commit 4f70fdc

Please sign in to comment.