[ENH] Fit-Check added to NiftiLabelsMasker

Contrary to NiftiMasker, NiftiLabelsMasker.transform() does not currently check whether fit() of the current instance has already been called. Added exception for this case.
Ok, in progress.

2014-10-28 8:41 GMT+01:00 Loïc Estève <notifications@github.com>:

> In nilearn/input_data/nifti_region.py:
>
> > @@ -196,6 +196,12 @@ def fit(self, X=None, y=None):
> >      def fit_transform(self, niimgs, confounds=None):
> >          return self.fit().transform(niimgs, confounds=confounds)
> >
> > +    def _check_fitted(self):
> > +        if not hasattr(self, "labels_img_"):
> > +            raise ValueError('It seems that %s has not been fit. '
>
> It should probably be fitt*ed* rather than fit. Could you fix it here and
> I'll fix the error message in BaseMasker.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/nilearn/nilearn/pull/267/files#r19456271>.
>



-- 
Viele Grüße,
Danilo