<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&nbsp;</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>&nbsp; if (nrrdLoad(nrrd, this-&gt;GetFileName(), nio) !=
 0)</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; char *err = biffGetDone(NRRD); &nbsp;// would be nice to free(err)</div><div>&nbsp; &nbsp; itkExceptionMacro("ReadImageInformation: Error reading "&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;&lt; this-&gt;GetFileName() &lt;&lt; ":\n" &lt;&lt; err);</div><div>&nbsp; &nbsp; }</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-&gt;dataFNArr-&gt;len</span> is 0, so the <span style="font-style: italic;">else if (nio-&gt;dataFNArr-&gt;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&nbsp;<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-&gt;dataFNArr-&gt;len</span> is 1. Then,&nbsp;</span><span style="font-style: italic; ">if (nio-&gt;dataFNArr-&gt;len)</span>&nbsp;is entered. Then&nbsp;<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>