[ome-devel] OMERO API Import: Exception on Pixels download inside Insight
Jost Gundelach
omero at gundelacht.de
Wed Mar 5 17:20:02 GMT 2008
Hi there,
we need to import images with ome-3.0-Beta2.3 and wish to archive the
file like in OMERO.importer. This is done by the following code:
ImportContainer container = new ImportContainer(f, d, "unused", true);
OMEROMetadataStore store = new OMEROMetadataStore(conn.getServiceFactory());
OMEROWrapper reader = new ODIPImportReader();
ImportLibrary library = new ImportLibrary(store, reader,
new ImportContainer[] { container });
// WriteImageFile
String fileName = f.getAbsolutePath();
library.setDataset(d);
library.open(fileName);
File[] files2store = new File[] {f};
store.setOriginalFiles(files2store);
library.calculateImageCount(fileName, 0);
List<Pixels> pixId = library.importMetadata(f.getAbsolutePath());
library.importData(pixId.get(0).getId(), fileName, 0,
new ImportLibrary.Step() {
@Override
public void step(int arg0, int arg1) {
System.out.println(arg0 + "," + arg1);
}
});
store.writeFilesToFileStore(files2store, pixId.get(0).getId());
I found the call to writeFilesToFileStore from the
ImportLibrary.importImage, which is not in ome-3.0-Beta2.3 jars, but in
the sources of the branch ! I am a little bit confused about this.
But it seems to work, because OMERO.insight allows to download the
resulting Pixels, but runs into an exception:
java.lang.Exception: Cannot create the file
at
org.openmicroscopy.shoola.env.ui.UserNotifierImpl.showErrorDialog(UserNotifierImpl.java:129)
at
org.openmicroscopy.shoola.env.ui.UserNotifierImpl.notifyError(UserNotifierImpl.java:180)
at
org.openmicroscopy.shoola.env.ui.UserNotifierImpl.notifyError(UserNotifierImpl.java:169)
at
org.openmicroscopy.shoola.agents.util.archived.DownloaderLoader.handleException(DownloaderLoader.java:108)
at
org.openmicroscopy.shoola.env.data.events.DSCallAdapter.eventFired(DSCallAdapter.java:84)
at
org.openmicroscopy.shoola.env.data.views.BatchCallMonitor$1.run(BatchCallMonitor.java:124)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Unknown Source)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at
org.openmicroscopy.shoola.util.ui.UIUtilities.centerAndShow(UIUtilities.java:184)
at
org.openmicroscopy.shoola.util.ui.TinyLoadingWin.setOnScreen(TinyLoadingWin.java:96)
at
org.openmicroscopy.shoola.agents.util.archived.view.DownloaderControl.stateChanged(DownloaderControl.java:121)
at
org.openmicroscopy.shoola.util.ui.component.AbstractComponent.fireStateChange(AbstractComponent.java:103)
at
org.openmicroscopy.shoola.agents.util.archived.view.DownloaderComponent.download(DownloaderComponent.java:194)
at
org.openmicroscopy.shoola.agents.util.archived.view.DownloaderControl.propertyChange(DownloaderControl.java:109)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at java.awt.Component.firePropertyChange(Unknown Source)
at
org.openmicroscopy.shoola.util.ui.filechooser.FileChooser.setFolderPath(FileChooser.java:288)
at
org.openmicroscopy.shoola.util.ui.filechooser.CustomizedFileChooser.approveSelection(CustomizedFileChooser.java:317)
at
javax.swing.plaf.basic.BasicFileChooserUI$ApproveSelectionAction.actionPerformed(Unknown
Source)
at javax.swing.SwingUtilities.notifyAction(Unknown Source)
at javax.swing.JComponent.processKeyBinding(Unknown Source)
at javax.swing.JComponent.processKeyBindings(Unknown Source)
at javax.swing.JComponent.processKeyEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown
Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown
Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.Dialog$1.run(Unknown Source)
at java.awt.Dialog$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Unknown Source)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at
org.openmicroscopy.shoola.util.ui.UIUtilities.centerAndShow(UIUtilities.java:184)
at
org.openmicroscopy.shoola.agents.util.archived.view.DownloaderComponent.activate(DownloaderComponent.java:101)
at
org.openmicroscopy.shoola.agents.treeviewer.editors.DOBasic.download(DOBasic.java:134)
at
org.openmicroscopy.shoola.agents.treeviewer.editors.DOBasic$2.actionPerformed(DOBasic.java:186)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown
Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
What is going wrong here?
Thanks in advance
Best regards
Jost
--
Jost Gundelach, Dipl.-Inf.
c.a.r.u.s. HMS GmbH
Bornbarch 9, D-22848 Norderstedt
Fon: +49.(0)40.5 14 35-0
Fax: +49.(0)40.5 14 35-11 11
Amtsgericht/Register Court: Kiel, HRB 4587 NO
Sitz/Registered Office: Norderstedt
Geschäftsführer/Managing Directors: Karl-Heinz Witt, Dr. Matthias Rath
More information about the ome-devel
mailing list