[Insight-users] problem with RGB .bmp images

Luis Ibanez luis.ibanez at kitware.com
Wed Sep 24 08:34:55 EDT 2008



Hi John,


Thanks for the report,


1) Do you get any error message ?
    if so,
    could you be so kind to share the error message with us ?


2) Is there a chance that you could post one of the offending .bmp
    images in a public site from where we could take it for inspection ?


Please let us know


    Thanks


       Luis


-----------
John wrote:
> I'm getting .bmp files from an OCT device, which I segment then on converted
> greyscale images.
> 
> The problem is, that I would like to apply the segmented borders to the original
> colored images. But I can't even read the files in color format.
> 
> The below code doesn't work with the .bmp images from the OCT device, but with
> other .bmp or rgb images such as jpeg, png the code works.
> What could that be? Really mysterious.
> 
> Thanks in advance for any help.
> John
> 
> 
> //RGBTest.cxx
> #include "itkImageFileReader.h"
> #include "itkImageFileWriter.h"
> 
> #include "itkImage.h"
> #include "itkRGBPixel.h"
> 
> int main( int argc, char ** argv )
> {
>   typedef itk::RGBPixel< unsigned char > PixelType;
>   const   unsigned int        Dimension = 2;
>   typedef itk::Image< PixelType, Dimension >    ImageType;
> 
>   typedef itk::ImageFileReader< ImageType >  ReaderType;
>   typedef itk::ImageFileWriter< ImageType >  WriterType;
> 
>   ReaderType::Pointer reader = ReaderType::New();
>   WriterType::Pointer writer = WriterType::New();
> 
>   const char * inputFilename  = argv[1];
>   const char * outputFilename = argv[2];
>   
>   reader->SetFileName(inputFilename);
>   writer->SetFileName(outputFilename);
> 
>   writer->SetInput( reader->GetOutput() );
> 
>   try
>   {
>     writer->Update();
>   }
>   catch( itk::ExceptionObject & err )
>   {
>     std::cerr << "ExceptionObject caught !" << std::endl;
>     std::cerr << err << std::endl;
>     return EXIT_FAILURE;
>   }
> 
>   return EXIT_SUCCESS;
> }
> 
> //CMakeLists.txt
> PROJECT(RGBTest)
> 
> # Find ITK.
> FIND_PACKAGE(ITK REQUIRED)
> IF(ITK_FOUND)
>   INCLUDE(${ITK_USE_FILE})
> ENDIF(ITK_FOUND)
> 
> ADD_EXECUTABLE(RGBTest RGBTest.cxx )
> 
> TARGET_LINK_LIBRARIES(RGBTest ITKCommon ITKIO)
> 
> 
> 
> _______________________________________________
> 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