<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def features_from_image( self, data, voxelsize, seeds=None, unique_cls=None ):
 # , voxels=None):
 """ Input data is 3d image :param data: is 3d image :param seeds: ndimage with same shape as data, nonzero values means seeds. :param unique_cls: can select only fv for seeds from specific class. f.e. unique_cls = [1, 2] ignores label 0 funcion is called twice in graph cut first call is with all params, second is only with data. based on self.modelparams['fv_type'] the feature vector is computed keywords "intensity", "voxels", "fv001", "fv_extern" can be used. modelparams['fv_type'] = 'fv_extern' allows to use external fv function Example of exter feature function. For easier implementation of return values use function return_fv_by_seeds(). def fv_function(data, voxelsize, seeds=None, cl=None):
 data2 = scipy.ndimage.filters.gaussian_filter(data, sigma=5) arrs = [data.reshape(-1, 1), data2.reshape(-1, 1)] fv = np.concatenate(arrs, axis=1) return imcut.features.return_fv_by_seeds(fv, seeds, unique_cls) modelparams['fv_extern'] = fv_function """


        fv_type = self.modelparams["fv_type"]
        logger.debug("fv_type " + fv_type)
        fv = []
        if fv_type == "intensity":
            fv = data.reshape(-1, 1)

            if seeds is not None:
                logger.debug("seeds: %s", scipy.stats.describe(seeds, axis=None))
                sd = seeds.reshape(-1, 1)
                selection = np.in1d(sd, unique_cls)
                fv = fv[selection]
                sd = sd[selection]
                # sd = sd[]
                return fv, sd
            return fv

        # elif fv_type in ("voxels"):
        #     if seeds is not None:
        #         fv = np.asarray(voxels).reshape(-1, 1)
        #     else:
        #         fv = data
        #         fv = fv.reshape(-1, 1)
        elif fv_type in ("fv001", "FV001", "intensity_and_blur"):

            # intensity in pixel, gaussian blur intensity
            return features.fv_function_intensity_and_smoothing(
                data, voxelsize, seeds, unique_cls
            )

            # from PyQt4.QtCore import pyqtRemoveInputHook
            # pyqtRemoveInputHook()

            # print fv1.shape
            # print fv2.shape
            # print fv.shape
        elif fv_type == "fv_extern":
            fv_function = self.modelparams["fv_extern"]
            return fv_function(data, voxelsize, seeds, unique_cls)

        else:
            logger.error("Unknown feature vector type: " + self.modelparams["fv_type"])
        return fv