Hi James,

If all or nearly all subjects have lesions in certain voxels, as you can see, it will crash. At the moment there isn't an easy solution for this on what concerns the GLM. However, there are things that you can do mitigate the problem. For voxels that are classified as lesions in all or nearly all subjects, consider using using a global mask (option -m) so that these voxels aren't used in the analysis.

To be more specific, you have 4 EVs that will always be in the design. Thus, no more than N-4-1 (i.e., N-5) subjects can have a lesion in a particular voxel. So, you can use fslmaths to compute a sum of the masks for all subjects, then threshold it at N-5 (or maybe at a smaller value, say, N-10, to give a bit of margin and avoid degrees of freedom that are too low). The resulting mask you can merge into the overall mask that you'd supply to randomise (-m), so that no test is done for these voxels, which are completely removed from the analysis.

About being slow or needing more memory: it's a consequence of having lots of voxelwise EVs.

Hope this helps.

All the best,

Anderson


On 11 September 2015 at 10:08, James Cole <[log in to unmask]> wrote:
Dear FSL listers,
Following up on an unanswered query, has anyone else had problems running the output of setup_masks through randomise or randomise_parallel?

Randomise seems to throw an exception when the number of columns in the matrix is greater than the number of rows.
Under normal circumstances there would be more subjects (i.e. rows) than EVs (i.e. columns), but as I understand it the whole point of the setup_masks script is to add an EV of a single 1 and multiple 0s for each subject/row. This gives a square like this:
/Matrix
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1

However, with the addition my two group EVs and 2 covariate EVs, the resulting final matrix in the .mat file is always going to have more columns than rows, e.g.:
/Martix
1 0 1.3 12  1 0 0 0
1 0 1.2 19  0 1 0 0
0 1 1.6 14  0 0 1 0
0 1 1.1 13  0 0 0 1

The error I get is this:
ERROR: Program failed

An exception has been thrown
Logic error:- detected by Newmat: Want no. Rows >= no. Cols

MatrixType = Rect # Rows = 4; # Cols = 8
Trace: SVD.

Exiting
___________

ALONGSIDE this problem, randomise seems to become EXTREMELY memory hungry when trying to run on the output of setup_masks. I often get the 'killed: 9' error when randomise tries to load all the voxelwise EVs (--vxf option), so can't even get to the stage of the error reported above (I'm trying to run this on >100 subjects).

Any thoughts much appreciated, or even reports of people suffering similar problems,
Best wishes,
James