Looking around I see that "JVX" stands for Java View geometry file. JVXL is probably better?

René, OK, I understand what the code is doing now. I calculate that inclusion of interpolation smoothing still allows for the inside/outside idea, but along with that, an accounting is necessary of the fractional distance along each edge of the isosurface "voxel" to offset the surface point. Assuming that that fractional distance can be assigned a number 0-63, I calculate a new compression ratio of 500:1 instead of 1000:1 with straight 1-byte-per-edge storage. This changes to about 600:1 if the range can be simplified to 0-7 and these are stored two values per ascii character -- (probably not worth it to compress that much). See http://www.stolaf.edu/people/hansonr/jmol/test/proto/ch3cl.jvxl, which is now about 7400 bytes and includes 0-7 range interpolation data.

A script command describing an orbital might be as long as 4000 characters. My idea would be to put this in a script file and just call it. Or, maybe we don't need the inline idea, and we can just load the orbital.

An interesting thing about cube (jvxl) files is that once read, the "orbital" can be rotated and scaled to any size and any position, so this might just be the way to express generic hybrid orbitals for display at any atom. A bit of calculation and some good syntax should, for example, allow:


orbital sp3 1.0 (oxygen and connected(2))

orbital p 0.8 (carbon and connected(3))

(where the number is the scale) all based on a single hardwired (or user-loaded?) isosurface representing a single tear-drop-shaped orbital lobe.

The idea here would not be to be exact in every detail -- just provide enough of a surface for depicting the essence of the orbital in a compact format.

Bob



René Kanters wrote:
Hi Bob,

That sounds indeed interesting and promising.

I do seem to recall (it has been a while since I played with the cube files and my memory isn't very good :-) ), that when I tried to reduce a cube file to 0s and 1s and set the cutoff at 0.5 (to try to keep the file size down), the generated surfaces were very angled looking. So I think (and didn't check) that in the code some kind of interpolation is done, i.e., the actual values are used to generate a smoother representation of the data. It looks like you are capturing the result of this 'pre-processing'.

Personally, I think it is a great idea to implement that.

René

On May 22, 2006, at 12:24 AM, Bob Hanson wrote:

Jmol developers:

I've been thinking tonight about the orbital problem.

What if I told you I could compress CUBE file data for molecular orbital display with a compression ratio of 1000:1? For example, turn a 3.7 Mb cube file representing an orbital into a file of about 4K. Would that be good?

What if I told you we could have "inline" orbitals -- orbitals just defined right on the script line like this:

isosurfce orbital1 "inline" ...
color $orbital1 red


It's possible! Here's the idea:

Really what an isosurface is either:

1) a bitset -- an n x m x p set of points, each of which is either the point is or is not within a certain cutoff, or
2) a set of 35-value color indices representing a color of the  rainbow.

OK, so for an orbital we have (1), for a mapped charge density plot or the like, we have (2). Right now I'm focusing on (1), orbitals. They have just one color.
(We could do two colors as well, but for now, just one.)

I was looking at a cube files and realized that > 99.9% of it is garbage. Look, we don't need to be transmitting cube files to view orbitals. All we need are the key "surface" points.

So I propose a new file format. I'll call it JVX for "Jmol Voxel" for now.

