Added support for NChannelImage and ExtendToNChannel


Sorry for all the previous open/close pull requests. This is the only merge to look at.

Hmm sounds interesting!
I'll first finish the changes we agreed today and then see what I can do! :)

G



On Mon, Jul 14, 2014 at 2:48 PM, James A. Bednar <notifications@github.com>
wrote:

> In imagen/image.py:
>
> >          return self._image
> > +
> > +
> > +    def post_process_channels(self,p,gray):
> > +        if( self.apply_hue_jitter ):
> > +            im2pg = color_conversion.image2receptors
> > +            pg2analysis = color_conversion.receptors2analysis
> > +            analysis2pg = color_conversion.analysis2receptors
> > +            jitterfn = color_conversion.jitter_hue
> > +            satfn = color_conversion.multiply_sat
> > +
>
> Shouldn't there be a base class that combines whatever code matches
> between ExtendToNChannel and NChannelImage? I don't see any shared
> parameters right now, but both of them set channel_data=[] in the
> constructor, both of them should eventually support a list of names for the
> channels in the same way, and I would think that both of them should apply
> output functions in the same way. If so, then this new base class would be
> the thing called pattern.NChannel, not what is currently called
> ExtendToNChannel. At that point, ExtendToNChannel could be renamed to
> NChannelWrapper (since it wraps an existing PatternGenerator as an NChannel
> object), but ExtendToNChannel also seems ok. And both this and
> NChannelImage would then inherit from pattern.NChannel.
> … <#1473521e215501b7_>
> -- The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/ioam/imagen/pull/29/files#r14877967>.
>