read .nii.gz image files

This commit is contained in:
Jane Tournois 2023-05-15 16:09:52 +02:00
parent d6581363f5
commit da98339ce2
1 changed files with 4 additions and 2 deletions

View File

@ -1090,7 +1090,7 @@ QString Io_image_plugin::nameFilters() const
"Analyze files (*.hdr *.img *.img.gz) ;; "
"Stanford Exploration Project files (*.H *.HH) ;; "
"NRRD image files (*.nrrd) ;; "
"NIFTI image files (*.nii)");
"NIFTI image files (*.nii *.nii.gz)");
}
bool Io_image_plugin::canLoad(QFileInfo) const
@ -1146,7 +1146,9 @@ Io_image_plugin::load(QFileInfo fileinfo, bool& ok, bool add_to_scene)
}
// read a NIFTI file
if(fileinfo.suffix() == "nii")
if(fileinfo.suffix() == "nii"
|| ( fileinfo.suffix() == "gz"
&& fileinfo.fileName().endsWith(QString(".nii.gz"), Qt::CaseInsensitive)))
{
#ifdef CGAL_USE_VTK
vtkNew<vtkNIFTIImageReader> reader;