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

Function GetRequiredDigits

Modules/Multilabel/src/mitkLabelSetImage.cpp:1170–1173  ·  view source on GitHub ↗

Helper function to calculate number of digits needed

Source from the content-addressed store, hash-verified

1168{
1169 // Helper function to calculate number of digits needed
1170 constexpr int GetRequiredDigits(mitk::MultiLabelSegmentation::LabelValueType maxValue)
1171 {
1172 return maxValue > 0 ? static_cast<int>(std::floor(std::log10(maxValue))) + 1 : 1;
1173 }
1174}
1175
1176template <typename MultiLabelSegmentationType, typename ImageType>

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected