MantisBT - ITK
View Issue Details
0004713ITKpublic2007-03-29 06:042007-04-02 14:39
Fucang Jia 
Luis Ibanez 
normalmajoralways
closedfixed 
 
 
0004713: BMPImageIO problem when used in ImageSeriesReader
When I use ImageSeriesReadWrite in Examples/IO to read a series of BMP image files, the program crashed with exception:
itkExceptionMacro("BMPImageIO could not open file: "
                      << this->GetFileName() << " for reading."
                      << std::endl
                      << "Reason: "
                      << itksys::SystemTools::GetLastSystemError());

I saw that it is because the m_Ifstream was not closed when reopen. So when it is closed the problem work.

I added one line "m_Ifstream.close();" at the end of ReadImageInformation function.

added one line at the begin of the Read function
m_Ifstream.open( m_FileName.c_str(), std::ios::in | std::ios::binary );

added comments the m_Ifstream.close(); in the destruction function.
No tags attached.
cxx itkBMPImageIO_new.cxx (22,775) 1969-12-31 19:00
https://public.kitware.com/Bug/file/962/itkBMPImageIO_new.cxx
Issue History

Notes
(0007059)
Luis Ibanez   
2007-04-02 14:39   
Thanks for sending the fix.
The code has been committed to CVS:
http://www.itk.org/cgi-bin/viewcvs.cgi/Code/IO/itkBMPImageIO.cxx?root=Insight&sortby=date&r2=1.20&r1=1.19 [^]