[Insight-users] ImageFileReader bug
Sara Rolfe
smrolfe at u.washington.edu
Thu Dec 16 01:40:46 EST 2010
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 "numberOfComponents" from 3 to 4.
Thanks,
Sara
http://dl.dropbox.com/u/16899529/ITKdata/PropertyMaskMultiDim_3.vtk
http://dl.dropbox.com/u/16899529/ITKdata/PropertyMaskMultiDim_4.vtk
#include "itkImageFileReader.h"
#include "itkImage.h"
int main(int argc, char * argv[])
{
const int numberOfComponents = 3; // Change this to 4 to try with
the other file
typedef itk::Vector< double, numberOfComponents > PixelType;
typedef itk::Image< PixelType, 3 > ImageType;
typedef itk::ImageFileReader< ImageType > ReaderType;
const char * inputImageFileName = argv[1];
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName( inputImageFileName );
reader->Update();
return EXIT_SUCCESS;
}
On Dec 15, 2010, at 10:13 PM, Matt McCormick wrote:
> Sara Rolfe <smrolfe <at> u.washington.edu> writes:
>
>>
>> That sounds just like what I'm experiencing, though I only have this
>> problem for 3 component vector images. However, I just installed the
>> latest git version of ITK early last week, and it looks like this
>> issue was closed in October.
>>
>
> Sorry for the false trail, then.
>
> The best way to find the problem may be to compile your program with
> debugging
> symbols (CMAKE_BUILD_TYPE=Debug), and run in the debugger, breaking at
> Code/IO/VTKImageIO.cxx in the method
> void VTKImageIO::InternalReadImageInformation(std::ifstream & file)
>
> Stepping through the code may be informative. Pay particular
> attention to
> 240 for ( bool readScalars = false; !readScalars; ).
> It might not be getting out of that loop.
>
> Matt
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20101215/79885d3f/attachment.htm>
More information about the Insight-users
mailing list