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

Function PixelTypeFormat

Wrapping/Python/mitk/Image.cpp:95–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95std::string PixelTypeFormat(const PixelType& pt)
96{
97 switch (pt.GetComponentType())
98 {
99 case itk::IOComponentEnum::UCHAR: return py::format_descriptor<unsigned char>::format();
100 case itk::IOComponentEnum::CHAR: return py::format_descriptor<char>::format();
101 case itk::IOComponentEnum::USHORT: return py::format_descriptor<unsigned short>::format();
102 case itk::IOComponentEnum::SHORT: return py::format_descriptor<short>::format();
103 case itk::IOComponentEnum::UINT: return py::format_descriptor<unsigned int>::format();
104 case itk::IOComponentEnum::INT: return py::format_descriptor<int>::format();
105 case itk::IOComponentEnum::FLOAT: return py::format_descriptor<float>::format();
106 case itk::IOComponentEnum::DOUBLE: return py::format_descriptor<double>::format();
107 default: mitkThrow() << "Unsupported pixel type: " << pt.GetComponentTypeAsString();
108 }
109}
110
111std::vector<py::ssize_t> ComputeNumpyShape(const Image& img)
112{

Callers 1

BuildNumpyArrayFunction · 0.85

Calls 2

GetComponentTypeMethod · 0.80

Tested by

no test coverage detected