We're Hiring!

Access original metadata from script

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

Re: Access original metadata from script

Postby wmoore » Thu Nov 24, 2011 3:23 pm

Hi,

It seems like this is a Bio-Formats issue. I have created a ticket here: https://trac.openmicroscopy.org.uk/ome/ticket/7319

Thanks for your feedback.

Will.
User avatar
wmoore
Team Member
 
Posts: 674
Joined: Mon May 18, 2009 12:46 pm

Re: Access original metadata from script

Postby ppouchin » Thu Dec 08, 2011 2:26 pm

I managed to write something that changes the acquisition date so that it matches the "last modified" date from the original file stat. I'm not sure I should do it this way (accessing a hidden attribute of an object is not very pretty), but here is how I do:
Code: Select all
date = os.stat(filename)[ST_MTIME]
img._obj.acquisitionDate._val = long(1000*date)

("filename" is based on the name of the image, and I look in the DropBox if it exists.)

I'm also able to change the "creationEvent" time of images but it seems I can't modify the "updateEvent" time which is used to define the "import date". With something like :
Code: Select all
img._obj.details.creationEvent.time._val = long(1000*date)


Now people importing their data for the first time get hundred of images in one week, which is not very practical to sort them out. That's why I'd like to let them "adjust" the import date.

An other way to display the data as they'd like to see it would be to modify Insight's code. I remember patching it myself once last year but I can't build it anymore on Windows (using build.py)... I get some error with a library, but I don't know how to correct it for omero to work correctly. I will try it on linux though.
Code: Select all
org.apache.fop.tools.anttasks.Fop cannot be found
ppouchin
 
Posts: 98
Joined: Thu Dec 02, 2010 2:08 pm

Re: Access original metadata from script

Postby jburel » Thu Dec 08, 2011 7:37 pm

Good evening.
Adjusting the acquisition date is a functionality that we should probably allow from the client (to fix manually a bug while reading metadata)
Do you have other metadata that you think we should allow to modify from the client e.g. channel's name.

We will also need to add the option to sort by import, acquisition date.

If you want to build insight, directly from the command line using ant, you will need to make sure fop.jar is in the classpath or you could comment line 152 in lib.xml
<!--taskdef name="fop" classname="org.apache.fop.tools.anttasks.Fop" /--> The task Fop has several dependencies (listed in the file)
Fop was used to generate pdf documents

The easiest option might be to use Eclipse. Create a new insight project, add the jar from lib and from build/tools to the classpath
Select Window>Show View> Ant
Add the ant target.
Select the build target you wish.

Regards
Jmarie
User avatar
jburel
Team Member
 
Posts: 348
Joined: Thu May 21, 2009 6:38 pm
Location: dundee

Previous

Return to Developer Discussion

Who is online

Users browsing this forum: Google [Bot] and 1 guest