<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Allard Hendriksen | CI @ CWI</title>
    <link>https://blog.allardhendriksen.nl/</link>
    <description>Recent content on Allard Hendriksen | CI @ CWI</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Thu, 29 Oct 2020 00:00:00 +0100</lastBuildDate><atom:link href="https://blog.allardhendriksen.nl/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>SVG support has landed in tomosipo!</title>
      <link>https://blog.allardhendriksen.nl/cwi-ci-group/tomosipo_announce_svg_support/</link>
      <pubDate>Thu, 29 Oct 2020 00:00:00 +0100</pubDate>
      
      <guid>https://blog.allardhendriksen.nl/cwi-ci-group/tomosipo_announce_svg_support/</guid>
      <description>In tomosipo, you can now create animated SVGs! In a Jupyter notebook, the code below shows an animation of a cone beam geometry:
import tomosipo as ts ts.svg( ts.volume(), ts.cone(angles=50, shape=2, src_orig_dist=2.5, src_det_dist=6), duration=3, base64=True, ) 
You can click on the animation to pause and unpause. To scroll through the animation, keep your mouse pressed down and move from left to right.
To save the svg for further processing in, for instance, Inkscape, execute:</description>
    </item>
    
    <item>
      <title>Benchmarking a custom CUDA kernel versus the PyTorch-provided convolution operator</title>
      <link>https://blog.allardhendriksen.nl/cwi-ci-group/20201023170553-benchmarking_custom_convolutions_versus_pytorch_convolutions/</link>
      <pubDate>Fri, 23 Oct 2020 17:05:00 +0200</pubDate>
      
      <guid>https://blog.allardhendriksen.nl/cwi-ci-group/20201023170553-benchmarking_custom_convolutions_versus_pytorch_convolutions/</guid>
      <description>Is it possible to write a custom CUDA kernel that outperforms the standard convolution operator in PyTorch?
For historical reasons, I have implemented custom convolutions using CUDA for use in PyTorch. These convolutions allowed my to work around PyTorch limitations regarding memory safety, leading to an efficient implementation of the Mixed-scale dense network architecture (Pelt and Sethian 2017). Recently, a user asked why I had implemented these convolutions. To answer that question, I decided to benchmark and compare my custom implementation to the standard convolutions in PyTorch.</description>
    </item>
    
    <item>
      <title>Three-dimensional full-field X-ray orientation microscopy in tomosipo</title>
      <link>https://blog.allardhendriksen.nl/cwi-ci-group/three_dimensional_full_field_x_ray_orientation_microscopy_in_tomosipo/</link>
      <pubDate>Fri, 02 Oct 2020 00:00:00 +0000</pubDate>
      
      <guid>https://blog.allardhendriksen.nl/cwi-ci-group/three_dimensional_full_field_x_ray_orientation_microscopy_in_tomosipo/</guid>
      <description>Goal This blog post is written to evaluate the possibility of including the geometry described in (Viganò et al. 2016) in a future paper about tomosipo.
 The first goal is to check whether I have correctly understood the concepts in the cited paper. The second goal is to examine how to efficiently describe this geometry using tomosipo.  Introduction Conventional X-ray absorption tomography can be used to determine the density of the interior of an object.</description>
    </item>
    
    <item>
      <title>Advent of tomosipo: s006_3d_data</title>
      <link>https://blog.allardhendriksen.nl/cwi-ci-group/advent-of-tomosipo-s006_3d_data/</link>
      <pubDate>Thu, 30 Jul 2020 14:38:00 +0200</pubDate>
      
      <guid>https://blog.allardhendriksen.nl/cwi-ci-group/advent-of-tomosipo-s006_3d_data/</guid>
      <description>The subject of today is 3D data. As for the s002_data2d post, this is going to be short, because data objects are rarely useful in tomosipo.
First, we import the volume and projection geometry from the ASTRA code example:
import astra import numpy as np import tomosipo as ts # Create a 3D volume geometry. # Parameter order: rows, colums, slices (y, x, z) vol_geom = astra.create_vol_geom(64, 48, 32) # 2 projection directions, along x and y axis resp.</description>
    </item>
    
    <item>
      <title>Chambolle-Pock algorithm on the GPU using tomosipo</title>
      <link>https://blog.allardhendriksen.nl/cwi-ci-group/chambolle_pock_using_tomosipo/</link>
      <pubDate>Thu, 30 Jul 2020 09:06:00 +0200</pubDate>
      
      <guid>https://blog.allardhendriksen.nl/cwi-ci-group/chambolle_pock_using_tomosipo/</guid>
      <description>The Chambolle-Pock algorithm, or primal-dual hybrid gradient algorithm, is a convex optimization algorithm. This algorithm can be used to solve the total-variation minimization optimization problem in tomograpy. In this blog post, we follow the exposition by sidky-2012-convex-optim to obtain a working implementation of PDHG for tomography. We solve the following optimization problems
