[Insight-users] itkDifferenceImageFilter: Comparison between two images

Daniela Sacchetto danysunflower at hotmail.it
Fri Aug 6 11:40:23 EDT 2010


My code is:

[...]

  OutputImageType::Pointer D = OutputImageType::New();
  OutputImageType::Pointer Daverage = OutputImageType::New();
 
  D=filter->GetOutput();
  Daverage=filterM->GetOutput();

  OutputImageType::Pointer Dfinal = OutputImageType::New();
  Dfinal->SetBufferedRegion( Dfinal->GetRequestedRegion() );
  Dfinal->Allocate();

  typedef itk::ImageRegionIterator<OutputImageType> IteratorType;
  typedef itk::ImageRegionConstIterator<OutputImageType> ConstIteratorType;
 
  IteratorType DfinalIt (Dfinal, Dfinal->GetRequestedRegion());
  ConstIteratorType DaverageIt (Daverage, Daverage->GetRequestedRegion());
  ConstIteratorType DIt (D, D->GetRequestedRegion());
 
for (DfinalIt.GoToBegin(), DaverageIt.GoToBegin(), DIt.GoToBegin();!DaverageIt.IsAtEnd(); ++DfinalIt, ++DaverageIt, ++DIt)
      DfinalIt.Set(DaverageIt.Get() < (DIt.Get() - 0.55) ? 1 : 0);
 
//After this code Dfinal image will have "1" value at voxels where Daverage < D - 0.5.
 
  WriterType::Pointer writer3 = WriterType::New();

 
  writer3->SetFileName("Final.dcm");
 
  writer3->SetInput(Dfinal);
  writer3->Update();

[...]

Thanks for your time...


> Date: Fri, 6 Aug 2010 08:32:35 -0700
> From: volkovych at gmail.com
> To: insight-users at itk.org
> Subject: Re: [Insight-users] itkDifferenceImageFilter: Comparison between	two images
> 
> 
> Could you put here the corresponding part of your code?
> It's hard to analyze the reason without any code.
> Sergiy.
> -- 
> View this message in context: http://itk-insight-users.2283740.n2.nabble.com/itkDifferenceImageFilter-Comparison-between-two-images-tp5380586p5381029.html
> Sent from the ITK Insight Users mailing list archive at Nabble.com.
> _____________________________________
> 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/20100806/9dc93d96/attachment.htm>


More information about the Insight-users mailing list