# Nifti loading times

**URL:** <https://discourse.slicer.org/t/nifti-loading-times/10497>\
**Category:** Support\
**Created:** [March 2, 2020, 3:59pm UTC](https://discourse.slicer.org/t/nifti-loading-times/10497 "2020-03-02T15:59:46Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![rprueckl](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rprueckl/32/4240_2.png) [@rprueckl](https://discourse.slicer.org/u/rprueckl)\
**Post date:** [March 4, 2020, 12:28pm UTC](https://discourse.slicer.org/t/nifti-loading-times/10497/5 "2020-03-04T12:28:42Z")

</div>

Thanks, I found the issue. Here some references:

> [@Gipl files freezes slicer](https://discourse.slicer.org/t/gipl-files-freezes-slicer/5312):
>
> I was given two volumes in gipl format (image and labelmap), that I can open with ITKsnap without any problem. When I drag and drop them into Slicer, first it suggests to load them as ‘Scalar Overlay’ as oppose to ‘Volume’. Regardless of what’s chosen, Slicer stalls. This happens with both stable 4.10 and r27623 on windows 10. Same volumes exported as NRRD from ITK-Snap loads fine.

> <https://github.com/InsightSoftwareConsortium/ITK/issues/388#issue-397178164>
>
> \### Description
> 
> Some images take extremely long time to load because GDCMImag…eIO::CanReadFile takes several minutes.
> 
> \### Steps to Reproduce
> 
> Download this image:
> https://1drv.ms/u/s!Arm\_AFxB9yqHtrg3be4uEYghv0JPSw
> 
> Using just ITK:
> 1. Load image file linked above using itk::ImageFileReader
> 
> Using 3D Slicer:
> 1. Drag and drop the image file linked above to the application window
> 2. Select "Volume" in Description column
> 3. Click OK
> 
> \### Expected behavior
> 
> The file is loaded within a few seconds.
> 
> \### Actual behavior
> 
> The file is loaded in about 5 minutes.
> 
> \### Reproducibility
> 
> 100% with the file linked above.
> 
> \### Versions
> 
> 4.13
> 
> \### Environment
> 
> Windows10, VS2015
> 
> \### Additional Information
> 
> Originally reported by a Slicer user here: https://discourse.slicer.org/t/gipl-files-freezes-slicer/5312/3

> <https://github.com/InsightSoftwareConsortium/ITK/commit/19fa58feb02bfd45154e811d0e13510787e2adfb#diff-824229b4fd5f76e67acd43acc54fdae2>
>
> NOTE: DCMTK and GDCM demonstrate the same behavior with certain
> non-DICOM …files that have byte patterns similar to DICOM
> 
> Some images take extremely long time to load because
> DCMTKImageIO::CanReadFile & GDCMImageIO::CanReadFile takes several
> minutes to fail. This is due to DCMTK's and GDCM's default behavior of
> trying to read non-compliant dicom files that do not have the required
> DICM header.
> 
> Add more extensive testing about the structure of the file to determine
> if it looks like a dicom file. Previous testing only looked to see if the
> files without preables had values of 2 or 8 as the first byles of the file,
> but that resulted in many false positives.
> 
> This implementation looks at all the SOP Instances that start with 2 or 8
> to ensure that the proper dicom structure is found.
> 
> This resolves #388.

---

_[View the full topic](https://discourse.slicer.org/t/nifti-loading-times/10497)._