Here is a sample JVX file. (I'm making this up. Bear with me.) The file is actually just 14 lines and 3630 bytes long. It looks a lot like a cube file (EXACTLY like a cube file, in fact, so the cube file reader will read the coordinates).

 Title Card Required potential=scf
 Electrostatic potential from Total SCF Density
   -5   -8.140940   -8.140940   -8.643459
   50    0.333333    0.000000    0.000000
   50    0.000000    0.333333    0.000000
   55    0.000000    0.000000    0.333333
    6    6.000000    0.000000    0.000000   -2.130707
    1    1.000000    0.000000    1.932284   -2.775380
    1    1.000000    1.673407   -0.966142   -2.775380
    1    1.000000   -1.673407   -0.966142   -2.775380
   17   17.000000    0.000000    0.000000    1.241787
-1 633 0.05
-2 487 0.05
39562 2 52 4 50 5 50 5 51 3 2472 4 50 6 48 7 48 8 47 8 47 7 49 6 51 2 2307 4 49 7 48 8 46 9 46 10 45 10 45 9 47 8 48 6 51 3 2250 6 48 8 46 10 45 10 45 10 45 11 44 11 44 11 45 9 47 8 49 4 2140 3 50 7 47 9 46 10 44 12 43 13 42 18 37 20 36 19 36 19 37 18 38 10 2 2 43 6 2083 3 50 7 47 10 45 11 43 14 41 20 35 22 33 22 34 22 33 22 34 20 35 19 37 17 39 8 47 6 49 4 1922 2 50 8 46 10 45 12 42 21 34 22 33 23 32 24 31 24 32 23 32 23 32 22 34 20 35 18 37 10 45 8 48 6 49 5 1865 7 47 10 44 19 35 22 33 24 31 24 31 25 30 25 30 25 31 24 31 23 32 22 33 21 34 19 36 11 45 8 47 8 48 6 51 1 1758 6 47 16 38 21 34 22 32 24 31 25 30 25 30 26 29 26 29 25 30 25 31 23 32 22 33 20 35 12 43 10 45 9 47 8 48 5 1756 6 48 17 37 20 34 23 31 25 30 25 30 26 29 26 29 26 29 26 29 25 30 25 30 24 31 22 33 19 37 11 44 10 45 9 47 7 51 2 1703 6 47 17 37 21 33 23 31 25 30 26 29 26 29 26 29 26 29 26 29 25 30 25 30 24 31 22 33 20 35 12 44 10 45 9 47 7 50 3 1703 6 47 17 37 21 33 23 31 25 30 26 29 26 29 26 29 26 29 26 29 25 30 25 30 24 31 22 33 20 35 12 44 10 45 9 47 7 50 3 1702 6 48 17 37 20 34 23 31 25 30 25 30 26 29 26 29 26 29 26 29 25 30 25 30 24 31 22 33 19 37 11 44 10 46 8 48 6 51 1 1702 7 47 11 2 3 38 20 35 22 32 24 31 25 30 25 30 25 30 25 30 25 30 25 31 23 32 22 33 20 35 12 43 10 45 9 47 7 49 5 1755 7 47 10 44 19 35 22 33 23 32 24 31 25 30 25 30 25 31 24 31 23 32 22 33 21 34 19 36 11 45 8 47 7 49 5 1756 3 50 8 46 10 45 12 42 20 35 22 33 23 32 24 31 24 32 23 32 22 34 21 34 20 35 18 37 10 46 7 48 6 50 4 1811 3 50 7 47 10 45 11 43 13 42 20 35 21 34 22 34 21 34 21 35 20 36 18 37 16 40 8 47 5 51 2 1923 2 50 7 47 9 46 10 44 12 43 12 43 14 42 18 37 19 37 18 37 17 40 8 48 6 2137 6 48 8 46 9 46 10 45 10 45 10 45 11 44 10 46 9 47 7 51 2 2196 3 51 6 48 8 46 9 46 9 46 9 47 8 47 8 48 6 2360 3 51 6 48 7 48 7 48 7 48 7 49 5 2526 3 52 4 51 4 52 2 39966 47922 3 52 3 52 2 2582 4 51 5 50 5 50 5 51 4 9 1 54 1 2406 3 51 5 49 7 8 1 39 7 6 5 37 7 5 6 38 6 5 7 38 4 6 7 39 2 7 6 50 5 2294 3 51 6 7 3 38 7 5 6 37 8 3 8 36 8 3 8 36 8 2 10 36 7 2 10 37 5 4 8 39 3 5 8 48 6 51 2 2186 3 9 2 40 6 5 6 37 8 3 8 36 20 35 20 35 20 35 20 36 19 36 7 2 10 37 5 4 8 38 4 6 6 40 2 2142 4 7 5 38 6 4 8 36 20 35 20 35 21 34 21 34 21 34 21 35 19 36 8 1 10 36 6 4 8 37 5 7 4 40 3 2088 2 7 6 38 7 3 8 37 19 35 21 34 21 34 14 2 5 34 14 2 5 34 21 34 20 35 20 35 8 3 8 36 7 6 5 38 5 50 4 1990 1 42 2 7 7 37 7 2 10 36 19 35 21 34 14 2 5 34 13 1 2 1 4 34 13 1 2 1 4 34 14 2 5 34 21 34 20 35 8 2 9 36 7 5 6 37 7 49 5 1989 1 42 2 7 7 37 7 2 10 36 19 35 21 34 14 2 5 34 13 1 2 1 4 34 13 1 2 1 4 34 14 2 5 34 21 34 20 35 8 3 8 36 7 5 6 37 7 49 5 2032 2 7 6 38 7 3 8 36 20 35 21 34 21 34 14 2 5 34 14 2 5 34 21 34 20 35 20 35 8 3 8 36 7 6 5 38 5 51 3 2032 4 7 5 38 6 4 8 36 20 35 20 35 20 35 21 34 21 34 20 36 19 36 7 2 10 36 6 5 7 37 5 7 4 40 3 2087 3 51 6 5 6 37 8 3 8 36 20 35 20 35 20 36 19 36 19 36 7 2 10 37 5 4 8 38 4 7 5 2184 3 51 5 8 2 39 7 5 6 37 8 4 7 36 8 3 8 36 8 2 9 37 7 3 8 38 5 4 8 39 3 6 7 49 5 52 1 2186 3 51 5 49 7 48 7 6 4 38 7 6 5 38 6 5 6 39 4 6 6 50 5 50 4 2349 4 51 5 50 5 50 5 51 3 2582 2 53 2 48271

OK, so that's 3630 bytes, and THIS IS ALL THAT IS NEEDED TO DISPLAY THE TWO SURFACES CONTAINED IN http://www.stolaf.edu/people/hansonr/ jmol/test/proto/ch3cl.cub (3.6 Mb).

The line starting with -1 clues us in that this is NOT a cube file. A cube file here would have a positive number indicating the number of surfaces in the file; my number is negative, starting a list of surfaces in the file, but telling us that this is a JVX file instead. The other numbers on those two lines are the number of data points and the cutoffs, but they might be color ranges -- anyway, there's a line there for some sort of information. What do we need there? We could discuss that.

That last block of numbers is actually just two separate lines, and there are no blank lines. See http://www.stolaf.edu/people/hansonr/ jmol/test/proto/ch3cl.jvx

Q: Where did this file come from?
A: The Jmol applet, of course! I just added a few lines to Isosurface.java, and these numbers appeared on the Java console when I ran the isosurface script at

file:///C:/temp/jmol/proto/new.htm?model=ch3cl.jvx

For now I just added the header information and clipped it all into a file by hand. But Jmol could easily create this whole thing.

Q: What does it mean?
A: It's really just TOO simple:

 39562 2 52 4 50 5 50 5 51 3 2472 4 50 6 48 7 48 8 47 8 47 ...

says:

"The first 39562 data points are outside the cutoff. The next 2 are inside, the next 52 are outside, the next 4 are inside, the next 50 are outside..."

Q: What more do we need?
A: You tell me, but I say you could just toss those numbers into a script and have an isosurface WITHOUT any underlying file:

isosurface mydata1 "inline" {-8.140940 -8.140940 -8.643459} 50 {0.333333 0 0} 50 {0 0.333333 0} 55 {0 0 0.333333} 633 39562 2 52 4 50 5 50 5 51 3 2472 4 50 ...

isosurface mydata2 "inline" {-8.140940 -8.140940 -8.643459} 50 {0.333333 0 0} 50 {0 0.333333 0} 55 {0 0 0.333333} 487 47922 3 52 3 52 2 2582 4 51 5 50 5 50 5 51 4 9 1 54 1 2406 3 51 5 49 7 8 1 39 7 ...

OK, it's a long line for a script. But what of it?

Q: What's the catch?
A: You can't adjust the cutoff. It's going to be *THE* representation of the surface for that particular web page.

My point is that THAT is all we need. As a web designer you would first load a cube file into Jmol.jar or the applet and experiment with a cutoff. Then have Jmol create the .jvx file for you. Maybe using something like "show isosurfaces" or "getproperty isosurfaceInfo". Then instead of placing the cube file on the web, put the .jvx file there, or maybe just create the orbital as an inline isosurface.

What do you think?

Bob

--
--

Robert M. Hanson, [EMAIL PROTECTED], 507-646-3107
Professor of Chemistry, St. Olaf College
1520 St. Olaf Ave., Northfield, MN 55057
mailto:[EMAIL PROTECTED]
http://www.stolaf.edu/people/hansonr

"Imagination is more important than knowledge." - Albert Einstein



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel? cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers




-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

--
--

Robert M. Hanson, [EMAIL PROTECTED], 507-646-3107
Professor of Chemistry, St. Olaf College
1520 St. Olaf Ave., Northfield, MN 55057
mailto:[EMAIL PROTECTED]
http://www.stolaf.edu/people/hansonr

"Imagination is more important than knowledge." - Albert Einstein



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to