Hi, I am getting an error in getdp and saying lack of memory, my system is Windows 11, with 16 GB ram, and I am getting this error only while using resample on option, also, I have not changed the head it's in MNI152. Please help me in resolving this.
>> roast('C:\Users\irtis\Desktop\NIMHANS\image processing MRI\PPA_41\T1_brain_conv.nii',{'CP5',2,'Cz',-2},'electype','pad','elecsize',[50 50 3],'resampling','on')
======================================================
CHECKING INPUTS...
======================================================
Resampling C:\Users\irtis\Desktop\NIMHANS\image processing MRI\PPA_41\T1_brain_conv.nii to 1 mm isotropic resolution...
SPM12: spm_reslice (v7141) 14:57:51 - 19/07/2023
========================================================================
Completed : 14:58:01 - 19/07/2023
C:\Users\irtis\Desktop\NIMHANS\image processing MRI\PPA_41\T1_brain_conv.nii has been resampled to 1 mm isotropic resolution, and is saved as:
C:\Users\irtis\Desktop\NIMHANS\image processing MRI\PPA_41\T1_brain_conv_1mm.nii
It'll be used as the input for ROAST.
======================================================
ROAST C:\Users\irtis\Desktop\NIMHANS\image processing MRI\PPA_41\T1_brain_conv.nii
USING RECIPE:
Cz (-2 mA), CP5 (2 mA)
...and simulation options saved in:
C:\Users\irtis\Desktop\NIMHANS\image processing MRI\PPA_41\T1_brain_conv_roastLog,
under tag: 20230719T145801
======================================================
======================================================
STEP 1 (out of 6): SEGMENT THE MRI...
======================================================
Item 'Confounds', field 'strtype': Value must be a valid strtype.
Item 'Confounds', field 'val': Size mismatch (required [1 100], present [1 1]).
Item 'Condition Labels', field 'strtype': Value must be a valid strtype.
Item 'Condition Labels', field 'val': Size mismatch (required [1 100], present [1 1]).
Duplicate application tag in applications 'SPM' and 'SPM'.
Duplicate application tag in applications 'BasicIO' and 'BasicIO'.
------------------------------------------------------------------------
Running job #1
------------------------------------------------------------------------
Running 'Segment'
SPM12: spm_preproc_run (v6365) 14:58:09 - 19/07/2023
========================================================================
Segment C:\Users\irtis\Desktop\NIMHANS\image processing MRI\PPA_41\T1_brain_conv_1mm.nii
Completed : 15:03:09 - 19/07/2023
Done 'Segment'
Done
======================================================
STEP 2 (out of 6): SEGMENTATION TOUCHUP...
======================================================
loading data...
smoothing masks...
creating binary masks...
fixing CSF continuity...
removing disconnected voxels...
generating and labeling empty voxels...
removing outside air...
patching gray matter...
patching CSF...
patching bone...
======================================================
STEP 3 (out of 6): ELECTRODE PLACEMENT...
======================================================
measuring head size...
wearing the cap...
adjust the cap for optimized position...this will take a while...
Iteration No. 1...
Iteration No. 2...
Iteration No. 3...
Iteration No. 4...
Iteration No. 5...
Iteration No. 6...
Iteration No. 7...
Iteration No. 8...
Iteration No. 9...
Iteration No. 10...
Iteration No. 11...
cleaning the hair for gel injection...
Warning: Scalp touches image boundary. Electrodes may go out of image boundary. ROAST can continue but results
may not be accurate. It is recommended that you expand the input MRI by specifying the 'zeroPadding' option.
> In electrodePlacement (line 119)
In roast (line 816)
calculating gel amount for each electrode...
placing electrodes...
placing electrode Cz (1 out of 2) in the 1010 layout...
placing electrode CP5 (2 out of 2) in the 1010 layout...
constructing electrode and gel volume to be exported...
final clean-up...
======================================================
STEP 4 (out of 6): MESH GENERATION...
======================================================
creating surface and tetrahedral mesh from a multi-domain volume ...
Volume/Surface Mesh Generation Utility (Based on CGAL 4.9)
(modified for iso2mesh by Qianqian Fang and Peter Varga)
RNG seed=1648335518
Mesh sizes are (label=size) (1=10)
node number: 687340
triangles: 2563000
tetrahedra: 4039351
regions: 10
surface and volume meshes complete
saving mesh...
======================================================
STEP 5 (out of 6): SOLVING THE MODEL...
======================================================
setting up boundary conditions...
Info : Running 'lib\getdp-3.2.0\bin\getdp.exe C:\Users\irtis\Desktop\NIMHANS\image processing MRI\PPA_41\T1_brain_conv_20230719T145801.pro -solve EleSta_v -msh C:\Users\irtis\Desktop\NIMHANS\image processing MRI\PPA_41\T1_brain_conv_20230719T145801_ready.msh -pos Map' [GetDP 3.2.0, 1 node, max. 1 thread]
Info : Started (Wed Jul 19 15:06:27 2023, Wall = 0s, CPU = 0s, Mem = 5.85156Mb)
Info : Initializing Gmsh
Info : Loading problem definition 'C:\Users\irtis\Desktop\NIMHANS\image processing MRI\PPA_41\T1_brain_conv_20230719T145801.pro'
Info : Selected Resolution 'EleSta_v'
Info : Loading Geometric data 'C:\Users\irtis\Desktop\NIMHANS\image processing MRI\PPA_41\T1_brain_conv_20230719T145801_ready.msh'
Info : System 'Sys_Ele' : Real
P r e - P r o c e s s i n g . . .
Info : Treatment Formulation 'Electrostatics_v'
0% : Pre-processing
10% : Pre-processing
20% : Pre-processing
20% : Pre-processing
30% : Pre-processing
40% : Pre-processing
40% : Pre-processing
50% : Pre-processing
60% : Pre-processing
60% : Pre-processing
70% : Pre-processing
80% : Pre-processing
80% : Pre-processing
90% : Pre-processing
Info : System 1/1: 687273 Dofs
Info : (Wall = 23.345s, CPU = 12.2813s, Mem = 547.559Mb)
E n d P r e - P r o c e s s i n g
P r o c e s s i n g . . .
Info : Generate[Sys_Ele]
0% : Processing (Generate)
10% : Processing (Generate)
20% : Processing (Generate)
20% : Processing (Generate)
30% : Processing (Generate)
40% : Processing (Generate)
40% : Processing (Generate)
50% : Processing (Generate)
60% : Processing (Generate)
60% : Processing (Generate)
70% : Processing (Generate)
80% : Processing (Generate)
80% : Processing (Generate)
90% : Processing (Generate)
Info : Solve[Sys_Ele]
Info : N: 687273 - preonly lu mumps
Info : SaveSolution[Sys_Ele]
Info : (Wall = 687.487s, CPU = 479.156s, Mem = -305.586Mb)
E n d P r o c e s s i n g
P o s t - P r o c e s s i n g . . .
Info : NameOfSystem not set in PostProcessing: selected 'Sys_Ele'
Info : Selected PostProcessing 'EleSta_v'
Info : Selected Mesh 'C:\Users\irtis\Desktop\NIMHANS\image processing MRI\PPA_41\T1_brain_conv_20230719T145801_ready.msh'
Info : PostOperation 1/2
> 'C:\Users\irtis\Desktop\NIMHANS\image processing MRI\PPA_41\T1_brain_conv_20230719T145801_v.pos'
0% : Post-processing (Compute)
10% : Post-processing (Compute)
20% : Post-processing (Compute)
20% : Post-processing (Compute)
30% : Post-processing (Compute)
40% : Post-processing (Compute)
40% : Post-processing (Compute)
50% : Post-processing (Compute)
60% : Post-processing (Compute)
60% : Post-processing (Compute)
70% : Post-processing (Compute)
80% : Post-processing (Compute)
80% : Post-processing (Compute)
90% : Post-processing (Compute)
Info : PostOperation 2/2
> 'C:\Users\irtis\Desktop\NIMHANS\image processing MRI\PPA_41\T1_brain_conv_20230719T145801_e.pos'
0% : Post-processing (Generate)
10% : Post-processing (Generate)
20% : Post-processing (Generate)
20% : Post-processing (Generate)
30% : Post-processing (Generate)
40% : Post-processing (Generate)
40% : Post-processing (Generate)
Fatal : Out of memory (buy some more RAM!)
Error using solveByGetDP
getDP solver cannot work properly on your system. Please check any error message you got.
Error in roast (line 845)
solveByGetDP(subj,injectCurrent,conductivities,indElecSolve,uniqueTag,'');
"Warning: Scalp touches image boundary. Electrodes may go out of image boundary. ROAST can continue but results
may not be accurate. It is recommended that you expand the input MRI by specifying the 'zeroPadding' option."
Is important, I recommend running ROAST again, with everything else closed, adding some zero padding so that warning goes away and monitoring how much RAM is used by MATLAB/ROAST.
ROAST can use a lot of RAM, for example running the NYHead model at 0.5mm resolution gives a warning that you should have >50GB of memory: https://github.com/andypotatohy/roast/blob/master/roast.m#L807
Usually, MATLAB handles insufficient RAM by moving information from RAM to your hard drive / SSD when RAM is full. But getDP is a separate C++ library that doesn't have this capability, so if you are running out of RAM you can either resample to a lower resolution or upgrade your RAM.
I hope that helps!
Kind regards,
Jake