Print

Print


Hi John,

I don't think there's an FSL command to do this, but it is easily done in
Python, using numpy and nibabel:

import nibabel as nib
import numpy   as np

maskimg = nib.load('/path/to/my_3D_mask.nii.gz')
data    = maskimg.get_data()
x, y, z = np.where(data == 0)

Cheers,

Paul



On Thu, Jul 31, 2014 at 11:43 AM, John McLean <[log in to unmask]>
wrote:

> Dear FSL users,
>
> Is there a way using one or a couple of FSL commands to extract all the
> voxel co-ordinates for a given binary mask?
>
> I thought for a second fslstats -x might do it, as I want all the
> co-ordinates for voxels of intensity 1 (the max intensity), but it just
> outputs a single voxel, which I guess is what it really is intended to do.
>
> Thanks
> John
>