This is a great start. I will try these options out and get back to you. It
is fine to use files for now because I can just create temp files in the
Java temp directory. I had gone down the route of used the jmoldata main
method directly, however it seemed like it spun off another thread to do
the image file generation because right after the main method exited the
image was still not ready, but was ready shortly afterwards. Does jmoldata
start another read process for the generation?
Roshan Punnoose
On May 25, 2013, at 12:36 AM, Robert Hanson <[email protected]> wrote:
Yes, but you can't just output raw bytes to system out. Best way, if it
will work for you, is to write them to a temporary file and then read that.
If you had a separate Java program that was using Jmol as a library, then
you could call methods in Jmol that would deliver the raw image bytes. Note
that you do not have to actually have a graphics display to do this; you
can do it with JmolData.jar instead of Jmol.jar and save some overhead,
since JmolData.jar has no display. The format for that is something like
this:
java -Xmx2048m -jar /Jmol/JmolData.jar -nj "load '/testSet/dna-a.pse'
filter 'DORESIZE;DOCACHE';" -g0x0 -w 'PNGJ:/testSet/dna-a/jmol.png';
That is a bit more than you need. This particular example is especially
tuned to PyMOL session file reading (DORESIZE and g0x0 indicating that we
want to generate the exact image size saved in the PyMOL session; DOCACHE
indicates that we want to cache structures in the output file for fast
regeneration.
"PNGJ" creates more than you need - an image with complete ZIP file
appended that allows the image itself to be used to recreate the model and
the "image" file to also be extractable using 7zip. Doesn't sound like you
need that. So just leave that out. You will need something like this:
java -Xmx2048m -jar /Jmol/JmolData.jar -nj "load '/testSet/x.mol' "
-g500x500 -w '/testSet/dna-a/jmol.png';
If you know specifically how to output bytes to the output stream, let me
know, and I could create a command line option for that, perhaps.
Bob
On Fri, May 24, 2013 at 1:30 PM, Roshan Punnoose <[email protected]> wrote:
> Hi,
>
> I want to use Jmol internally to read a mol file string and retrieve the
> image created as bytes. Is this possible?
>
> Roshan
>
>
> ------------------------------------------------------------------------------
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring service
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>
--
Robert M. Hanson
Larson-Anderson Professor of Chemistry
Chair, Chemistry Department
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr
If nature does not answer first what we want,
it is better to take what answer we get.
-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users