\begin{align} \label{eq:1} \text{argmin}_{x} &amp;amp;||A x - y ||_2^2 &amp;amp;(\text{Least-squares}) \\\
\text{argmin}_{x} &amp;amp;||A x - y ||_2^2 + \lambda || |\nabla x| ||_1 &amp;amp;(\text{Total-variation minimization}) \end{align}</description>
    </item>
    
    <item>
      <title>Advent of tomosipo: s005_3d_geometry</title>
      <link>https://blog.allardhendriksen.nl/cwi-ci-group/advent-of-tomosipo-s005_3d_geometry/</link>
      <pubDate>Wed, 29 Jul 2020 14:33:00 +0200</pubDate>
      
      <guid>https://blog.allardhendriksen.nl/cwi-ci-group/advent-of-tomosipo-s005_3d_geometry/</guid>
      <description>We have finally moved on to 3D geometries! ASTRA supports parallel-beam and cone-beam geometries. For both geometries, it supports a regular geometry that is useful in most cases, and a &amp;ldquo;vector&amp;rdquo; geometry that can be used to model arbitrary geometries.
Regular parallel beam In ASTRA, you can define a regular 3D parallel beam geometry like so. This one rotates in a full circle around the z-axis (rather than 180°) stopping at 48 locations.</description>
    </item>
    
    <item>
      <title>Advent of tomosipo: s004_cpu_reconstruction</title>
      <link>https://blog.allardhendriksen.nl/cwi-ci-group/advent-of-tomosipo-s004_cpu_reconstruction/</link>
      <pubDate>Tue, 28 Jul 2020 16:14:00 +0200</pubDate>
      
      <guid>https://blog.allardhendriksen.nl/cwi-ci-group/advent-of-tomosipo-s004_cpu_reconstruction/</guid>
      <description>This is going to be a short post, because tomosipo does not support CPU reconstruction. The ASTRA-toolbox does not support CPU reconstruction algorithms in 3D, so there are no plans to add support either.
Thanks to Francien Bossema for spotting a typo in this short post!</description>
    </item>
    
    <item>
      <title>Advent of tomosipo: s003_gpu_reconstruction</title>
      <link>https://blog.allardhendriksen.nl/cwi-ci-group/advent-of-tomosipo-s003_gpu_reconstruction/</link>
      <pubDate>Tue, 28 Jul 2020 15:16:00 +0200</pubDate>
      
      <guid>https://blog.allardhendriksen.nl/cwi-ci-group/advent-of-tomosipo-s003_gpu_reconstruction/</guid>
      <description>Today, we are going to reconstruct on the GPU. This is a great example, because it allows us to play around with PyTorch on the GPU to improve performance.
Geometries First, we define the same geometries we had before:
import astra import tomosipo as ts import numpy as np # Create ASTRA geometries vol_geom = astra.create_vol_geom(256, 256) angles = np.linspace(0, np.pi, 180, False) proj_geom = astra.create_proj_geom(&amp;#39;parallel&amp;#39;, 1.0, 384, angles) # Create tomosipo geometries vg = ts.</description>
    </item>
    
    <item>
      <title>Modeling Cryo-EM using tomosipo</title>
      <link>https://blog.allardhendriksen.nl/cwi-ci-group/modeling_cry_em_using_tomosipo/</link>
      <pubDate>Tue, 21 Jul 2020 13:37:00 +0200</pubDate>
      
      <guid>https://blog.allardhendriksen.nl/cwi-ci-group/modeling_cry_em_using_tomosipo/</guid>
      <description>Cryo-EM is a technique where particles are frozen (&amp;ldquo;cryo&amp;rdquo;) in a solid and imaged using a electron microscope (EM). The particles are in random locations and in random orientation, both of which are unknown. In addition, it is not really known what the particle looks like. In contrast to other tomographic techniques, the sample is not rotated: a single picture is taken. Still, people have managed to determine the structure of viruses and other micro-particles using this technique, leading to a Nobel prize in 2017.</description>
    </item>
    
    <item>
      <title>Advent of tomosipo: s002_data2d</title>
      <link>https://blog.allardhendriksen.nl/cwi-ci-group/advent-of-tomosipo-s002_data2d/</link>
      <pubDate>Tue, 21 Jul 2020 11:46:00 +0200</pubDate>
      
      <guid>https://blog.allardhendriksen.nl/cwi-ci-group/advent-of-tomosipo-s002_data2d/</guid>
      <description>This is going to be a short post, because data objects are rarely useful in tomosipo.
