For purpose of converting large files that are stored on the server, we are going to use a Jupyter notebook on the DTU HPC cluster. If you don't know how to start Jupyter notebook, check out the Jupyter launcher tutorial. However the same process can also be done on your local computer in a code editor of your choice.
After launching the jupyter notebook, we have to locate the desired files. We can do that via file Jupyter file explorer.
Then we create new notebook, where we will code the file conversion.
Jupyter notebook also allows us to use some basic terminal commands so we know where exactly in the file system we are.
We can check again, that we know, how to locate the files. In this tutorial we will convert one of these MRI scans from nii.gz
to tiff
.
Now we import the tool that we will be using: qim3d. This library currently supports tiff
, h5
, nii
, txm
, vol
and common PIL formats like png
and jpeg
. You can convert between these formats by simply loading a file and saving it in the desired format.
If we check the files again, we see that now there is also new tiff file.
❗ Converting files like this requires enough memory as we have to load the whole file. Look out for using it for extremely large files.