Q: Dear All,

I currently have some t-maps, calculated using matlab, in minc format. >From this t-map.mnc file I would like to create another minc file, but with only clusters, say of 50 adjacent voxels with a t > 4. Would anyone have a script, routine or algorithm to perform this operation?

Any help would be greatly appreciated!
http://www.bic.mni.mcgill.ca/pipermail/minc-users/2008-January/001895.html

A: mincmorph is your friend. The algorithm is something along the lines of:

mincmorph -successive ‘B[4.0:999]G’ input_t_map.mnc output_clusters.mnc

This will give you a map of connected blobs of voxels all above a t-value of 4.0 (change that to reflect the threshold you want), numbered according to size of the connected blob (i.e. 1 is the largest blob, 2 the second largest, etc.) Then use

mincstats -volume -binvalue n output_clusters.mnc

to find the smallest n (which should be an integer) still above the size that you want for your clusters.

mincmath -seg -const2 0.5 n.5 output_clusters.mnc clusters.mnc

with that n determined by mincstats will then give you a map of all the voxels that are part of a cluster of the size that you would like to have.