| 18 | |
| 19 | |
| 20 | std::vector<mitk::ScalarType> mitk::ExtractCESTT1Time(const BaseData* image) |
| 21 | { |
| 22 | std::vector<ScalarType> result; |
| 23 | |
| 24 | auto prop = image->GetProperty(CEST_PROPERTY_NAME_TREC().c_str()); |
| 25 | if (prop.IsNotNull()) |
| 26 | { |
| 27 | auto valueStr = prop->GetValueAsString(); |
| 28 | |
| 29 | std::istringstream iss; |
| 30 | iss.imbue(std::locale("C")); |
| 31 | iss.str(valueStr); |
| 32 | double d; |
| 33 | |
| 34 | while (iss >> d) |
| 35 | { |
| 36 | if (!iss.fail()) |
| 37 | { |
| 38 | result.emplace_back(d); |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | if (result.size() != image->GetTimeSteps()) mitkThrow() << "Cannot determine T1 times. Selected input has an property \"" << CEST_PROPERTY_NAME_TREC() << "\" that don't match the number of time steps of input."; |
| 43 | |
| 44 | for (auto& value : result) |
| 45 | { |
| 46 | value *= 0.001; |
| 47 | } |
| 48 | } |
| 49 | else mitkThrow() << "Cannot determine T1 time grid (TREC). Selected input has no property \"" << CEST_PROPERTY_NAME_TREC() << "\""; |
| 50 | |
| 51 | return result; |
| 52 | } |
| 53 | |
| 54 | std::vector<mitk::ScalarType> mitk::ExtractCESTOffset(const BaseData* image) |
| 55 | { |
nothing calls this directly
no test coverage detected