| 52 | } |
| 53 | |
| 54 | std::vector<mitk::ScalarType> mitk::ExtractCESTOffset(const BaseData* image) |
| 55 | { |
| 56 | std::vector<ScalarType> result; |
| 57 | |
| 58 | auto prop = image->GetProperty(CEST_PROPERTY_NAME_OFFSETS().c_str()); |
| 59 | if (prop.IsNotNull()) |
| 60 | { |
| 61 | auto valueStr = prop->GetValueAsString(); |
| 62 | |
| 63 | std::istringstream iss; |
| 64 | iss.imbue(std::locale("C")); |
| 65 | iss.str(valueStr); |
| 66 | double d; |
| 67 | |
| 68 | while (iss >> d) |
| 69 | { |
| 70 | if (!iss.fail()) |
| 71 | { |
| 72 | result.emplace_back(d); |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | if (result.size() != image->GetTimeSteps()) mitkThrow() << "Cannot determine offset. Selected input has an property \"" << CEST_PROPERTY_NAME_OFFSETS() << "\" that don't match the number of time steps of input."; |
| 77 | |
| 78 | } |
| 79 | else mitkThrow() << "Cannot determine frequency. Selected input has no property \"" << CEST_PROPERTY_NAME_OFFSETS() << "\""; |
| 80 | |
| 81 | return result; |
| 82 | } |
nothing calls this directly
no test coverage detected