Forum Navigation
You need to log in to create posts and topics.

Grain segmentation modifier

Hello Constanze,

I'm using a Grain segmentation modifier as it is in the experimental phase. So, before using it I checked it with my calculation a few times and it works perfectly.

Now, I want to calculate the average grain size from it.

I can see the grain size for each individual grain in the Data table --> Grain list. I tried to use time averaging, but it does not work because the grain size does not appear in the available values. I guess because it is not a global variable.

So, can you please suggest a way to extract it?

Thank you



Hi Prash,

The Time Averaging modifier should allow you to average the complete Data Table called "Grain List", including the column "Grain Size".
In the Time Averaging modifier settings please choose operate on -> Data table: Grain List.
Then, open the Data inspector by clicking "Show in data inspector". You will see a new Data Table called "Grain List - Time Averaging" appear that also contains the average grain size.

Does that work for you?



I'm attaching here the screen shot. No, it doesn't work for me.

Uploaded files:
  • Screenshot-from-2021-11-03-13-45-33.png
  • Screenshot-from-2021-11-03-13-45-53.png


did you maybe mean the average particle size in one animation frame then? That's unclear from your question.

In that case, remove the Time averaging modifier and use a Python script modifier. You can compute the average value of the column "Grain Size" like this:

from import *
import numpy as np 

def modify(frame: int, data: DataCollection):
    print(np.mean(data.tables['grains']['Grain Size']))


Yes, that's true. Sorry for not being clear.

Actually I wanted to see the evaluation of average grain size. So, I needed the average grain size per frame.

Thank you for the suggestion.

New for our users in China: OVITO on WeChat 

Official OVITO WeChat channel operated by Foshan Diesi Technology Co., Ltd.