Weka Segmentation: Generating ROI from semantic segmentation and cropping

Hello I am Samuel,

I am trying to study fuel cells for my graduate degree, where I have to study many images. I am trying to build a macro that will generate a ROI around the top most layer and crop it. As you can see in the picture below, the top most layer is called the CL layer.


I would like this macro to run on a batch of images, but not every image is the same. Sometimes the contact layer can be higher/lower, or thinner/thicker. So I cannot simply hard code specific retangular ROI dimensions, because it may capture not enough of the CL layer, or it may capture some of the layer below it.
I am trying to use the Trainable Weka Segmentation, because it seemed best suited for this task. Where I can train it to select only the CL layer.

In the image above I have cropped the CL layer and the layer below it, the CFL layer. I then trained my classifier to segment the image into 3 parts, the CL layer, the CFL layer, and the background. Now my real question is: In a macro, how can I generate a ROI around the area with the most red traces, and then crop it so it only contains the CL layer with a batch of images?

Thank you,
Samuel Sayed