[ITK Community] ITK set pixels in a loaded image/Quickview

Annabelle Dupuis dupuis.annabelle at yahoo.fr
Tue Feb 25 04:55:41 EST 2014


Hi guys, I'm a newbie in ITK and I would like to make some changes on an image
that I read from a file and then check it on Quickview.
So I use 
itk::Image<signed short, 2 >                  ImageType;

itk::ImageFileReader<ImageType>               ReaderType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName( inputFilename );

THe probleme is that when I use 


ImageType::RegionType region;
  ImageType::IndexType start;
  start[0] = 0;
  start[1] = 0;

  ImageType::SizeType size;
  size[0] = 200;
  size[1] = 300;

  region.SetSize(size);
  region.SetIndex(start);

  ImageType::Pointer reader = ImageType::New();
  reader->SetRegions(region);
  reader->Allocate();

for(unsigned int r = 20; r < 80; r++)
  {
      for(unsigned int c = 30; c < 100; c++)
      {
          ImageType::IndexType pixelIndex;
          pixelIndex[0] = r;
          pixelIndex[1] = c;

          reader->SetPixel(pixelIndex, 255);
      }
  }

well nothing happen to the loaded image.
I'm sure I'm missing something basic but I just started coding with this tool.
Thanks for your help.

Anna
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140225/7bedf6d1/attachment-0002.html>


More information about the Community mailing list