<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; ">Hi all,</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><span class="Apple-tab-span" style="white-space:pre">        </span>I'm trying to read a DWI from MIDAS dataset (<span style="font-size: 12pt; ">01025-dwi.nhdr, with data located in </span><span style="font-size: 12pt; ">01025-dwi.raw.gz) and I'm getting an exception that ITK throws at itkNrrdImageIO.cxx, line 263:</span></div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><span style="font-size: 12pt; "><br></span></div><div><span style="font-family: arial, helvetica, sans-serif; font-style: italic;"><div> if (nrrdLoad(nrrd, this->GetFileName(), nio) !=
0)</div><div> {</div><div> char *err = biffGetDone(NRRD); // would be nice to free(err)</div><div> itkExceptionMacro("ReadImageInformation: Error reading " </div><div> << this->GetFileName() << ":\n" << err);</div><div> }</div></span></div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><span class="Apple-tab-span" style="white-space:pre">        </span>It happens two times reading this file. If I don't catch the exceptions, the header information is read correctly, but the image content is not read.</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><span class="Apple-tab-span"
style="white-space:pre">        </span>But in the same dataset, the mask image, also in NRRD format (01025-t2w_mask.nrrd, wich includes the data in gzip encoding in the same file), is being read correctly. I compared both sessions and saw a difference between the two cases:</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><span class="Apple-tab-span" style="white-space:pre">        </span>- while reading the image that works (<span style="font-size: 12pt; ">01025-t2w_mask.nrrd):</span></div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><span class="Apple-tab-span" style="white-space:pre">        </span>In formatNRRD.c, line 145 <span style="font-style: italic;">nio->dataFNArr->len</span> is 0, so the <span style="font-style: italic;">else if (nio->dataFNArr->len)</span> is skipped</div><div style="font-family: arial,
helvetica, sans-serif; font-size: 12pt; "><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><span class="Apple-tab-span" style="white-space:pre">        </span>- while reading <span style="font-size: 12pt; ">01025-dwi.nhdr/</span><span style="font-size: 12pt; ">01025-dwi.raw.gz:</span></div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><span style="font-size: 12pt; "><span><span class="Apple-tab-span" style="white-space: pre; ">        </span>nio->dataFNArr->len</span> is 1. Then, </span><span style="font-style: italic; ">if (nio->dataFNArr->len)</span> is entered. Then <span style="font-size: 12pt; ">fname becomes "./01025-dwi.raw.gz" and, then, the function returns an error, that is propagated and then the mentionated exception is thrown.</span></div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><br></div><div style="font-family: arial,
helvetica, sans-serif; font-size: 12pt; "><span class="Apple-tab-span" style="white-space:pre">        </span><span style="font-size: 12pt; ">I hope I put some useful information and I would be very glad for any help!</span></div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><span class="Apple-tab-span" style="white-space:pre">        </span>I'm using: ITK 3.8 (we can't upgrade now, but if someone knows any fix for this issue in newer versions, let me know); Windows 7, 64-bit; Visual C++ 2010</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><span class="Apple-tab-span" style="white-space:pre">        </span>Thanks in advance,</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><br></div><div style="font-family: arial,
helvetica, sans-serif; font-size: 12pt; "><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><span class="Apple-tab-span" style="white-space:pre">        </span>Tiago Brizolara</div></div></body></html>