Segmented lines with different colors

I’ve been trying to create multiple segmented lines and make specific ones different colors but it seems when one changes they all change. I’m not trained in computer science so one previous answer I found on the forums involving creating a macro went over my head. Is anyone able to explain what I need to do and if it includes coding, can someone translate so I can adapt the macro to the situation? Thank you

Hi Shayna,

When you say “segmented lines”, do you mean Region of interest? It’s be clearer if you could show an example.

If it’s ROIs, in the ROI manager, select a ROI and click on “Properties”, where you can define the ROI’s colour.



So I am creating a segmented line then in ROI manager, clicking add"t" until I have multiple lines. But when I make a selection in ROI manager and go to properties to change the color, I write in the color I want but it doesn’t fix to that line. Whenever I click a different segmented line, the color change jumps to that line and the original line reverts to its first color. Or if I click on my image they both go back to the original color. I want to assign colors to individual lines and have it stick to the line its assigned to.

I don’t have that issue…

When changing properties of all ROIs, the software even asks if I really want to proceed. When selecting a ROI to change its colour, does it show shaded in the ROI manager?

Otherwise, I don’t know.


Could you please check for the ImageJ-, Java- and OS-version?

1 Like

ImageJ 1.53g
Java 1.8.0_172 (64-bit)
OS 10.12.6

I am highlighting it in ROI Manager then clicking properties. Do I need to do anything besides change the color like change position or group or something?

Nothing that I know of.
I’m encountering the same problem but I’m sure it used to work some time ago.

ImageJ 1.53h
Java 1.8.0_271 (64-bit)
OS 10.11.6

1 Like

@MatthiewV, if you have a moment, what versions are you working with? Maybe I need an update?

I’m on Windows10
ImageJ 1.53c
Java 1.8.0_172

This maybe something to flag to one of the wonderful people that make the software run… @imagejan

Just downgraded to

ImageJ 1.52v

and it works as desired.

@Wayne, any ideas?

1 Like

It works for me if I select different group numbers in the properties using the ROI Manager.

Yes, but it used to work without “grouping” which means a problem with backwards-compatibility.

That might be but is a first help.

I just checked older versions (1.52p) and here it works without the existence of a group attribute.

It seems to be related with the introduction of the group attribute (intended or not).

However Wayne has been already adressed if this is a regression.

Did this already yesterday!

Just made a test on MacOSX with an old 1.53e17 (group attribute available since 1.52t consulting the release notes). And here it works without the group attribute. So it seems to be a regression.

Hi @SSosno01,

This bug (a 1.53g regression) is fixed in the latest ImageJ daily build (1.53i2).


Great, just tried it with adjusting groups and that was a successful work around, I’ll look into downloading the latest build though. Thank you all very much for your help!!!

You’d better upgrade to the daily build 1.53i3.
The problem was immediately resolved by Wayne.