| 45 | } |
| 46 | |
| 47 | void mitk::from_json(const nlohmann::json& j, ROI::Element& roi) |
| 48 | { |
| 49 | auto id = j["ID"].get<unsigned int>(); |
| 50 | roi.SetID(id); |
| 51 | |
| 52 | if (j.contains("TimeSteps")) |
| 53 | { |
| 54 | for (const auto& jTimeStep : j["TimeSteps"]) |
| 55 | { |
| 56 | auto t = jTimeStep["t"].get<TimeStepType>(); |
| 57 | |
| 58 | roi.SetMin(jTimeStep["Min"].get<Point3D>(), t); |
| 59 | roi.SetMax(jTimeStep["Max"].get<Point3D>(), t); |
| 60 | |
| 61 | if (jTimeStep.contains("Properties")) |
| 62 | { |
| 63 | auto properties = mitk::PropertyList::New(); |
| 64 | properties->FromJSON(jTimeStep["Properties"]); |
| 65 | roi.SetProperties(properties, t); |
| 66 | } |
| 67 | } |
| 68 | } |
| 69 | else |
| 70 | { |
| 71 | roi.SetMin(j["Min"].get<Point3D>()); |
| 72 | roi.SetMax(j["Max"].get<Point3D>()); |
| 73 | } |
| 74 | |
| 75 | if (j.contains("Properties")) |
| 76 | { |
| 77 | auto properties = mitk::PropertyList::New(); |
| 78 | properties->FromJSON(j["Properties"]); |
| 79 | roi.SetDefaultProperties(properties); |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | mitk::ROI::Element::Element() |
| 84 | : Element(0) |
nothing calls this directly
no test coverage detected