<div dir="ltr"><div>I have a script to classify MRI perfusion maps from healthy subjects and patients. For the file IO and the classifier I have started with the example code in Abraham et al 2014 [<a href="https://arxiv.org/pdf/1412.3919.pdf">https://arxiv.org/pdf/1412.3919.pdf</a>].<br><br></div>I use the same classifier as in the paper to produce a back-projected map of classification weights, which I then want to 'unmask' like in the paper:<br><br><div><div>    coef=clf.coef_<br>    coef=featureselection.inverse_transform(coef)           <br><br></div><div>and<br><br>    map_name='weights_check.nii.gz'<br>    wmap=np.zeros(mask.shape, dtype=X.dtype)<br>    wmap[mask]=coef<br>    img=nb.Nifti1Image(wmap,np.eye(4))<br>    img.to_filename(map_name)    <br><br></div><div>But the line "wmap[mask]=coef" throws an error "<span style="color:rgb(139,0,0)">ValueError:</span> boolean index array should have 1 dimension". I tried the example code from the paper and that works. <br><br></div><div>Is the 'coef' array of back-projected SVM weights in some way different than the masked input image? Or am I doing something else wrong? The error suggests that the mask array is the problem.<br><br></div><div>The complete script is attached.<br></div><div><br></div><div>Many thanks for your help!<br></div><div>Alle Meije<br></div></div></div>