pyvips
pyvips copied to clipboard
adding file format (.nii) to suffixes
Hello John.
running
pyvips.base.get_suffixes()
['.csv', '.mat', '.raw', '.v', '.vips', '.ppm', '.pgm', '.pbm', '.pfm', '.hdr', '.dz', '.png', '.jpg', '.jpeg', '.jpe', '.webp', '.tif', '.tiff', '.gif', '.bmp']
Gives the available suffixes that pyvips understands. In your guide https://libvips.github.io/libvips/install.html it states that "If available, vips can load and save NIFTI images."
I ran sudo apt-get install libnifti2
(new package i guess) but still .nii and .nii.gz doesnt show up.
Do i need to link it somehow?
Hello @petoor,
You need to install libnifti2-dev
and then recompile libvips. It should be easy. Check the output of configure to make sure it's picking up nifti, then try:
$ vips niftiload
load a NIFTI image
usage:
niftiload filename out [--option-name option-value ...]
where:
filename - Filename to load from, input gchararray
out - Output image, output VipsImage
...