ChemicalTerms molImage conversion question

User 873a9ae9d0

01-06-2011 22:13:53

Hi,


I try to convert molecules to images and use molImage() out of ChemicalTerms


such as :


var result = document.MView.evaluateChemicalTerms("molImage('png:w1000,h1000')", 0);


My question is what IS the 'textlike' response I get back from this call ? I did suspect it is a base64 enocoded string, but the response contains illegal base64 characters, i.e. the reponse can not be base64 decoded.


I am wondering what I am suposed to do with the response to get to an image I can render.


Any help/feedback is appreciated


Best regards
Hans-Juergen


 

ChemAxon 7c2d26e5cf

02-06-2011 12:34:48

I do not understand the attached statement.


Is molImage() a custom JavaScript function that you have defined?


Why do you feed the output of this function with chemical terms evaluator? I assume molImage creates an image. But Chemical terms does not accept images as I know.


About the usage of the Chemical terms, my colleague, Zsolt can tell you.

User 873a9ae9d0

02-06-2011 12:53:33

HI Tamas,


 


molImage is a Chemical Term function that comes from ChemAxon. It allows to pass a molecule (the 0 in the call is the selected index of a molecule in Marvin) and returns an image of the molecule.


You can use the chemicalterms.html example (in the ..examples/applets/view folder) that comes with Marvin, add this function to the list of expressions , choose a molecule and click evaluate and you can see that the output box of the example html page is filled with some funny characters.


My question was really about those 'funny characters'. To be usefull for me I need to know how to interpret those 'funny characters. I assume it is some kind of encoded string, but I do not know how to encode the result. It is for sure not base64, it must be something else. I assume someone at ChemAxon must know about what coding is used.


In the meantime this problem is not so urgent anymore, since I could solve my original problem in a different way.


Still interested in an answer. It is always good to understand how the ChemAxon Chemical terms function work. But again, do not hurry. As stated my original problem is solved using a different approach.


Nevertheless I appreciate your efforts.
Best regards
Hans-Juergen


 

ChemAxon 7c2d26e5cf

02-06-2011 15:21:55

It seems I responsed too fast. :)


I should have waited until Zsolt answer your question. Chemical Terms is his business. I pass it to him.

User 873a9ae9d0

02-06-2011 17:37:45

No problem, Tamas !


Interested to hear from Zsolt.


Hans-Juergen

ChemAxon e08c317633

07-06-2011 17:15:27

Hi Hans-Juergen,


Currently molImage() Chemical Terms function does not work correctly from JavaScript. When


document.MView.evaluateChemicalTerms("molImage('png:w1000,h1000')", 0);

is called, then the result of molImage('png:w1000,h1000') - which is a byte[] - is incorrectly converted to String.


We will fix this issue. molImage() Chemical Terms function returns the correct result when it's called via Java API (chemaxon.jep.Evaluator).


Zsolt

User 873a9ae9d0

07-06-2011 21:46:05

Hi Zsolt,


 


thanks for the info. As already stated I do need a fix anymore (I solved my problem without the need of converting structures to images), but it is good to know that (by design) a) a byte array is returned and b) that this does not work currently. Hope you can fix the problem.


Best wishes


Hans-Juergen