Saving WEKA Classification Pixel Data After Loading Classifier

Hi, all

I’m new to ImageJ and have started using WEKA to classify vegetation on photos. I’m having no issues classifying what I wish, and getting WEKA to pop out the pixel values when you click “save data” after WEKA finishes.

The problem is when I load a past classifier – I can still classify the image, though when I try to click save data, the button doesn’t even let me do it. The letters are grey. In the photo I have attached, you can see that WEKA has classified my image successfully, though the “save data” option isn’t available. This is after I have uploaded a classifier.

Thanks much!

The Save Data button is saving the feature values of the pixels that have been identified by traces for training purposes. When you apply a trained classifier to an image, there are no traces involved. Therefore, there is nothing for that function to save. If you want to save the classified image, you can do so by saving it like you would any other open image.

Hey Andrew,

Thanks for your reply – I actually and trying to save the pixel data and not the image itself, I’m actually not interested in the image, only the values that the save data button will give you once you click it. Sorry if this is confusing!

I see. In that case, click Settings. In the window the pops-up, there should be a button near the bottom that says something like Save feature stack; click it. This will save the feature stack which is where the Save data gets the information from. Also save the segmented image. Saving these two things will save the same data as Save data but as images rather than a table. If you need the data in a table format, you could just write a macro to go through each pixels and record the information in the results table.

Andrew –

Ah I feel like a dummy. Somehow I was able to pull up a data table that told me how many pixels were classified as Class 1 and how many in Class 2…

Wait, so is that all you wanted? Just the class counts? I am not sure which data table you are talking about but you can get those by just running the histogram command on the segmented image.

I figured it out. Thanks so much.

1 Like