Hi John
If the user selects the archived option, to retrieve the files you can do:
Use the Query service to retrieve the original files linked to a given pixels set.
You will get the pixels ID from the image itself.
- Code: Select all
IQueryPrx service;
ParametersI param = new ParametersI();
param.map.put("id", omero.rtypes.rlong(pixelsID));
List files = service.findAllByQuery(
"select ofile from OriginalFile as ofile left join " +
"ofile.pixelsFileMaps as pfm left join pfm.child as " +
"child where child.id = :id", param);
The call will return a collection of Original files.
Then you can read the data using the RawFileStore
Follow some pseudo-code
- Code: Select all
int INC = 262144;
RawFileStorePrx store;
File f;// The file on client's machine
OriginalFile of; //object from the list returned in previous call.
store.setFileId(of.getId().getValue());
stream = new FileOutputStream(f);
size = of.getSize().getValue();
try {
for (offset = 0; (offset+INC) < size;) {
stream.write(store.read(offset, INC)); //read the data
offset += INC;
}
} finally {
stream.write(store.read(offset, (int) (size-offset)));
stream.close();
}
I will probably need to make the method available through one of the services, so it is easier to use.
Thanks
jmarie