[Insight-users] about BMP write and read

Julien Jomier julien.jomier at kitware.com
Tue Aug 8 09:22:44 EDT 2006


Hi Yixun,

What type of exception are you getting? Can you try to display the message?

The BMPImageIO should be able to read your image. (What version of ITK
are you using?).

If you can send me (or post on the web) one BMP file you are trying to
open I will see if I can read it.

Let us know,

Julien


Yixun Liu wrote:
> Hi,
>  
> I read a dicom series(short type) and use RescaleIntensityImageFilter to 
> change pixel type from short to  unsigned char. At last save it to BMP 
> format. I get a series of BMP files with bit deep 8. Now I want to read 
> this BMP series I did as below,
>  
>  
> typedef itk::ImageSeriesReader< ImageType_Short>  ReaderType_Short;
>  ReaderType_Short::Pointer reader = ReaderType_Short::New();//itk
>      nameGenerator->SetStartIndex(startIndex );
>      nameGenerator->SetEndIndex( endIndex );
>      nameGenerator->SetIncrementIndex( incrementIndex );
>      nameGenerator->SetSeriesFormat(files);
>      reader->SetImageIO( itk::BMPImageIO::New() );
>      reader->SetFileNames( nameGenerator->GetFileNames()); 
>  
> However, exception was thown. Does BMPImageIO only support RGB 
> format(bit deep 24) instead of index (bit deep 8)format?
>  
>  
> ITKSoftwareGuide Says that "Note that when reading and writing images, 
> the pixel type of the
> image is not necessarily the same as the pixel type stored in the file"
> So, another question, if I read a series of files using pixel type of 
> short, now I want to save it to , e.g., png format. Assume PNG format 
> support two pixel types, short and unsigned char. Which format ITK will 
> save it to?
>  
> Regards,
>  
> Yixun Liu
>  
>  
>  
> 
>  
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users



More information about the Insight-users mailing list