Hi All,<div><br></div><div>I need to read a 64x64x64 raw image, 32 bit float, Little Endian. To do that I'm using itk::RawImageIO, but for some reason, I'm getting the following runtime error:</div><div><br></div><div>
itk::ERROR: RawImageIO(0x1015af510): Read failed: Wanted 1048576 bytes, but read 16384 bytes.</div><div><br></div><div>Does anyone know what might be happening?</div><div><br></div><div>Here is the code:</div><div>___________________________________________________</div>
<div><br></div><div><div>typedef float PixelType;</div><div>const unsigned int DIMENSION = 3;</div><div>typedef itk::Image< PixelType, DIMENSION > ImageType;</div><div>typedef itk::ImageFileReader< ImageType > ReaderType;</div>
<div><br></div><div>int main( int argc, char ** argv )</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>char *inputFilename = argv[1];</div><div><br></div><div> itk::RawImageIO<PixelType, DIMENSION>::Pointer io;</div>
<div> io = itk::RawImageIO<PixelType, DIMENSION>::New();</div><div> </div><div> io->SetFileName(inputFilename);</div><div> int dim[DIMENSION] = {64, 64, 64};</div><div> double spacing[DIMENSION] = {1.0, 1.0, 1.0};</div>
<div> double origin[DIMENSION] = {0.0, 0.0, 0.0};</div><div> for(unsigned int i=0; i < DIMENSION; i++) {</div><div> io->SetDimensions(i,dim[i]);</div><div> io->SetSpacing(i,spacing[i]);</div><div> io->SetOrigin(i,origin[i]);</div>
<div> }</div><div> io->SetByteOrderToLittleEndian();</div><div> io->SetComponentType(itk::ImageIOBase::FLOAT);</div><div> io->SetPixelType(itk::ImageIOBase::SCALAR);</div><div> io->SetNumberOfComponents(1);</div>
<div> </div><div> ReaderType::Pointer reader = ReaderType::New();</div><div> reader->SetImageIO(io);</div><div> reader->SetFileName( inputFilename );</div><div> reader->Update();</div><div><br></div><div>
return EXIT_SUCCESS;</div><div>}</div></div><div>___________________________________________________</div><div><br></div><div>Thanks & Regards,</div><div>Luis</div>