This script can be used to extract as sub-volume from one of your images. Let's assume we have this one.
with the dimensions 181x217
In [1]:
medpy_info.py resources/flair.nii.gz
We can now cut out the middle part with
In [3]:
medpy_extract_sub_volume.py resources/flair.nii.gz output/subvolume.nii.gz 60:120,70:140
which results in
As usual for medpy, the script works for images of all dimensions.
In [ ]: