Hi,
I'm not quite sure why exactly you want to do this, but fslmaths will
let you easily do this, assuming you know the mean and stddev. This
is what you'd do:
fslmaths image -sub MEAN -div STDDEV -abs image_norm -odt float
where MEAN and STDDEV should be substituted by the appropriate
numerical values.
fslmaths image_norm -thr 6 -bin image_class6up
fslmaths image_norm -thr 3 -uthr 6 -bin image_class3to6
fslmaths image_norm -uthr 3 -bin image_class0to3
Note that this might have a little bit of double-counting of
values that were exactly 6 or exactly 3. If you are worried
about that then decide which category you want them in and
them mask them out of the other. For example, to remove all
6's from the image_class3to6 image you would do:
fslmaths image_class6up -mul -1 -add 1 -bin -mul image_class3to6
image_class3to6
This works by initially making the binary inverse mask of class6up
and then multiplying this by class3to6 to remove the voxels that were
set in the class6up image.
Hope this is clear and does what you want.
All the best,
Mark
Justin Oughton wrote:
> Hi All,
> Can anyone suggest the best way to segment a 3d image into 3 classes
> at 0, 3 and 6 standard deviations from the mean image intensity.
> Cheers, Justin.
|