<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hello,<div><br></div><div>Sorry for arriving to the discussion late. Matt is right that the new VTK image reader should address this issue. However to use it takes a little bit of work. itkVTKImageIO2 is included with the 3.20 release which I believe is what you are running.</div><div><br></div><div>To utilize this IO, you must build ITK with REVIEW enabled. Then include the following in your code:</div><div><br></div><div>#include "itkVTKImageIO2Factory.h"</div><div><br></div><div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>int main(int argc, char * argv[])</div><div>{</div></div></div></blockquote><br></div><div> itk::VTKImageIO2Factory::RegisterOneFactory();</div><div><br></div><div><br></div><div>Please let us know if this does not work for you.</div><div><br></div><div>Brad</div><div><br></div><div><br><div><div>On Dec 16, 2010, at 1:40 AM, Sara Rolfe wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Thanks, I can give this a try. I'd also like to provide my images so others can try and see if they have the same issue. Links to the files and a condensed version of my original code are below. The first file is a 3D, 3 component vector image, which is causing my code to stall. The second is a 3D, 4 component vector image. I've been able to read this (and several different length vector images) without any trouble. To read this one using the code I sent, I just change the variable "<span class="Apple-style-span" style="font-family: Monaco; font-size: 10px; ">numberOfComponents</span>" from 3 to 4.<div><br></div><div>Thanks,</div><div>Sara</div><div><br></div><a href="http://dl.dropbox.com/u/16899529/ITKdata/PropertyMaskMultiDim_3.vtk">http://dl.dropbox.com/u/16899529/ITKdata/PropertyMaskMultiDim_3.vtk</a><div><br></div><div><a href="http://dl.dropbox.com/u/16899529/ITKdata/PropertyMaskMultiDim_4.vtk">http://dl.dropbox.com/u/16899529/ITKdata/PropertyMaskMultiDim_4.vtk</a></div><div><br></div><div><br></div><div><div>#include "itkImageFileReader.h"</div><div>#include "itkImage.h"</div><div><br></div><div>int main(int argc, char * argv[])</div><div>{</div><div> const int numberOfComponents = 3; // Change this to 4 to try with the other file</div><div> typedef itk::Vector< double, numberOfComponents > PixelType;</div><div> typedef itk::Image< PixelType, 3 > ImageType;</div><div> typedef itk::ImageFileReader< ImageType > ReaderType;</div><div><br></div><div> const char * inputImageFileName = argv[1];</div><div><br></div><div> ReaderType::Pointer reader = ReaderType::New();</div><div> reader->SetFileName( inputImageFileName );</div><div> reader->Update();</div><div><br></div><div> return EXIT_SUCCESS;</div><div>}</div></div><div><br></div><div><br></div><div><div>On Dec 15, 2010, at 10:13 PM, Matt McCormick wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Sara Rolfe <smrolfe <at> <a href="http://u.washington.edu">u.washington.edu</a>> writes:<br><br><blockquote type="cite"><br></blockquote><blockquote type="cite">That sounds just like what I'm experiencing, though I only have this <br></blockquote><blockquote type="cite">problem for 3 component vector images. However, I just installed the <br></blockquote><blockquote type="cite">latest git version of ITK early last week, and it looks like this <br></blockquote><blockquote type="cite">issue was closed in October.<br></blockquote><blockquote type="cite"><br></blockquote><br>Sorry for the false trail, then.<br><br>The best way to find the problem may be to compile your program with debugging <br>symbols (CMAKE_BUILD_TYPE=Debug), and run in the debugger, breaking at <br>Code/IO/VTKImageIO.cxx in the method<br>void VTKImageIO::InternalReadImageInformation(std::ifstream & file)<br><br>Stepping through the code may be informative. Pay particular attention to<br>240 for ( bool readScalars = false; !readScalars; ).<br>It might not be getting out of that loop.<br><br>Matt<br><br>_____________________________________<br>Powered by <a href="http://www.kitware.com/">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<br><a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br><br>Kitware offers ITK Training Courses, for more information visit:<br><a href="http://www.kitware.com/products/protraining.html">http://www.kitware.com/products/protraining.html</a><br><br>Please keep messages on-topic and check the ITK FAQ at:<br>http://www.itk.org/Wiki/ITK_FAQ<br><br>Follow this link to subscribe/unsubscribe:<br>http://www.itk.org/mailman/listinfo/insight-users<br></div></blockquote></div><br></div><span><ATT00001..txt></span></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">========================================================</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Bradley Lowekamp<span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span></font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font class="Apple-style-span" face="Arial"><span class="Apple-style-span" style="font-family: Arial; "><span class="Apple-style-span" style="font-family: Arial; ">Lockheed Martin </span></span></font><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Contractor for</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">Office of High Performance Computing and Communications</font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica">National Library of Medicine<span class="Apple-converted-space"> </span></font></p><p style="margin: 0.0px 0.0px 0.0px 0.0px"><font face="Helvetica" size="3" style="font: 12.0px Helvetica"><a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a></font></p><br class="Apple-interchange-newline"></span></span>
</div>
<br></div></body></html>