diff --git a/Modules/Bridge/NumPy/include/itkPyBuffer.hxx b/Modules/Bridge/NumPy/include/itkPyBuffer.hxx index 0a221411c0f..03d1ec18920 100644 --- a/Modules/Bridge/NumPy/include/itkPyBuffer.hxx +++ b/Modules/Bridge/NumPy/include/itkPyBuffer.hxx @@ -150,9 +150,9 @@ PyBuffer::_GetImageViewFromArray(PyObject * arr, PyObject * shape, PyObj using InternalPixelType = typename TImage::InternalPixelType; using ImporterType = ImportImageContainer; - auto importer = ImporterType::New(); - constexpr bool importImageFilterWillOwnTheBuffer = false; - InternalPixelType * data = (InternalPixelType *)buffer; + auto importer = ImporterType::New(); + constexpr bool importImageFilterWillOwnTheBuffer = false; + auto * const data = static_cast(buffer); importer->SetImportPointer(data, numberOfPixels, importImageFilterWillOwnTheBuffer); OutputImagePointer output = TImage::New();