how to initialize ScriptableObject in code?

public class EditorData : ScriptableObject
{
Texture2D pic;
}

there is a png file on disk: “Assets/Test/Pic/test.png”

how to create an instance and initialize it?

EditorData data = ScriptableObject.CreateInstance<EditorData>();
data.pic = ???;
AssetDatabase.CreateAsset(data, "Assets/Test/EditorData.asset");

I have found the way:

data.pic = AssetDatabase.LoadAssetAtPath<Texture2D>("Assets/Test/Pic/test.png");