jdiedrichsen / suit

Toolbox for the analysis of cerebellar imaging data
18 stars 10 forks source link

suit_isolate_seg #10

Closed mitchellxh closed 2 years ago

mitchellxh commented 4 years ago

I keep getting this same error with the requested array size exceeding the preference maximum of Matlab. I have tried changing the maximum array size, but it is capped at 10,000 for my machine.

Requested 28062189061x1 (209.1GB) array exceeds maximum array size preference.

Error in suit_isolate_seg (line 154) cropped_bb.y = min(BOUND(2,:)):max(BOUNDS(2,:));

Is there an alternative way you typically solve this issue? Or am I doing something wrong here? I'm only using the T1.nii as and input. Thanks in advance.

jdiedrichsen commented 4 years ago

Not sure what is going on here - this shouldn't be a problem for standard T1s. If you set a breakpoint on this line, can you report the value of BOUND? Would also be helpful if you send me the call you are using + the image, to see if I can replicate the problem here. As said, this should not be an issue.

mitchellxh commented 4 years ago

Is there somewhere I can send my T1w directly other then publicly here?

mitchellxh commented 4 years ago

Here is screenshot of the errors I'm getting. I tried just using the gui this time. Before I was just simply using the syntax: suit_isolate_seg({'$Path_to_Data/T1.nii'})

With my data acquired locally I get the memory issue mentioned before and on the bottom of the screenshot. With the data I downloaded from ADNI I get the 'chol' issue (Matrix must be positive definite) in the top of the screenshot.

Is there some initialization step I need to be doing to my data before processing? I also performed Freesurfer recon on all these subjects, should I use one of the pre-processed T1 .mgz files?

Screen Shot 2020-07-15 at 5.50.37 PM.pdf

jdiedrichsen commented 4 years ago

Won't have time to check in detail right now - But try to bring your T1 into approimately LPI orientation and ensure that the origin (0,0,0) of the image (according to the sform in the nifti-header) is somewhere within the brain, ideally in the AC. If that fails, send me the image by email (joern.diedrichsen@googlemail.com) and I'll check.

fcignetti commented 4 years ago

Dear SUIT experts

I also experience a problem of array size preference with suit_isolate_seg, although the Matlab error message is not the same as for mitchellxh:

%%%%%%%%%%%%%%%%%%%%%%%%%% suit_isolate_seg({'T1.nii'});

SPM12: spm_preproc_run (v7670) 12:29:42 - 28/07/2020

======================================================================== Segment T1.nii Completed : 12:33:31 - 28/07/2020 Cropping... done Error using zeros Requested 5629x318x1602x1 (21.4GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause MATLAB to become unresponsive. See array size limit or preference panel for more information.

Error in spm_read_vols (line 30) Y = zeros([V(1).dim(1:3),n]); %-image data matrix

Error in suit_isolate_seg (line 175) S1 = spm_read_vols(s1); %%%%%%%%%%%%%%%%%%%%%%%%%%

The T1 is LPI/RAS oriented with the origin roughly on CA. What do you think may be the cause of the problem? Is there any further information you would need to help me (I can send you an image)? Note that these are children data of good to excellent quality according to cat ratings (I did previously a whole brain vbm analysis).

Thanks in advance for your help

crhernandezc commented 3 years ago

Hi @fcignetti, most of these errors are because the images are not in LPI orientation or because the origin of the image is not at the anterior commisure. Fix those and SUIT will work no problem.

Best

fcignetti commented 3 years ago

Hi @crhernandezc thanks for your answer. In our case the images were LPI oriented and centred on AC. The problem came from the submillimeter resolution (slightly below 1mm). Resizing the images solved the problem. Best