Hi Josie, 


Just to clarify… are you using big “C” or little “c” with fslstats to get the center of mass. Your original post had a little “c” in the example. 

To get similar coordinates to scipy, you’ll want to get voxel coordinates (big “C”). 

-c           : output centre-of-gravity (cog) in mm coordinates
-C           : output centre-of-gravity (cog) in voxel coordinates

https://docs.scipy.org/doc/scipy-0.16.0/reference/generated/scipy.ndimage.measurements.center_of_mass.html

The fslstats little “c” option will give you millimeter coordinates, which is not what scipy will give you. 


Cheers,

Taylor Hanayik


Taylor Hanayik PhD
Analysis Research Software Engineer
FMRIB, John Radcliffe Hospital
University of Oxford
[log in to unmask]





On 2 Oct 2019, at 18:04, Joselisa Paiva <[log in to unmask]> wrote:

Thanks, Tim,
Your suggestion was great, but the outputted center of mass is different from the center of gravity I get with fslstats, which seems to be more accurate when I visualize the coordinates. Unfortunatelly, I was not able to find a function for center of gravity in SciPy, any other suggestion?
Thank you again,
Josie

########################################################################

To unsubscribe from the FSL list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=FSL&A=1



To unsubscribe from the FSL list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=FSL&A=1