Login  Register

non-static ROIColor?

Posted by William Beaver on May 07, 2007; 5:27am
URL: http://imagej.273.s1.nabble.com/non-static-ROIColor-tp3699554.html

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