[Insight-developers] (no subject)

Martin Waitzbauer mazzok at gmx.at
Fri Oct 29 05:44:50 EDT 2010


Hello,

Im looking for a way to save images in a std::vector for later use

so what i did was this

double sigmas[] = {64,128};

  for(int i =0; i <2;i++){

	   MaskFilterType::Pointer mask_f = MaskFilterType::New();
	   mask_f->SetInput(input);
	  mask_f->setHeight(input->GetLargestPossibleRegion().GetSize()[1]);
	 mask_f->setWidth(input->GetLargestPossibleRegion().GetSize()[0]);
	   OutputImageType::Pointer tmp_pic = OutputImageType::New();
	   mask_f->SetVariance(sigmas[i]);
	   tmp_pic->SetRegions(input->GetLargestPossibleRegion());
	   tmp_pic->Allocate();
	   tmp_pic= mask_f->GetOutput();
	   vec.push_back(tmp_pic);
	   
  }

vec contains 2 times the same pics, which seems logical since a ImagetoImage Filter has only one pic as output, so the same memory is also used when i == 1;

I tried to set the tmp_pic.Delete(), but this one will give me an error
How could i create a structure like the above, a filter that creates a new Picture(in the sense of new memory allocation), so that vec will contain 2 different images, depedning on the Filter option mask_f->SetVariance(sigmas[i]);

Thanks

M
-- 
Sicherer, schneller und einfacher. Die aktuellen Internet-Browser -
jetzt kostenlos herunterladen! http://portal.gmx.net/de/go/atbrowser


More information about the Insight-developers mailing list