pyvips icon indicating copy to clipboard operation
pyvips copied to clipboard

adding file format (.nii) to suffixes

Open petoor opened this issue 4 years ago • 1 comments

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?

petoor avatar Jun 02 '20 08:06 petoor

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
...

jcupitt avatar Jun 02 '20 08:06 jcupitt