[vtkusers] [Insight-users] std::bad_alloc on rendering with vtkImagePlaneWidget

John Drescher drescherjm at gmail.com
Tue Oct 6 09:02:50 EDT 2009


> Yes I have a 32bit Windows XP machine but the data set is only 512x512x70 (form dicom i think 2 byte grayscale). So I think the memory should be enough, also the normal 3d rendering works (as the medical1.cxx example).
>

I was having this problem some time ago but I was using larger volumes
(~512x512x384) and a full color overlay using a vtkImageBlender.

Unless you make several of copies of your volume or load several
volumes I do not see this happening with your data. Perhaps you should
open task manager and add Virtual Memory as a column to the process
list and see how high your application's virtual memory is getting.

> How can i compile my app for largeaddressaware?
>
This is what I have in my CMakeLists.txt file for visual studio:

IF(WIN32)
    SET(CMAKE_CXX_FLAGS "/WL /MP /GR /EHsc" )
    SET(CMAKE_EXE_LINKER_FLAGS "/INCREMENTAL:NO /MANIFEST /STACK:10000000 ")
	
	IF(CMAKE_SIZEOF_VOID_P MATCHES 4)
      SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}
/machine:I386 /LARGEADDRESSAWARE")
	ELSE(CMAKE_SIZEOF_VOID_P MATCHES 4)
	  SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /machine:X64")
    ENDIF(CMAKE_SIZEOF_VOID_P MATCHES 4)

ENDIF(WIN32)

You also need to set the /3GB boot.ini switch for this to work:

http://msdn.microsoft.com/en-us/library/ms791558.aspx

John



More information about the vtkusers mailing list