[Insight-users] Reading input into Geodesic Active Contour Shape Prior Level Set Image Filter

toluwalase lasaki toluwalase2000 at yahoo.com
Thu Oct 18 12:34:43 EDT 2007


Hi all,
   
  I need some help figuring out what the problem is with the piece of code pasted below. What I am trying to do is read the principal mode shape images (4.mha files) into the Geodesic Active Contour Shape Prior Level Set Image Filter.cxx. The files are named Modes_01 - Modes_04 and saved at the specified location. I'm not quite sure what is wrong but I get an error that says something about the vector length (???). 
   
  std::vector<InternalImageType::Pointer> shapeModeImages( numberOfPCAModes );
  const std::string FilePref = "C:\\Documents and Settings\\olasaki\\Desktop\\images\\results\\Modes_";
  char *Suff = new char[20]; 
  std::string shapeModeFileNames;
   
  for (int ModeNumber = 1; ModeNumber <=4; ModeNumber++)
  {
  sprintf(Suf, "%02d.mha", ModeNumber);
  shapeModeFileNames = FilePref + Suf;
  ReaderType::Pointer shapeModeReader = ReaderType::New();
  shapeModeReader->SetFileName( shapeModeFileNames.c_str() );
  shapeModeReader->Update();
  shapeModeImages[ModeNumber] = shapeModeReader->GetOutput();
  }
  shape->SetMeanImage( meanShapeReader->GetOutput() );
  shape->SetPrincipalComponentImages( shapeModeImages );
   
  Does anyone notice something I might have done wrong?
   
  Thanks,
  Tomi L.

 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20071018/bbbdb582/attachment.html


More information about the Insight-users mailing list