Hello John,
Additionally, FSL has a command called fslmeants that will do the trick.
fslmeants -i <3Dinput_image_same_space_as_mask> -m <my_mask> --showall -o
output.txt
This command will mask your input image and output the intensity value and
corresponding XYZ coordinates at each voxel of your mask.
Hope this helps!
Jacob
> 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
>>
>
The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.
|