Added support for NChannelGeneratorSheet and optimized color conversion


Optimized colorconversion added to topo.optimized.color (new file) and topo.analysis.__init (overriding featuremapper.colorspaces default unoptimized functions).

NChannelGeneratorSheet added to topo.base.generatorsheet.

Hmm it's because the "_opt" function should not be used by itself, like,
it's for internal use only. Users should only use rgb_to_hsv (well, the
more general classes of colorspaces.py, hopefully).


I'll fix the print/warning.

For the c-code, I've just copied what I was given by Chris, didn't modify
that part nor reformatted. Maybe it's more clear / readable this way?




On Thu, Jul 10, 2014 at 4:02 PM, J.L Stevens <notifications@github.com>
wrote:

> In topo/base/generatorsheet.py:
>
> > +
> > +
> > +    def set_input_generator(self,new_ig,push_existing=False):
> > +        """Wrap new_ig in ExtendToNChannel if necessary."""
> > +
> > +        if hasattr(new_ig,'channel_data'):
> > +            self.src_ports = ['Activity']
> > +            self.channel_data = []
> > +
> > +            for i in range(len(new_ig.channel_data)):
> > +                self.src_ports.append( 'Activity'+str(i) )
> > +                self.channel_data.append(self.activity.copy())
> > +
> > +        else: # monochrome
> > +            print "WARNING: Using non-NChannel input generator with NChannelGeneratorSheet. This will behave like a simple (single-channel) GeneratorSheet."
> > +            self.src_ports = ['Activity']
>
> Should use self.warning instead of print statement.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/ioam/topographica/pull/569/files#r14771040>.
>