First, we setup the geometries from the ASTRA code example:
import astra import tomosipo as ts import numpy as np # Create ASTRA geometries vol_geom = astra.create_vol_geom(256, 256) angles = np.linspace(0,np.pi,180,False) proj_geom = astra.create_proj_geom(&amp;#39;parallel&amp;#39;, 1.0, 384, angles) # Create tomosipo geometries vg = ts.volume(shape=(1, 256, 256)) pg = ts.parallel(angles=180, shape=(1, 384)) Transcribing the example Creating data ASTRA works with data objects that must be created before use and freed after use.</description>
    </item>
    
    <item>
      <title>Advent of tomosipo: s001_sinogram_par2d</title>
      <link>https://blog.allardhendriksen.nl/cwi-ci-group/advent-of-tomosipo-s001_sinogram_par2d/</link>
      <pubDate>Sat, 18 Jul 2020 22:41:00 +0200</pubDate>
      
      <guid>https://blog.allardhendriksen.nl/cwi-ci-group/advent-of-tomosipo-s001_sinogram_par2d/</guid>
      <description>The first code example is named &amp;ldquo;s001_sinogram_par2d&amp;rdquo;, which suggests that it contains code to create a sinogram using a parallel-beam geometry in two dimensions. I will go through the code example step by step, and show how equivalent results may be obtained using tomosipo.
Installation If you want to follow along, then you will need to install some software. The easiest way to obtain the software is by using the anaconda installer for Python.</description>
    </item>
    
    <item>
      <title>Advent of tomosipo: introduction</title>
      <link>https://blog.allardhendriksen.nl/cwi-ci-group/advent-of-tomosipo-introduction/</link>
      <pubDate>Fri, 17 Jul 2020 22:41:00 +0200</pubDate>
      
      <guid>https://blog.allardhendriksen.nl/cwi-ci-group/advent-of-tomosipo-introduction/</guid>
      <description>Over the next 23 days, I am posting a series of blog posts, in which I convert the ASTRA-toolbox&#39; Python code samples to tomosipo.
The ASTRA-toolbox is a toolbox of high-performance GPU primitives for computations in tomography. It is notorious its speed, but its API can be tedious to use. One of the great advantages of ASTRA is that it allows the user to model elaborate and flexible acquisition geometries. The toolbox does not provide much support for defining these geometries, which is a laborious and error-prone process.</description>
    </item>
    
    <item>
      <title>Remote Emacs on Gnome using X</title>
      <link>https://blog.allardhendriksen.nl/posts/remote-emacs-on-gnome-using-x/</link>
      <pubDate>Tue, 17 Mar 2020 10:07:00 +0100</pubDate>
      
      <guid>https://blog.allardhendriksen.nl/posts/remote-emacs-on-gnome-using-x/</guid>
      <description>Since Friday, I have started working from home. Since my Emacs configurations between home and work are mostly sychronized, this was not a major inconvencience. For programming, however, I would rather work on my workstation.
My first attempt at remote programming in emacs was using the terminal (emacsclient -t). There were all kinds of small inconveniences that made this a unpleasant experience.
The second attempt was to use X11-forwarding, by logging in using</description>
    </item>
    
    <item>
      <title>Reproducible computing environments using Conda</title>
      <link>https://blog.allardhendriksen.nl/cwi-ci-group/reproducible-computing-environments-using-conda/</link>
      <pubDate>Mon, 09 Mar 2020 14:05:00 +0100</pubDate>
      
      <guid>https://blog.allardhendriksen.nl/cwi-ci-group/reproducible-computing-environments-using-conda/</guid>
      <description>While doing research, it is often necessary to install your research environment on various computers. A good first step is to use Conda to manage your Python environment.
