Hi,
I can't replicate this on my laptop (mac os x). Instead, it works as
expected - if I create a binary mask and then do the type conversion
I still have the mask intact. AFAIK avwmaths does not use division
but simply casts the values to the required type in the ususal c++ way.
Here is what I did:
i) load in avg152 in fslview and create a binary mask, save this to
[Josi:~] avwhd avg152T1_brain-mask.nii.gz
filename avg152T1_brain-mask.nii.gz
sizeof_hdr 348
data_type INT16
...
This is a binary file:
[Josi:~] avwstats avg152T1_brain-mask.nii.gz -r -R
0.000000 1.000000 0.000000 1.000000
When using avwmaths++ to convert the file
[Josi:~] avwmaths++ avg152T1_brain-mask.nii.gz test -odt char
it remains a binary mask
[Josi:~] avwstats test -r -R
0.000000 1.000000 0.000000 1.000000
and has the desired type
[Josi:~] avwhd test
filename test.nii.gz
sizeof_hdr 348
data_type UINT8
...
I guess we need to investigate - what platform are you running this
on and did you compile yourself?
cheers
christian
On 25 May 2007, at 14:57, Alle Meije Wink wrote:
> I tried this on a segmented brain mask image (value 0/1):
>
> avwmaths++ segmented.nii segmentedBYTE.nii -odt char
>
> after which segmentedBYTE.nii was zero everywhere, and
>
> avwmaths++ segmented.nii -mul 256 segmentedBYTE.nii -odt char
>
> after which the values that were 1 in segmentedBYTE.nii were 0
> outside the mask and 1 inside teh mask.
>
> In other words: this is a way to make it work, but I'm not sure
> that this is correct! How many users expect the values in their
> images to change when they do a type conversion?
>
> Best
> Alle Meije
____
Christian F. Beckmann
University Research Lecturer
Oxford University Centre for Functional MRI of the Brain (FMRIB)
John Radcliffe Hospital, Headington, Oxford OX3 9DU, UK.
[log in to unmask] http://www.fmrib.ox.ac.uk/~beckmann
tel: +44 1865 222551 fax: +44 1865 222717
|