[ITK] Problem with writing image
Matias Montroull
matimontg at gmail.com
Mon Jul 6 08:16:58 EDT 2015
Try this example:
http://www.itk.org/Doxygen46/html/IO_2ImageReadWrite_8cxx-example.html
What type of images you want to copy?
El lun., 6 de jul. de 2015 a la(s) 6:00 a. m., Constantinus Spanakis <
c.spanakis83 at gmail.com> escribió:
> Hello, I want to copy an image. But all I get is a blank image. What;s
> the problem? Here is the code:
>
> #include "itkImage.h"
> #include "itkImageFileReader.h"
> #include "itkImageFileWriter.h"
>
> #define NULL 0
>
> int main(int argc, char *argv[]){
> const char *filename=argv[1];
> const char *filename2=argv[2];
> typedef itk::Image< unsigned short, 2 > ImageType;
> typedef itk::ImageFileReader<ImageType> Reader;
> typedef itk::ImageFileWriter<ImageType> Writer;
>
>
>
> Reader::Pointer reader=Reader::New();
>
> reader->SetFileName(filename);
> ImageType::Pointer image=reader->GetOutput();
> reader->Update();
>
>
>
>
>
> Writer::Pointer writer=Writer::New();
>
>
>
>
> writer->SetFileName(filename2);
> writer->SetInput(reader->GetOutput());
> writer->Update();
>
>
>
> return EXIT_SUCCESS;
> }
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/mailman/listinfo/community
>
--
Matias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20150706/185b0a3d/attachment.html>
More information about the Community
mailing list