Hi all,
Finally it's working: I can save and read any ImagePlus as a Tiff file into a PostgreSQL database using the JDBC driver. For stacks only the first slice is read, but it could easily be adapted to save stacks in full. I gave up on using piped streams as these could not guarantee that the stream was completely written when the database was attempting to use it for saving the image (there the truncated images). Find it here: http://www.pensament.net/java/other_plugins.html at the very bottom. Albert Albert Cardona Institute of Neuroinformatics Tel : +41 1 635 3052 University/ETH Zurich Fax : +41 1 635 3053 Winterthurerstrasse 190 acardona (at) ini phys ethz ch Zurich 8057, Switzerland www.ini.unizh.ch |
Hi albert,
Good job! Although, I wonder how useful it will be to store entire images in database. I chose alternative approch to my work. I store the images on a local disc in a folder tree, but store their various measurements in a (remote) MySQL database with thumbnails kept in the database. This is beacuse the database connections break somwehow easily in my experience. best regards Dimiter Prodanov |
Dear experts,
saving 32bit tiff-images with ImageJ 1.34s under MacOS9.1 (MRJ_2.2.5) repeatedly fails with: --------------------------------------------------------------- results in java.lang.NoSuchMethodError: java.lang.Float: method floatToRawIntBits(F)I not found at ij.io.ImageWriter.writeFloatImage(Compiled Code) at ij.io.ImageWriter.write(ImageWriter.java:188) at ij.io.TiffEncoder.write(Compiled Code) at ij.io.FileSaver.saveAsTiff(FileSaver.java:82) at ij.io.FileSaver.saveAsTiff(FileSaver.java:70) at ij.io.FileSaver.save(FileSaver.java:45) at ij.Executer.runImageCommand(Executer.java:148) at ij.Executer.runCommand(Executer.java:133) at ij.Executer.run(Executer.java:63) at java.lang.Thread.run(Thread.java) --------------------------------------------------------------- (A file is created but the image has zero values only.) Is this a general problem? (If not what can I do to make it disappear?) Best -- Herbie ------------------------ <http://www.gluender.de> |
In reply to this post by Albert-5
Hi Dimitri,
Well this draft program is just to see how easy and fast it is to save entire images into a database. It turns out it is both easy and quite fast, even in the slow hard drive of the laptop from which I'm coding. The target is a modelling program that will require very little RAM but will be capable of enabling the assembling several z-levels of a 30x30 grid of 1MB images, for the ultimate purpose of outlining structures and generating 3D models for them. So the trick is to dynamically load and unload images in order to show just the ones within view, or their scaled-down versions when looking at the whole thing zoomed out. The reasons why we choose the database approach is in the first place to make the whole thing independent of the underlying operating system, the same way ImageJ itself is, and second, to make it really easy to copy the user "file", in this case a file containing data exported from the database, and use it in any other computer setup directly. Whish me luck, the project is quite challenging even though all the pieces are quite working, but separately at the moment. If any of the code you have for managing the MySQL database is GPLed, I would love to have a look at it for study, basically to save me trouble with known-to-work solutions. Also: do you have any experience with the java document object (JDO) model and databases? Is it really as bad as it looks, with all the required xml files for each class and the numerous dependencies each implementation I've seen needs? (one would think the JDO guys never looked at reflection or something, same with serialization). All the best, Albert Albert Cardona Institute of Neuroinformatics Tel : +41 1 635 3052 University/ETH Zurich Fax : +41 1 635 3053 Winterthurerstrasse 190 acardona (at) ini phys ethz ch Zurich 8057, Switzerland www.ini.unizh.ch |
Free forum by Nabble | Edit this page |