Hi Johannes,
you can use avwstats -R in order to get the intensity range of the
image. If it's significantly lower than the intensity range of the data
type you want to use just multiply the image by some number before
saving as e.g. 16SI, i.e.
avwmaths_32R input -mul 1000 out
avwmaths_16SI out out2
out2 then is a 16 bis signed integer version of input, scaled by 1000
cheers
christian
On 14 Apr 2004, at 14:57, Johannes Klein wrote:
> Hi Christian, hi Steven,
> thanks for your replies. The 32R trick did it, but now I need to figure
> out how to get it back to 16SI format (to make it compatible with some
> software ;) ).
> When I use avwmaths_16SI to convert my resulting data back, I get the
> same loss of scaling. Is there a way to stretch the intensity range of
> my 32 bit real image to the full 16 bit signed range? I don't care
> about
> the absolute values in that case, so I'm not concerned about the
> scaling
> factor.
> Thanks again
> Johannes
>
>
> ----- Original Message -----
> From: Stephen Smith <[log in to unmask]>
> Date: Wednesday, April 14, 2004 2:23 pm
> Subject: Re: [FSL] avwmaths precision problem
>
>> Yep - can I add to that that FSL doesn't use funused1 (which some
>> softwareuses as a scaling factor) - it doesn't use a scaling factor
>> in the header
>> at all. Indeed, to be safe you should make sure that these
>> operations are
>> being carried out in floating point.
>>
>> Thanks.
>>
>>
>>
>> On Wed, 14 Apr 2004, Christian F. Beckmann wrote:
>>
>>> Johannes,
>>>
>>> if the original data is stored as integers you might want to use
>>> avwmaths_32R instead. All the avw tools write the output in the same
>>> format as the input, e.g. if the input is int the output will be,
>> too.> I suspect that this is what's causing the problems. Using the
>> blah_32R> version of the binary will enforce writing the output as
>> 32 bit reals.
>>>
>>> hope this helps
>>> cheers
>>> christian
>>>
>>>
>>>
>>> On 14 Apr 2004, at 12:52, Johannes Klein wrote:
>>>
>>>> Hello everyone,
>>>> I'm having trouble with scaling some PET images. What I'm
>> trying to do
>>>> is scale them to their respective overall mean so I can
>> calculate a
>>>> template image for FLIRT registration.
>>>> I masked out all values <=0 with avwmaths -thr 0 and then
>> calculated> > the
>>>> mean of the remaining voxels with avwstats -M. Now, I'd like to
>> divide> > my data by that factor to achieve scaling to the mean.
>> When I do the
>>>> avwmaths -div, the scaling factor (funused1?) is not adjusted,
>> and the
>>>> effect is quite deleterious. I've made a picture and put it to
>>>> http://www.mpifnf.de/~johannes/snap_norm.gif
>>>> Is there a way to get around this issue? And what happens when
>> I sum
>>>> the
>>>> mean-scaled images up, are the individual scaling factors
>> respected?> > I'd appreciate any comments.
>>>> Thanks
>>>> Johannes
>>>>
>>> --
>>> Christian F. Beckmann
>>> Oxford University Centre for Functional
>>> Magnetic Resonance Imaging of the Brain,
>>> John Radcliffe Hospital, Headington, Oxford OX3 9DU, UK
>>> Email: [log in to unmask] -
>> http://www.fmrib.ox.ac.uk/~beckmann/> Phone: +44(0)1865 222782
>> Fax: +44(0)1865 222717
>>>
>>
>> Stephen M. Smith DPhil
>> Associate Director, FMRIB and Analysis Research Coordinator
>>
>> Oxford University Centre for Functional MRI of the Brain
>> John Radcliffe Hospital, Headington, Oxford OX3 9DU, UK
>> +44 (0) 1865 222726 (fax 222717)
>>
>> [log in to unmask] http://www.fmrib.ox.ac.uk/~steve
>>
>>
--
Christian F. Beckmann
Oxford University Centre for Functional
Magnetic Resonance Imaging of the Brain,
John Radcliffe Hospital, Headington, Oxford OX3 9DU, UK
Email: [log in to unmask] - http://www.fmrib.ox.ac.uk/~beckmann/
Phone: +44(0)1865 222782 Fax: +44(0)1865 222717
|