thanks for reading the groovy scripts and asking this fundamental question - I think it’s a good idea to explain it here in detail.
So a RawDataFile in Orbit is a kind of file handle. Out of that you can create e.g. a so-called RecognitionFrame which then holds the image data.
Each RawDataFile/image in orbit has a unique ID. Now, if you load images form an image server like OMERO, the image server defines that ID. If you load images from local disk (e.g. in the GUI), the first time Orbit sees an image a unique ID is created based on the MD5 of (a part of) the image and stored in a squlite file (orbit.db in your user home). Therefore you can also move images from one folder to the other, the ID will remain. This unique ID is needed, because all meta data and annotations is linked to that ID. It also allows you to create annotations for images, then send the orbit.db to someone else and she/he will then see the annotations. You can also see the image ID if you load an image in the GUI, then on the right side tab ‘file’.
Now to answer your question:
If you don’t know the ID, you first have to register the file(s):
RawDataFile rdf = ((ImageProviderLocal)DALConfig.imageProvider).registerFile(new File("c:/test.jpg"),0)
Here we cast to ImageProviderLocal, because only this image provider has the ability to register.
If the file has already been registered, then this method will reuse the existing ID and load the rdf.
Does that answer your question?