[vtkusers] An ERROR during reconstruction by using vtkMarchingCubes

noc hawkingyy at hotmail.com
Sun May 16 03:18:46 EDT 2010


Hi everybody,

I'm just new here.

 

Well, I met a problem in isosurface drawing.

 

The ERROE message is: ERROR: In f:\program files\vtk 5.4\vtk src\common\vtkDataArrayTemplate.txx, line 141 vtkIdTypeArray (501E4CC8): Unable to allocate 44288846 elements of size 4 bytes.

 

I wondered why this happen so frequently. I just used 100 DICOM files,  the RAM of my computer is 1GB, and the virtual memory is 2GB, during reconstruction, it only cost 0.99GB memory in total. 

 

Could anyone help me please?

 

Thanks a lot!!!

 

In the end, here is my code:

 

#include "vtkRenderer.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkImageData.h"
#include "vtkMarchingCubes.h"
#include "vtkActor.h"
#include "vtkPolyDataMapper.h"
#include "vtkDICOMImageReader.h"
#include "vtkStripper.h"
#include "vtkDirectory.h"
#include "vtkStripper.h"


int main()
{   
  vtkDICOMImageReader * DicomReader = vtkDICOMImageReader :: New(); 
  DicomReader -> SetDirectoryName("D:/Data/CT");
  
  vtkRenderer * ren = vtkRenderer :: New();
  ren -> SetBackground (1, 1, 1);


  vtkRenderWindow * renWin = vtkRenderWindow :: New();
  renWin -> AddRenderer(ren);
  
  vtkRenderWindowInteractor * iren = vtkRenderWindowInteractor :: New();
  iren -> SetRenderWindow (renWin);
  
  vtkMarchingCubes * MC = vtkMarchingCubes :: New();
  MC -> SetInput(DicomReader -> GetOutput());
  MC -> SetValue(0, 30);
  MC -> ComputeGradientsOn();
  MC -> ComputeScalarsOff();

 

  vtkStripper * stripper = vtkStripper :: New();
  stripper -> SetInput (MC -> GetOutput());

 

  vtkPolyDataMapper * mapper = vtkPolyDataMapper :: New();
  mapper -> SetInput (stripper -> GetOutput());

 

  vtkActor * actor = vtkActor :: New();
  actor -> SetMapper(mapper);


  ren -> AddActor(actor);

 

 iren->Initialize();
  iren->Start();
  return 0;

}
 		 	   		  
_________________________________________________________________
SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻!
http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100516/338408c7/attachment.htm>


More information about the vtkusers mailing list