[Insight-users] how to update the content of an image

Bert albermnz at gmail.com
Wed Apr 23 17:23:30 EDT 2008


Dear all,

I would like to update the content of an image. I read an
image from a file and then this image is passed, as an
argument, in the itkGrayscaleDilateFilter. The output of
this filter is then modificated and passed again in the
 itkGrayscaleDilateFilter.How can I update the new content
ok ReaderMk(see the code)?

InputImageType::Pointer mk = InputImageType::New();
mk = readerMk->GetOutput();
IteratorType mkIt( mk, mk->GetRequestedRegion() );

  mkIt.SetDirection(0);

  grayscaleDilate->SetKernel( structuringElement );

  for (int i =0; i<2; i++)
  {
      grayscaleDilate->SetInput( readerMk->GetOutput() );    //I would like
to update the readerMk
      grayscaleDilate->Update();

          for ( markerIt.GoToBegin(); ! markerIt.IsAtEnd();
          mkIt.NextLine())
      {
          makIt.GoToBeginOfLine();
          while ( ! mkIt.IsAtEndOfLine() )
          {
              mkIt.Set( false );
              ++mkIt;
          }
      }
      readerMk->Update();     //Do I need to add something else?
}

Thanks a lot for your help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20080423/8dbe4293/attachment.htm>


More information about the Insight-users mailing list