Login  Register

Re: non-static ROIColor?

Posted by William Beaver on May 08, 2007; 9:50pm
URL: http://imagej.273.s1.nabble.com/non-static-ROIColor-tp3699554p3699556.html

You read my mind (and eliminated the need for the lengthly post I  
just composed).

Thanks Wayne!
-william

On May 8, 2007, at 1:40 PM, Wayne Rasband wrote:

> ImageJ 1.38r, due by the end of the week, adds a non-static  
> setLocalColor() method to the Roi class. The local color overrides  
> the global color set by the static Roi.SetColor() method.
>
> -wayne
>
>> Hello all,
>> A question about ROIs I hope someone can shed some light on:  I'd
>> like to assign colors to ROI objects.  The problem: ROIColor is a
>> static attribute of the Roi class.
>>
>> If you beleive that ROIColor is part of each object's state and that
>> color could reasonably be different for each Roi, making ROIColor  
>> non-
>> static seems to be the right solution.  Unfortunately, It does not
>> appear that the naive solution of simply making the attribute "non-
>> static"  works:  many color preferences are assigned via reference to
>> the static Roi.ROIColor.
>>
>> Would it make sense to change this assumption (ROIColor is static) in
>> the Roi class?  I guess I'd need to somehow retain a static ROIColor
>> reference for those classes that need a default color (put it into
>> Prefs? and make appropriate changes elsewhere?)  and mod ROIColor so
>> it is an instance variable.  Any larger issues/impacts I am not aware
>> of?
>>
>> Alternatively, if no one sees value in having ROIs with object level
>> attributes, I could store each ROI color in some mapped container
>> class and mange them separately;  maybe as part of (something like)
>> RoiManager?
>>
>> Thoughts?
>>
>> Regards,
>> -William
>>
>> ------------
>> William Beaver
>> University of California, San Diego
>>

-wb

------------
William Beaver
[hidden email]