fslstats

#!/bin/sh

# Get mean (-M) and standard deviation (-S) of a masked (-k) region 
# (e.g., a statistical image)

fslstats img_stats -k mask -M -S

# Test if an image is a binary mask:
# -M gets the mean of non-zero voxels.  
# -S gets the standard deviation of non-zero voxels.
# Beware of images containing NANs!
# The mean should be 1 
# The standard deviation should be 0 

fslstats img_mask -M -S

4
3
FariN 80 points

                                    #!/bin/sh

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

fslstats mask -C -c 

4 (3 Votes)
0
3
1

                                    #!/bin/sh

# List co-ordinates of each labeled region in an atlas with fslstats. 
# Use preoption -K < indexMask > will generate seperate n submasks from 
# indexMask, for indexvalues 1..n where n is the maximum index value 
# in indexMask, and generate statistics for each submask.

fslstats -K myLabelAtlas myLabelAtlas -x 

3 (1 Votes)
0
4.29
7

                                    #!/bin/sh

# Peaks: -x : output coordinates of the maximum intensity voxel 

fslstats img -x  

4.29 (7 Votes)
0
3.8
10
Hong 125 points

                                    #!/bin/sh

# Get the voxel count for a mask
fslstats mask -V | awk '{printf $1 "\n"}'

# Get the volume in cubic mm for a mask
fslstats mask -V | awk '{printf $2 "\n"}'

3.8 (10 Votes)
0
Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source