New image.py, added support for channels() to PG, Selector and all from GenericImage on

Fixed!



On Thu, Jul 17, 2014 at 7:54 PM, Giacomo Spigler <spiglerg@gmail.com> wrote:

> This is more appropriate maybe:
>
>     def num_channels(self):
>         if(self.inspect_value('index') is None):
>             if(len(self.generators)>0):
>                 return self.generators[0].num_channels()
>             return 0
>
>         return self.get_current_generator().num_channels()
>
>
>
>
> On Thu, Jul 17, 2014 at 7:53 PM, Giacomo Spigler <spiglerg@gmail.com>
> wrote:
>
>> Hmm actually Selector is wrapped into CompositeImage, so its num_channels
>> is not even called!
>>
>> G
>>
>>
>>
>> On Thu, Jul 17, 2014 at 7:43 PM, Giacomo Spigler <spiglerg@gmail.com>
>> wrote:
>>
>>> If you want I can modify the num_channels and commit, if you prefer the
>>> behavior I wrote in my last comment?
>>>
>>>
>>>
>>> On Thu, Jul 17, 2014 at 7:42 PM, Giacomo Spigler <spiglerg@gmail.com>
>>> wrote:
>>>
>>>>
>>>> Yes and no, I think we agreed to keep it temporarily?
>>>> My code doesn't depend on this anyway, yet. Though I'm sure that some
>>>> interesting code by Chris does! :)
>>>>
>>>>
>>>>
>>>> On Thu, Jul 17, 2014 at 7:41 PM, James A. Bednar <
>>>> notifications@github.com> wrote:
>>>>
>>>>> In imagen/image.py:
>>>>>
>>>>> > +        """
>>>>> > +        p = param.ParamOverrides(self,params)
>>>>> > +
>>>>> > +        params['xdensity']=p.xdensity
>>>>> > +        params['ydensity']=p.ydensity
>>>>> > +        params['bounds']=p.bounds
>>>>> > +
>>>>> > +        # (not **p)
>>>>> > +        channels_dict = p.generator.channels(**params)
>>>>> > +
>>>>> > +        self.set_channel_values(p,params,channels_dict)
>>>>> > +
>>>>> > +
>>>>> > +        if self.correlate_channels is not None:
>>>>> > +            corr_to,corr_from,corr_amt = self.correlate_channels
>>>>> > +            self._channel_data[corr_to] = corr_amt*self._channel_data[corr_from]+(1-corr_amt)*self._channel_data[corr_to]
>>>>>
>>>>> I'm having deja vu here -- wasn't this supposed to be made into a
>>>>> ChannelTransform?
>>>>>
>>>>> —
>>>>> Reply to this email directly or view it on GitHub
>>>>> <https://github.com/ioam/imagen/pull/31/files#r15075933>.
>>>>>
>>>>
>>>>
>>>
>>
>