<p>If you ever need a rough estimate of the performance of one GPU versus another, I recommend checking out <a href="https://opendata.blender.org/benchmarks/query/">Blender’s benchmarks</a>.</p>
<p>I am excited that the Halide developers have announced that Halide 19 will <a href="https://github.com/halide/Halide/pull/8405">soon to be published</a> on PyPI. <a href="https://halide-lang.org">Halide</a> is a high-level image processing library with bindings in C++ and Python that we use in <a…
<p>One of the features I have been wanting to implementing in Neuronify for a long time is compartmental models. These are used to simulate features such as action potentials running down an axon:</p>
<p>I have for some time been working on a new version of Neuronify, written in Rust. The goal is to make Neuronify more suited for teaching purposes. For instance by making it easier to embed multiple simulations into a single web page. This will make Neuronify better suited to integrate into blog posts and online books.</p>
<p>I got the idea the other day to see if I could get Visula wrapped in Python using PyO3. Last time I played around with PyO3 I was very impressed by how easy it was to use. And once again, making a Python wrapper with PyO3 was a lot of fun.</p>
<p>When introducing others to Halide in Python there is one common feedback I often get: While it is nice to use Halide in Python instead of C++, the syntax is not familiar.</p>
<p>Every now and then, I try to find some time to work on my little visualization library, <a href="https://github.com/dragly/visula">Visula</a>.</p>
<p>We have lately had to read many large [OpenEXR image files][6] in Python at work. Unfortunately, the Python package [OpenEXR][4] loads these files quite slowly. A single one of our files can easily take more than a minute to open. Other software, such as the image viewer [tev][1], loads the same files in a few seconds.</p>
<p>For quite some time now, I have been wanting to make a visualization library in Rust with a focus on both performance and flexibility. I want it to be a library that allows me to take continuously updated streams of data and easily turn them into the visualizations that I want. I also want the syntax to be mostly declarative so that it is easy to read the intent.</p>
<p>I have now added myelinated compartments to the neuron simulator I introduced in my previous post. In addition, I increased the simulation speed and added a control for it. The original speed was a bit slow and made it tedious to follow an action potential along longer dendrites.</p>
<p>I have had the ambition to make a more detailed neuron simulator. Especially after getting requests for such a feature from several users of <a href="https://ovilab.net/neuronify">Neuronify</a>. In particular, I have wanted to make a multicompartmental neuron model based on the <a…
<p>Recently, I wanted to read HDF5 files in Rust and WebAssembly. In particular, I was visualizing some point cloud files from the company where I work, <a href="https://zivid.com">Zivid</a>, in my (still very experimental) personal side project, <a href="https://github.com/dragly/visula">Visula</a>.</p>
<p>For a long time, we have been using the Qt Quick Canvas to draw the lines that indicate connections between neurons and other objects in Neuronify:</p>
<p>Much has improved since last time I tested compiling Neuronify to WebAssembly. The latest version of Qt for WebAssembly, which comes with Qt 5.15.2, performs much better than it did about a year ago. In addition, more functionality has been added that improves the developer experience, such as support for saving and loading files asynchronously. With all of that in place, I decided to give…
<p>I recently joined <a href="https://zivid.com">Zivid</a>, a company that creates machine vision cameras for robotics and automation. The Zivid cameras are based on a technique called structured light, where a projector and a camera are placed next to each other to shine light on and take images of objects.</p>
<p>I have for some time dabbled with the what makes a good programming language for simulations. After having worked with scripts for simulation environments such as <a href="https://neuron.yale.edu/neuron/">NEURON</a>, <a href="https://www.nest-simulator.org/">NEST</a> and <a href="https://briansimulator.org/">Brian</a> for neural…
<p>One of the great strengths of JavaScript and TypeScript is the freedom we get as developers to mix and match programming paradigms and patterns as we see fit. However, as in many other programming languages, this can also make it hard to choose among the many different options.</p>
<p>Recently, I have been programming in both Rust and TypeScript at the same time, which has made me very aware of which language features I miss the most when moving from one to the other.</p>
<p>Recently, I have been inspired to explore the benefits of copy-by-value semantics by talks like <a href="https://www.youtube.com/watch?v=QGcVXgEVMJg">Sean Parent’s “Better Code: Runtime Polymorphism”</a>. This has lead me to experiment with a new container that behaves like a regular value, but still limits the number of copies made of the data it contains.</p>
<p>As mentioned in my post on <a href="https://dragly.org/2017/03/31/uniform-call-syntax/">uniform call syntax in C++</a>, I have become envious of <a href="https://blog.rust-lang.org/2015/05/11/traits.html">traits in Rust</a> and would like us to have something similar in C++. The great thing about traits in Rust is that…
<p>I got my reMarkable tablet last week, and it is great for drawing and taking notes! It almost feels like writing on paper, and I like the fact that it is a device for just that purpose. It has no web-browser, e-mail client or anything that can distract me from my work, which I find refreshing. It’s just for drawing and taking notes.</p>
<p>I just published my first post on the Qt blog about <a href="http://blog.qt.io/blog/2017/11/16/cpu-usage-improvements-in-qt3d/">CPU usage improvements in Qt 3D</a>. In the post, I show how the CPU usage has gone down in recent releases and some of the things we did to achieve this. In later posts, I plan to write about which memory optimizations we…
<p>If you are working on the Qt source code, you likely want to compare your work with the latest stable branches for benchmarking or testing. However, once you checkout a different branch, <code>make</code> will often rebuild everything that you were working on. This can take a long time, making it hard to quickly compare with the latest stable build.</p>
<p>While looking into uniform call syntax in C++, I stumbled onto how some libraries use the <code>|</code> operator to create pipable functions. Paul Fultz II has a <a href="http://pfultz2.com/blog/2014/09/05/pipable-functions/">good tutorial</a> on how to create your own pipable functions. However, I wanted to also make existing free functions…
<p><a href="http://pyqt.org">PyQt</a> and <a href="http://pyside.org">PySide</a> are Python bindings for <a href="http://qt.io">Qt</a>. I will focus mainly on PyQt in this post, but most of what I write is also the case for PySide. Both are a common choices for adding a GUI to a Python application.</p>
<p><strong>Update:</strong> You might also be interested in the <a href="https://news.ycombinator.com/item?id=11578317">discussion on Hacker News</a>.</p>
<p>In <a href="http://cinpla.org">CINPLA</a> we are developing teaching material for a new course in biology and programming. One topic we’re working on is that of bioinformatics and DNA. I figured that an artistic rendering of the DNA double helix would be nice to have and decided to try and make one in <a href="http://blender.org">Blender</a>. At first I considered…
<p>I recently started working on a new C++ library for reading and writing HDF5 files. I got the idea when I was working on a few files in Python and C++ at the same time. The Python library h5py is just way more comfortable than the HDF5 C++ API. But with the new features in C++11 and C++14, I figured it should be possible to make a C++ library that is just as easy to use as h5py. And I must…
<p>I have written about unit testing in <a href="http://qt.io">Qt Creator</a> on <a href="https://dragly.org/2014/03/13/new-project-structure-for-projects-in-qt-creator-with-unit-tests/">multiple</a> <a href="https://dragly.org/2013/04/19/setting-up-unittest-with-qt-creator/">occasions</a> earlier. Since…
<p>I have been inspired to learn Rust and Julia lately. The idea was to use these promising languages in all of my new projects. I wanted to learn Rust because it is a safe and fast replacement for C++. I wanted to learn Julia because it is a language tailored for scientific use that might someday replace Python.</p>
<p>I always use <a href="http://doc.qt.io/qt-5/qtquick-index.html">QML with Qt Quick</a> for GUI programming. It’s incredible both for prototyping and larger applications. I find it easy to express myself in QML, because it is so flexible. It’s declarative. You can bind a button’s position to the value of a slider in just one line. Not that you’d ever want to do that, but…
<p>Kunstige nevrale nettverk er en etterligning av nervecellene våre i hjernen. De skal brukes til å gjøre datamaskiner like flinke til å lære som mennesker og dyr. Dette gjøres ved å herme etter hvordan hjernen er bygd opp.</p>
<p>Da var det på tide med et nytt <a href="http://blender.org">Blender</a>-prosjekt igjen. Etter å ha lest om mulighetene til å lage <a href="http://www.aversionofreality.com/blog/2014/3/15/project-maiko-understanding-cycles-toon-shaders">tegneserieaktige materialer</a> bestemte jeg meg for å teste dette ut på en 3D-figur av en…
<p>Da jeg fikk jobben som stipendiat ble jeg med i en gruppe ved navn <a href="http://cinpla.org">CINPLA</a>. Gruppen er dannet for å kombinere eksperimenter og simuleringer innen hjerneforskning.</p>
<p>This apps shows your realtime data from all your nearest stops. Add all stops of your choice and the app will immediately fetch information about the next travels from Ruter.</p>
<p>I was pointed to John Hunter’s <em><a href="http://nipy.sourceforge.net/nipy/devel/faq/johns_bsd_pitch.html">Why we should be using BSD</a></em> and came to think about how I rather tend to advocate using the GPL license. <a href="http://en.wikipedia.org/wiki/Richard_Stallman">Richard Stallman</a></p>
<p>For et par dager siden lå jeg våken i sengen og innså at dette var en av de nettene hvor jeg ikke kom til å få sove. Heldigvis sovner jeg alltids til slutt, men det går fort noen timer fra jeg legger meg til jeg faktisk sovner. Andre ganger sovner jeg umiddelbart, litt som en lysbryter som skrus av akkurat klokka 22:04.</p>
<p><a href="http://neuralensemble.org/sumatra/">Sumatra</a> is a great tool for reproducibility and provenance when you are running numerical simulations. Keeping your work reproducible ensures that you and others will be able to check your results at a later time, while provenance is to keep track of where your results came from in the first place.</p>
<p>A <a href="https://qt.gitorious.org/qt/qt3d/commit/5bc5eaf6886bd8187746ef8b29bacb1263c6178a">recent commit</a> pushed to the <a href="https://qt.gitorious.org/qt/qt3d/">Qt3D repository</a> breaks building Qt3D against Qt version 5.2 and older with the following error message:</p>
<p><em><strong>Note:</strong> This is a new version of <a href="https://dragly.org/2013/04/19/setting-up-unittest-with-qt-creator/">an earlier post</a>, with a revised project structure.</em></p>
<p>*Edit: In QtCreator 3.1, the method used here (using resource files) will become the default way to perform deployment on all platforms. I.e., this guide is only useful if you have created your project using QtCreator < 3.1.<br /> *</p>
<p>I needed a new sound card for <a href="http://ubuntu.com">Ubuntu</a> that would allow me to do some recording and playback easily. After a bit of searching and testing, I figured I would go with the <a href="http://us.focusrite.com/usb-audio-interfaces/scarlett-2i2">Focusrite Scarlett 2i2</a>, which is a USB sound card with 2 XLR + jack inputs, stereo…
<p>In this post I will explain how to write to the binary <a href="http://lammps.sandia.gov/">LAMMPS</a> file format from C++, using data stored in <a href="http://arma.sourceforge.net/">Armadillo</a> vectors and matrices. After running the example in this post you should be able to open the resulting file in <a…
<p>While preparing for a presentation I’m giving on Python scripting in <a href="http://blender.org">Blender</a>, I figured I’d also try out some new features . One such feature is in <a href="http://wiki.blender.org/index.php/Doc:2.6/Manual/Modeling/Meshes/Editing/Sculpt_Mode">Sculpt Mode</a>, where dynamic topology is now allowing…
<p>Sometimes you want to copy some data files to the same folder as your final executable when you are building with qmake in a different directory than your source code. This is what Qt Creator does by default, so this is quite often needed.</p>
<p>While Qt3D has a transform for drawing billboards, it is not very useful if you are drawing thousands of particles. This is because the transform can only be applied to one object at the time, and using thousands of objects is never a good idea in neither OpenGL or Qt. This is simply because the overhead of each object is very large, both in terms of memory and performance.</p>