Get a NumPy ndarray view of a SimpleITK Image. Returns a a read-only view of the image buffer. The behavior of modifying the underlying SimpleITK image while the NumPy array view exists is undefined.
(image: Image)
| 256 | |
| 257 | |
| 258 | def GetArrayViewFromImage(image: Image) -> "numpy.ndarray": |
| 259 | """Get a NumPy ndarray view of a SimpleITK Image. |
| 260 | |
| 261 | Returns a a read-only view of the image buffer. The behavior of modifying the underlying |
| 262 | SimpleITK image while the NumPy array view exists is undefined. |
| 263 | """ |
| 264 | |
| 265 | if not HAVE_NUMPY: |
| 266 | raise ImportError("NumPy not available.") |
| 267 | |
| 268 | return numpy.asarray(image, copy=False) |
| 269 | |
| 270 | |
| 271 | def GetArrayFromImage(image: Image) -> "numpy.ndarray": |
nothing calls this directly
no outgoing calls
no test coverage detected