Well Patrick,
here is a macro that allows you to change the color of line selections to your liking.
Create a simple test image:
newImage( "LineSelections", "8-bit black", 256, 256, 1 );
makeLine(14,21,47,49,79,33,134,33,185,17,222,53,247,5);
roiManager("Add");
makeLine(12,70,68,70,129,55,140,94,209,76,227,100,249,62);
roiManager("Add");
makeLine(12,98,41,134,59,96,80,124,130,101,143,80,173,122,211,119,247,131);
roiManager("Add");
makeLine(11,173,34,225,100,238,116,178,173,244,211,247,229,160,247,194);
roiManager("Add");
roiManager("Show All");
exit()
Paste the above macro code to an empty macro window (Plugins >> New >> Macro) and run it.
Colorizer macro:
idx = roiManager( "count" );
rois = Array.getSequence( idx );
for ( i=0; i < idx; i++ ) { rois[i] = d2s( 1+rois[i], 0 ); }
Dialog.create("Set Line Color");
Dialog.addChoice( "Index", rois );
//Dialog.addSlider( "Opacity", 0, 255, 128 );
Dialog.addSlider( "Red", 0, 255, 0 );
Dialog.addSlider( "Green", 0, 255, 0 );
Dialog.addSlider( "Blue", 0, 255, 0 );
Dialog.show();
idx = parseInt( Dialog.getChoice() ) - 1;
c = "";
//c = padStr( toHex( Dialog.getNumber() ) );
c = c + padStr( toHex( Dialog.getNumber() ) );
c = c + padStr( toHex( Dialog.getNumber() ) );
c = c + padStr( toHex( Dialog.getNumber() ) );
roiManager( "select", idx );
//roiManager( "Set Fill Color", c );
roiManager("Set Color", c );
run("Select None");
exit();
////////////////////
function padStr( hex ) {
if ( lengthOf( hex ) < 2 ) { return "0" + hex; } else { return hex; }
}
Paste the above macro code to another empty macro window (Plugins >> New >> Macro) and run it.
Here is an example of the colored test image:

[…] i.e. in the easiest sense assign different colors to them according to the class I’m defining.
If you would like to see this automatically performed, you need to provide the mathematically formulated class definitions.
Regards
Herbie