[Insight-users] ITK 3.2 png read/write problem

Bill Lorensen bill.lorensen at gmail.com
Thu Mar 17 15:36:07 EDT 2011


Do you mean 3.20? or 3.2? The former is 3.twenty

On Wed, Mar 16, 2011 at 8:47 AM, David Doria <daviddoria at gmail.com> wrote:
> I recently switched to ITK 3.2 while waiting for some problems with master
> to be resolved. With this very simple example, 3.2 seems to produce an all
> black image, where I would expect the output to be the same as the input (at
> least the first channel). There are no errors or warnings. Are there any
> known problems with this?
> #include "itkImage.h"
> #include "itkImageFileReader.h"
> #include "itkImageFileWriter.h"
> int main(int argc, char *argv[])
> {
>   if(argc < 2)
>     {
>     std::cerr << "Required: filename" << std::endl;
>     return EXIT_FAILURE;
>     }
>   std::string inputFilename = argv[1];
>   typedef itk::Image< unsigned char, 2 >  ImageType;
>   typedef itk::ImageFileReader<ImageType> ReaderType;
>   ReaderType::Pointer reader = ReaderType::New();
>   reader->SetFileName(inputFilename.c_str());
>   reader->Update();
>   typedef itk::ImageFileWriter<ImageType> WriterType;
>   WriterType::Pointer writer = WriterType::New();
>   writer->SetInput(reader->GetOutput());
>   writer->SetFileName("output.png");
>   writer->Update();
>   return EXIT_SUCCESS;
> }
> Thanks,
>
> David
>
> _____________________________________
> 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
>
>


More information about the Insight-users mailing list