MCPcopy Create free account
hub / github.com/SimpleITK/SimpleITK / GetFormatString

Function GetFormatString

Wrapping/Python/sitkImageBuffer.cxx:52–112  ·  view source on GitHub ↗

Helper function to get format string for pixel type

Source from the content-addressed store, hash-verified

50
51// Helper function to get format string for pixel type
52static const char *
53GetFormatString(sitk::PixelIDValueEnum pixelID)
54{
55 switch (pixelID)
56 {
57 case sitk::sitkUInt8:
58 return "B"; // unsigned char
59 case sitk::sitkInt8:
60 return "b"; // signed char
61 case sitk::sitkUInt16:
62 return "H"; // unsigned short
63 case sitk::sitkInt16:
64 return "h"; // signed short
65 case sitk::sitkUInt32:
66 return "I"; // unsigned int
67 case sitk::sitkInt32:
68 return "i"; // signed int
69 case sitk::sitkUInt64:
70 return "Q"; // unsigned long long
71 case sitk::sitkInt64:
72 return "q"; // signed long long
73 case sitk::sitkFloat32:
74 return "f"; // float
75 case sitk::sitkFloat64:
76 return "d"; // double
77 case sitk::sitkComplexFloat32:
78 return "Zf"; // complex float
79 case sitk::sitkComplexFloat64:
80 return "Zd"; // complex double
81 case sitk::sitkVectorUInt8:
82 return "B";
83 case sitk::sitkVectorInt8:
84 return "b";
85 case sitk::sitkVectorUInt16:
86 return "H";
87 case sitk::sitkVectorInt16:
88 return "h";
89 case sitk::sitkVectorUInt32:
90 return "I";
91 case sitk::sitkVectorInt32:
92 return "i";
93 case sitk::sitkVectorUInt64:
94 return "Q";
95 case sitk::sitkVectorInt64:
96 return "q";
97 case sitk::sitkVectorFloat32:
98 return "f";
99 case sitk::sitkVectorFloat64:
100 return "d";
101 case sitk::sitkLabelUInt8:
102 return "B";
103 case sitk::sitkLabelUInt16:
104 return "H";
105 case sitk::sitkLabelUInt32:
106 return "I";
107 case sitk::sitkLabelUInt64:
108 return "Q";
109 default:

Callers 2

sitkImageBuffer_initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected