| 31 | |
| 32 | template <unsigned int VImageDimension> |
| 33 | itk::FlatStructuringElement<VImageDimension> |
| 34 | CreateKernel(KernelEnum kernelType, const std::vector<uint32_t> & size) |
| 35 | { |
| 36 | using ITKKernelType = typename itk::FlatStructuringElement<VImageDimension>; |
| 37 | |
| 38 | typename ITKKernelType::SizeType radius = sitkSTLVectorToITK<typename ITKKernelType::SizeType>(size); |
| 39 | |
| 40 | switch (kernelType) |
| 41 | { |
| 42 | case sitkAnnulus: |
| 43 | return ITKKernelType::Annulus(radius, 1, false); |
| 44 | case sitkBall: |
| 45 | return ITKKernelType::Ball(radius); |
| 46 | case sitkBox: |
| 47 | return ITKKernelType::Box(radius); |
| 48 | case sitkCross: |
| 49 | return ITKKernelType::Cross(radius); |
| 50 | sitkKernelPolygonCreateMacro(3); |
| 51 | sitkKernelPolygonCreateMacro(4); |
| 52 | sitkKernelPolygonCreateMacro(5); |
| 53 | sitkKernelPolygonCreateMacro(6); |
| 54 | sitkKernelPolygonCreateMacro(7); |
| 55 | sitkKernelPolygonCreateMacro(8); |
| 56 | sitkKernelPolygonCreateMacro(9); |
| 57 | default: |
| 58 | sitkExceptionMacro("Logic Error: Unknown Kernel Type"); |
| 59 | } |
| 60 | |
| 61 | #undef sitkKernelPolygonCreateMacro |
| 62 | } |
| 63 | |
| 64 | |
| 65 | } // namespace itk::simple |
nothing calls this directly
no outgoing calls
no test coverage detected