MCPcopy Create free account
hub / github.com/MITK/MITK / GetCESTDutyCycle

Method GetCESTDutyCycle

Modules/CEST/src/mitkCESTPropertyHelper.cpp:129–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129double mitk::GetCESTDutyCycle(const IPropertyProvider* provider)
130{
131 if (!provider)
132 {
133 mitkThrow() << "Cannot determine duty cycle. Passed property provider is invalid.";
134 }
135
136 double result = 0.0;
137
138 auto prop = provider->GetConstProperty(CEST_PROPERTY_NAME_DutyCycle().c_str());
139 if (prop.IsNotNull())
140 {
141 result = mitk::ConvertDICOMStrToValue<double>(prop->GetValueAsString()) * 0.01;
142 }
143 else mitkThrow() << "Cannot determine duty cycle. Selected input has no property \"" << CEST_PROPERTY_NAME_DutyCycle() << "\"";
144
145 return result;
146}

Callers

nothing calls this directly

Calls 3

IsNotNullMethod · 0.80
GetConstPropertyMethod · 0.45
GetValueAsStringMethod · 0.45

Tested by

no test coverage detected