Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Genertation Python modules #30

Closed
TheChymera opened this issue Sep 20, 2018 · 5 comments
Closed

Genertation Python modules #30

TheChymera opened this issue Sep 20, 2018 · 5 comments

Comments

@TheChymera
Copy link

TheChymera commented Sep 20, 2018

I am trying to get the new scripting features installed, but running:

lazbuild -B --lazarusdir="/usr/share/lazarus/" --pcp="with-packages" simplelaz.lpi

This seems to successfully compile and results in this log, but will not produce any "*.py*" files I can place into my $PYTHONPATH. See the output of tree after running the aforementioned command, here.

Perhaps expectedly, python -c 'import gl', gives me:

ModuleNotFoundError: No module named 'gl'

Am I misunderstanding how this is supposed to work, or has lazbuild omitted to build something?

@neurolabusc
Copy link
Owner

You will need to tell Surfice/MRIcroGL the location of your Python installation. It will attempt to find this when it starts, but this may not work for distributions I have not used like Gentoo. If nothing else, the Pascal scripting is always built into Surfice/MRIcroGL. You may need to edit the file ~/.mricrogl/MRIcroGL.ini and set "PyLib" to point to the location of your Python. Once this is done, you will be able to run Python scripts from the MRIcroGL/Surfice scripting window. All the functions are in-built and provide natively compiled performance. The next generation MRIcroGL 1.2 will further extend these features.

I suggest you follow these instructions.

@TheChymera
Copy link
Author

TheChymera commented Sep 21, 2018

Ah, I see.

The issue was more the uncommon usage method. I would echo @pjkohler's surprise that the Python functionality can only be used from within MRIcroGL or as an argument to the command. I had expected it to be importable in the Python interpreter (since that is how Python bindings, including for non-Python libraries, tend to work). My bad. Is there, however, any chance that MRIcroGL's excellent rendering functionality could be used directly from the interpreter in the foreseeable future?

@pjkohler
Copy link

I second the request above from @TheChymera.

@neurolabusc
Copy link
Owner

I think this usage is pretty typical of natively-compiled OpenGL tools, e.g. tools like Blender have similar functionality. For your use, perhaps you should consider FSLeyes and Jupyter Notebook. FSLeyes is a terrific tool that is primarily written in Python, with both the strengths and limitations that implies. Both tools are open source and you are free to develop and extend as you wish. I have limited resources and a lot of commitments. Personally, I think this is a case of horses for courses: I use FSLeyes when it is the right tool for my aims. Its hard to justify engineering effort when an excellent, actively developed open source tool with the desired features already exists.

@neurolabusc
Copy link
Owner

Closing this issue. If anyone wants to actively develop richer support, feel free to create a fork, submit pull requests and re-open this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants