Python sitk ExtractImageFilter -- basic usage help??

The Python slicing is great! I always use it instead of those listed filters, it is flexible and has a consistent way to specify. If rawimg was a np.ndarray, then the operation rawimg[0:20,0:30,0:40,5] produces an array with shape (20,30,40) of dimension 3, reducing the dimension. In general the simpleitk operator is designed to behave like the numpy or standard slice based indexing.

The support for 4D images is some what limited in SimpleITK, but is should be expanded. The get_item currently does not fully support 4D images. Could you please create a simpleitk issue to add full 4D support to this method on SimpleITK GitHub.

We really should be doing better with our SimpleITK Doxygen. As of right now the description for the filters are just taken from ITK, with all the features exposed from the C++ interface. We should really mark this as coming for C++ ITK, and provide brief info about the SimpleITK simplification done, or implementation choices made. The other simplification done in SimpleITK is that “ITK streaming” is not supported, so the all these regions don’t really apply to simpleITK. There is in the ITK Software Guide about the pipeline and streaming if you are currious.

1 Like