Creating a searchlight with decoding_prepare_searchlight; meaning of sl_template

Dear TDT users/developers,

I have some questions to the decoding_prepare_searchlight script, in particular to its second output “sl_template” (line 326 of decoding.m).

As far as I understood, this is the vector used to identify the searchlight indexes within a given mask (by calling get_ind in line 392 of decoding.m). If so, shouldn’t the length of this vector be equal to the size of my searchlight (i.e., the amount of voxels in my searchlight)?

Trying out different radius sizes (for isotropic voxels of 2-mm width), I get the following results. Using a searchlight radius of 4 mm, the sl_template.index length is of 27 rows, which cannot be the total amount of voxels in the searchlight, as they should be 33. With a 6-mm radius I get 93 rows, when the n° of voxels should be 123.

However, when setting the radius to an uneven radius size (e.g., 3 and 5 mm), I get a vector length corresponding to the actual amount of voxels supposed to be in the searchlight (i.e., 19 and 81).

Could any of you give me some insights into how the searchlight size is computed?

Thank you very much in advanced.

Best Regards,

Hi Gabriele,

The searchlight is calculated to include all voxels smaller than a given radius. If it was smaller or equal, there would be always some individual voxels sticking out. The intention is to make the searchlight “rounder”, if you so wish. Since a cube has 6 sides, 33-6=27. If you want to include those voxels, I would set the searchlight radius to be e.g. 5.01 instead of 5.

Sorry this wasn’t clear, I’ve updated the help file for the next release.