Even with Conda, it can happen that exactly the same installation instructions yield different computing environments. In our group, for instance, some installation instructions stopped working when a new version of ASTRA-toolbox was released with support for a newer version of CUDA. This version of CUDA was not yet installed all host machines, and new installations of ASTRA-toolbox defaulted to the newest version of cudatoolkit.</description>
    </item>
    
    <item>
      <title>How to read and write tiffstacks in Python</title>
      <link>https://blog.allardhendriksen.nl/cwi-ci-group/how-to-read-and-write-tiffstacks-in-python/</link>
      <pubDate>Wed, 24 Jul 2019 11:58:00 +0200</pubDate>
      
      <guid>https://blog.allardhendriksen.nl/cwi-ci-group/how-to-read-and-write-tiffstacks-in-python/</guid>
      <description>During a PhD in the computational imaging group, you will not escape reading and writing copious amounts of tiff files. In this blog post, I will run through the most basic (and most helpful!) python libraries and snippets to help you out.
pathlib Pathlib is a library designed to make handling file paths easier in python. You do not even have to install it: it is part of the Python standard library!</description>
    </item>
    
    <item>
      <title>Using Sacred with Mongo without root user rights</title>
      <link>https://blog.allardhendriksen.nl/cwi-ci-group/using-sacred-with-mongo-without-root-user-rights/</link>
      <pubDate>Fri, 01 Jun 2018 16:33:00 +0200</pubDate>
      
      <guid>https://blog.allardhendriksen.nl/cwi-ci-group/using-sacred-with-mongo-without-root-user-rights/</guid>
      <description>Sacred is a framework to &amp;ldquo;help you configure, organize, log and reproduce experiments&amp;rdquo;. It is a tool for reproducible research in the same category as sumatra or pigx. Its documentation is very comprehensive and makes it easy to get started.
Installing Sacred Sacred can be installed using
pip install sacred For the latest version, with the latest bugfixes, use
pip install git+https://github.com/IDSIA/sacred Using Sacred together with Mongo To get the most out of Sacred, you will want to collect all experiment data in a central location.</description>
    </item>
    
    <item>
      <title>Tracking project virtual environments with pyvenv-tracking-mode</title>
      <link>https://blog.allardhendriksen.nl/posts/tracking-project-virtual-environments-with-pyvenv-tracking-mode/</link>
      <pubDate>Mon, 09 Apr 2018 17:39:00 +0200</pubDate>
      
      <guid>https://blog.allardhendriksen.nl/posts/tracking-project-virtual-environments-with-pyvenv-tracking-mode/</guid>
      <description>First of all, you need to install pyvenv-mode. This package is a dependency of elpy and is installed when you execute
(package-install &amp;#39;elpy) Elpy is a great mode for editing Python, and I would strongly recommend using it.
To set up pyvenv-tracking-mode, add the following to your init file (you should have use-package installed):
(use-package pyvenv :ensure t :init (setenv &amp;#34;WORKON_HOME&amp;#34; &amp;#34;~/miniconda3/envs/&amp;#34;) (pyvenv-mode 1) (pyvenv-tracking-mode 1)) The WORKON_HOME variable should be set to the conda directory containing your environments.</description>
    </item>
    
    <item>
      <title>Blogging using Hugo and ox-hugo</title>
      <link>https://blog.allardhendriksen.nl/posts/blogging-hugo-ox-hugo/</link>
      <pubDate>Sun, 08 Apr 2018 19:06:00 +0200</pubDate>
      
      <guid>https://blog.allardhendriksen.nl/posts/blogging-hugo-ox-hugo/</guid>
      <description>Org-mode is a mode in Emacs that makes writing and organizing text a breeze. I use it to keep track of my tasks, bibliography, journal, lab notebook, and notes. I now have a significant volume of notes on topics ranging from sed command-line options, to how to install Anaconda, to reviews of articles I have read. I keep track of quite a few blogs myself, and I find them invaluable for collecting tips and tricks for using Emacs and org mode.</description>
    </item>
    
    <item>
      <title>My Capture templates for ox-hugo</title>
      <link>https://blog.allardhendriksen.nl/posts/capture-templates-for-a-blog-post/</link>
      <pubDate>Sun, 08 Apr 2018 18:41:00 +0200</pubDate>
      
      <guid>https://blog.allardhendriksen.nl/posts/capture-templates-for-a-blog-post/</guid>
      <description>Creating a new ox-hugo blog post manually can be a bit of a pain. There are several properties you have to set for the org section headline of which the most important is :EXPORT_FILE_NAME:. Of course, setting the export file name automatically can be automated, and this is described in this blog post.
The instructions here are taken from / inspired by the ox-hugo documentation.
First, in the use-package declaration in the init.</description>
    </item>
    
    <item>
      <title>Home</title>
      <link>https://blog.allardhendriksen.nl/home/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>https://blog.allardhendriksen.nl/home/</guid>
      <description>This is my blog.</description>
    </item>
    
  </channel>
</rss>
