Click here to Skip to main content
15,881,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
We program a software to process the Medical Image,all of the image fomat is Dicom.Now, we have a problem about the memory management, our computer is Win7 32 Bit + 4G +VS2010, We use ITK + VTK to read and display the image.When processing the image which is larger than 200M, it will be called the bad_Alloc.We think that it maybe the limition of the ITK? We want to find an effective method for the memory managerment to process the large image.It is better to control the memory less than 1G.
Waiting for good news!
Posted
Updated 26-Aug-14 22:14pm
v2
Comments
Bernhard Hiller 27-Aug-14 2:26am    
"bad_mac errors" - never heard that term before. A Google search shows it only in the context of SSL / https. Are you sure you reported the error message correctly? Or did you mix up different error situations?
A-joy 27-Aug-14 4:13am    
Thanks.I am sorry for the mistake.It should be bad_Alloc.

Older 32-bit systems are not really suitable for big volumes of pixel graphics; the memory accessible by applications is limited to 2GB, could be increased to some 3GB. You can reduce memory consumption by limiting amount of graphics shown at once. You can even show one bit bitmap composed by an array of smaller bitmaps, showing few at the same time and panning image the way making the illusion of one big image.

—SA
 
Share this answer
 
Comments
A-joy 27-Aug-14 4:21am    
I have thought about this method.It is very complicated and I can't do it.And there is not much time to me so I want someone who can solve this problem.Can you help me ?
Sergey Alexandrovich Kryukov 27-Aug-14 11:13am    
Certainly, this is pretty complicated. Help? It depends on what help would you need. In this forum, we only help by giving advice and answering questions. If you have some questions, I'll gladly try to answer.
—SA
A-joy 27-Aug-14 22:00pm    
I hope to search for someone who can provide us outsourcing because we don't have much time to carry on research then solve it.
Sergey Alexandrovich Kryukov 27-Aug-14 22:07pm    
In all cases, this is well beyond the format of this forum...
—SA
A-joy 27-Aug-14 22:12pm    
I got it.But I don't know which website provides outsourcing.Can you recommend me some?
Thanks for you advice,but now we have no time to research it.
Hi,

How do you load the DicomData?
Do you load it in one big chunk into a 3D Container? This might make trouble because allocating big chunks of memory can throw bad_alloc exceptions due to the fact that there is no chunk left of this sice (fragmentation issue).

I recommend handling each slice of the volume separately to avoid running into this issue.
The probability to get trouble loading one chunk with 200MB is higher than loading 20*10MB chunks of memory.

I ran into this kind of problem once using Matlab. Loading the data slice by slice, saving it into 2D containers in an list solved the issue.
 
Share this answer
 
Comments
A-joy 27-Aug-14 5:58am    
I have confusion about this method.I am worried if I load the data slice by slice,the continuity of memory maybe be destroyed.
Felix Gundlack 27-Aug-14 6:26am    
But the continuity of memory might cause your bad_alloc exception because you can not allocate that much memory. (memory fragmentation).
A-joy 27-Aug-14 22:18pm    
So we don't use this method.I am still looking for somewho can help us.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900