def get_subset(self, dim, idx):
        if not 0 <= dim < 5:
            raise ValueError("The argument 'dim' must be in the range [0, 5).")

        shape = self.shape
        valid_classes = self.get_valid_classes()

        #Make an empty extension for the result
        result_shape = list(shape)
        result_shape[dim] = 1
        while result_shape[-1] == 1 and len(result_shape) > 3:
            result_shape = result_shape[:-1]
        result = self.make_empty(result_shape,
                                 self.affine,
                                 self.reorient_transform,
                                 self.slice_dim
                                )

        for src_class in valid_classes:
            #Constants remain constant
            if src_class == ('global', 'const'):
                for key, val in self.get_class_dict(src_class).iteritems():
                    result.get_class_dict(src_class)[key] = deepcopy(val)
                continue

            if dim == self.slice_dim:
                if src_class[1] != 'slices':
                    for key, vals in self.get_class_dict(src_class).iteritems():
                        result.get_class_dict(src_class)[key] = deepcopy(vals)
                else:
                    result._copy_slice(self, src_class, idx)
            elif dim < 3:
                for key, vals in self.get_class_dict(src_class).iteritems():
                    result.get_class_dict(src_class)[key] = deepcopy(vals)
            elif dim == 3:
                result._copy_sample(self, src_class, 'time', idx)
            else:
                result._copy_sample(self, src_class, 'vector', idx)

        return result
Get vlm_media instance playback rate by name or instance id.
dataset/ETHPy150Open moloney/dcmstack/src/dcmstack/dcmmeta.py/DcmMetaExtension.get_subset--crossover with--dataset/ETHPy150Open disqus/playa/playa/lib/vlc.py/libvlc_vlm_get_media_instance_rate