Weka Segmentation Macro Fiji Classifier is not loading or is undetectable

Hi,

So I am trying to run a script on mac os that uses weka segmentation to generate a classifier and run it on a stack of images. However, although this code ran fine initially, it continues to give me this error:

Sourced file: inline evaluation of: import trainableSegmentation.WekaSegmentation; import trainableSegmentation . . . '' : Unknown class: WekaSegmentation : at Line: 19 : in file: inline evaluation of: import trainableSegmentation.WekaSegmentation; import trainableSegmentation . . . ‘’ : new WekaSegmentation ( )

I have redownloaded Image J fiji multiple times with all the updates as well as make sure this is not a memory issue using this link: https://imagejdocu.tudor.lu/faq/technical/how_do_i_increase_the_memory_in_imagej. The code is provided below. If anyone has any suggestions on how this issue can be resolved it will be greatly appreciated!

image j code:

// @File(label=“Input directory”, description=“Select the directory with input images”, style=“directory”) inputDir
// @File(label=“Output directory”, description=“Select the output directory”, style=“directory”) outputDir
// @File(label=“Weka model”, description=“Select the Weka model to apply”) modelPath
// @String(label=“Result mode”,choices={“Labels”,“Probabilities”}) resultMode

import trainableSegmentation.WekaSegmentation;
import trainableSegmentation.utils.Utils;
import ij.io.FileSaver;
import ij.IJ;
import ij.ImagePlus;

// starting time
startTime = System.currentTimeMillis();

// caculate probabilities?
getProbs = resultMode.equals( “Probabilities” );

// create segmentator
segmentator = new WekaSegmentation();
// load classifier
segmentator.loadClassifier( modelPath.getCanonicalPath() );

// get list of input images
listOfFiles = inputDir.listFiles();
for ( i = 0; i < listOfFiles.length; i++ )
{
// process only files (do not go into sub-folders)
if( listOfFiles[ i ].isFile() )
{
// try to read file as image
image = IJ.openImage( listOfFiles[i].getCanonicalPath() );
if( image != null )
{
// apply classifier and get results (0 indicates number of threads is auto-detected)
result = segmentator.applyClassifier( image, 0, getProbs );

        if( !getProbs )
            // assign same LUT as in GUI
            result.setLut( Utils.getGoldenAngleLUT() );

        // save result as TIFF in output folder
        outputFileName = listOfFiles[ i ].getName().replaceFirst("[.][^.]+$", "") + ".tif";
        new FileSaver( result ).saveAsTiff( outputDir.getPath() + File.separator + outputFileName );

        // force garbage collection (important for large images)
        result = null;
        image = null;
        System.gc();
    }
}

}
// print elapsed time
estimatedTime = System.currentTimeMillis() - startTime;
IJ.log( “** Finished processing folder in " + estimatedTime + " ms **” );