<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_slices(self, extended=False):
 """Generator over all the slices selected, each time returning a cross-section. Parameters extended : bool Flag to return just slice data (default, extended=False), or return a tuple of axis, slice_num, slice_data (extended=True) Returns ------- slice_data : an image (just slice data, default, with extended=False), or a tuple of axis, slice_num, slice_data (extended=True) """


        for dim, slice_num in self._slices:
            yield self._get_axis(self._image, dim, slice_num, extended=extended)