Skip to content

Instantly share code, notes, and snippets.

View sina-mansour's full-sized avatar
🧠
🤹🧠 Juggling brains!

Sina Mansour L. sina-mansour

🧠
🤹🧠 Juggling brains!
View GitHub Profile
# Blender executed via:
# PYTHONPATH=/home/sina/miniconda3/envs/blender_env/bin/python blender --python-use-system-env
# Notes:
# Setting up blender to use a conda virtualenv:
# https://stackoverflow.com/questions/70639689/how-to-use-the-anaconda-environment-on-blender
# Blender Python API:
# https://docs.blender.org/api/current/info_quickstart.html
# Blender Python tips and tricks:
# https://docs.blender.org/api/current/info_tips_and_tricks.html
@sina-mansour
sina-mansour / blender_visualization_cloth_simulation.py
Created September 30, 2024 05:02
A blender 4.2 python script for cloth simulation along with a transparent brain surface rendered by cycles engine
# Blender executed via:
# PYTHONPATH=/home/sina/miniconda3/envs/blender_env/bin/python blender --python-use-system-env
# Notes:
# Setting up blender to use a conda virtualenv:
# https://stackoverflow.com/questions/70639689/how-to-use-the-anaconda-environment-on-blender
# Blender Python API:
# https://docs.blender.org/api/current/info_quickstart.html
# Blender Python tips and tricks:
# https://docs.blender.org/api/current/info_tips_and_tricks.html
@sina-mansour
sina-mansour / blender_visualization.py
Created September 23, 2024 04:39
Example scripts linking Python and Blender for neuroimaging visualization
import bpy
import math
import numpy as np
import nibabel as nib
import matplotlib.pyplot as plt
from Connectome_Spatial_Smoothing import CSS as css
from cerebro import cerebro_brain_utils as cbu
from cerebro import cerebro_brain_viewer as cbv