[Insight-users] Example - Image1

Aya El Gebeely aya.elgebeely at symbyo.com
Wed Mar 31 03:07:06 EDT 2010


Hi Yiming,

In image1.cxx file the codes only illustrates how to set an image but not
further than that...

The following examples illustrates other steps..you may consider that each
example adds a step to pipeline of reading/writing an image , so in
Image5.cxx you will see  the code for writing an output image, (where you
will have output)

const bool importImageFilterWillOwnTheBuffer = true;
  importFilter->getSetImportPointer( localBuffer, numberOfPixels,
                                  importImageFilterWillOwnTheBuffer );
  // Software Guide : EndCodeSnippet


  //  Software Guide : BeginLatex
  //
  //  Finally, we can connect the output of this filter to a pipeline.
  //  For simplicity we just use a writer here, but it could be any other
filter.
  //
  //  Software Guide : EndLatex

  typedef itk::ImageFileWriter< ImageType > WriterType;
  WriterType::Pointer writer = WriterType::New();

  writer->SetFileName( argv[1] );

  // Software Guide : BeginCodeSnippet
  writer->SetInput(  importFilter->GetOutput()  );
  // Software Guide : EndCodeSnippet


  try
    {
    writer->Update();
    }
  catch( itk::ExceptionObject & exp )
    {
    std::cerr << "Exception caught !" << std::endl;
    std::cerr << exp << std::endl;
    }


You will find everything is illustrated in details, in chapter 4, sections
4.1 and 4.2 in ItkSoftwareGuide.pdf



Regards,
Aya R. ElGebeely



On 30 March 2010 21:16, Yiming Jing <yjing at andrew.cmu.edu> wrote:

> Hi, all
>
> I am new to ITK.
> And I have followed the instruction of example image1 and run image.exe.
> But why is there nothing to output?
>
> Yiming
> --
> Yiming Jing
>
>
> _____________________________________
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100331/53c8ecd3/attachment.htm>


More information about the Insight-users mailing list