Read NRRD detached headers that omit blank line

I have a feature request to allow Slicer to detect NRRD detached headers where the user omits the trailing blank line. Tested on Slicer 4.13.0-2021-08-24 r30133 / 5af0a09

The NRRD format specification clearly states After the header, there is a single blank line containing zero characters. However, this requirement is not obvious to users who create text-only detached headers. Currently, Slicer will fail to load a .nhdr file that omits this blank line. Slicer generates a vague error message, and since most text editors do not show white space the issue is not obvious. I would suggest that Slicer either read nhdr files that omit the trailing blank line, or detect this and warn the user that the image is not valid. So while Slicers current behavior is strictly correct, it could be extended to prevent this simple error.

All of these datasets exhibit this issue. One can directly download a dataset to see the issue:

curl -LO https://klacansky.com/open-scivis-datasets/metadata/neghip.nhdr 
curl -LO http://cdn.klacansky.com/open-scivis-datasets/neghip/neghip_64x64x64_uint8.raw

Hi @Chris_Rorden - thanks for reporting this; supporting this small deviation is probably a friendly thing to do for the reasons you cite. However, when I downloaded the data using the steps you reported it loaded fine for me (on mac with my local build and a binary release). Are you sure these file can be used to replicate? Is there another that are broken? In any case this might be something to be addressed at the ITK or teem level if we think that supporting these files is a good idea in general.