Hi,
I just thought I should add my comments on this.
Firstly, I completely agree with Steve - nifti is designed so that these
issues will disappear. However, in the very short term it is, unfortunately,
still probably necessary to deal with Analyze.
Tim is also correct in that the negative pixdim stuff is hard coded in the
lowest level i/o routines within FSL. This is so that we could be completely
consistent with the avg152T1 image that has been distributed, which
has, and has always had, negative pixdims.
As for using positive pixdims within an FSL pipeline - that is fine, as long
as you don't use it to indicate a change in the left-right order. We will
always assume that Analyze images are in "radiological ordering" (a
right-handed coordinate system, as Talairach is). So be very careful
about left-right order - but if your Analyze images are always in
"radiological ordering" then the sign of the pixdim is irrelevant for FSL
and will be ignored (although a negative pixdim will always be *written*
on output). See the FAQ for more details about coordinate systems and
left-right. This isn't an easy issue and any change in how things work
(necessary for introducing nifti support) was always going to cause
headaches - for us and for users.
Finally, it is possible to write positive pixdims with the old FSL utilities.
All that you'd have to do is get an old copy of avwcreatehd from v3.1
and it would create pixdims of whatever sign you asked for.
So I hope that helps clarify everything.
Lastly, I would like to heartily recommend everyone to move to nifti1 format
soon as it will hopefully circumvent these problems. However, for the moment
be warned that we do not recommend anything except "radiological
ordering" even in nifti files, although this will change in the next release.
All the best,
Mark
> Hi - just a couple of quick points:
>
> The negative pixdim issues is covered briefly on the FAQ:
> http://www.fmrib.ox.ac.uk/fslfaq/#general_lr
>
> But, the most important answer is this: the whole point of NIFTI1 is to
> resolve the many different conflicting uses of some Analyze header
> fields - and these recent emails are further proof that _by far the
> best_ way to move forward and lose these problems is to start using
> NIFTI1 and not use Analyze at all! This isn't a political issue - all
> the major packages have switched or are switching to NIFTI - and this is
> the best way of making sure these ambiguities go away!
>
> Cheers, Steve.
>
>
>
>
>
> On Tue, 10 May 2005, Russ Poldrack wrote:
>
>> I would second the recommendation that FSL should not automatically
>> assign a negative pixdim by fiat, but rather should preserve the
>> pixdim from the original data. many of us move between programs to do
>> various analysis steps, and these kinds of changes to pixdim could
>> result in lateralization errors.
>> cheers
>> russ
>>
>> On May 10, 2005, at 8:07 AM, Dr Krish Singh wrote:
>>
>> > Thanks, Tim.
>> >
>> > Now that I know what's happening I can write a program to fix it
>> myself - I
>> > just wanted to make sure my understanding was correct and that I
>> wouldn't be
>> > re-inventing the wheel (I usually find that when I write a program
>> there was
>> > an FSL tool that already did the job!).
>> >
>> > In terms of "fixing" things for the next version, I suppose my only
>> plea
>> > would be for avwcpgeom to actually preserve the sign of the pixdims
>> it is
>> > copying. Perhaps also a version of avwcreatehd that similarly
>> > respected the
>> > command line signs for the pixdims.
>> >
>> > All the best,
>> >
>> > Krish
>> >
>> >
>> >
>> > On 10/5/05 3:36 pm, "Tim Behrens" <[log in to unmask]> wrote:
>> >
>> >
>> >> Krish -
>> >> MJ may well correct this later, but as far as I understand you are
>> exactly
>> >> right:
>> >>
>> >> FSL _always_ writes analyze format images with a negative x pixdim.
>> The reason for this is that FSL _always_ interprets analyze format
>> files
>> >> as being in radiological convention. To be consistent with the
>> sform matrix in nifti, this means that the x dimension must be
>> negative. (As you move in a positive direction through voxels, you
>> are
>> >> moving in a
>> >> negative direction in real mm space).
>> >>
>> >> I think that this is written into the FSL utilities at the lowest
>> level;
>> >> so I don't think you will find a utility that will write a positive
>> analyze pixdim. Sorry.
>> >>
>> >> As I say - MJ may well correct this, but this is my understanding.
>> >>
>> >> Tim
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> On Tue, 10 May 2005, Dr Krish Singh wrote:
>> >>
>> >>
>> >>> Thanks for the advice, Brendon.
>> >>>
>> >>> However, now I am really confused.
>> >>>
>> >>> I have a 4D analyse file called clockwise.hdr. Using avwinfo gives
>> me:
>> >>>
>> >>> ------------------
>> >>> pixdim1 3.0000000000
>> >>> pixdim2 3.0000000000
>> >>> pixdim3 3.0000000000
>> >>> -------------------
>> >>>
>> >>> Then I do:
>> >>>
>> >>> ip clockwise.hdr smooth.hdr 0 -s 4.0
>> >>>
>> >>> To create a smoothed 4D file. Using "avwinfo smooth.hdr" on this
>> gives:
>> >>>
>> >>> -------------------
>> >>> pixdim1 -3.0000000000
>> >>> pixdim2 3.0000000000
>> >>> pixdim3 3.0000000000
>> >>> -------------------
>> >>>
>> >>> So, I tried your suggestion of using "avwcpgeom clockwise.hdr
>> smooth.hdr"
>> >>>
>> >>> Unfortunately, this doesn't work! I still get a negative pixdim in
>> smooth.hdr.
>> >>>
>> >>> So, next I tried using avwchpixdim, which as far as I can tell
>> changes the
>> >>> pixdims manually. So I tried:
>> >>>
>> >>> avwchpixdim smooth.hdr 3.0 3.0 3.0
>> >>>
>> >>> Still no joy i.e. smooth.hdr still has a negative pixdim.
>> >>>
>> >>> But then I got curious. It seems that avwchpixdim is just a
>> >>> script that
>> >>> calls avwcreatehd. So I created a completely new header using:
>> >>>
>> >>> avwcreatehd 64 64 30 72 3.0 3.0 3.0 1.0000000000 32 32 15 4
>> test.hdr
>> >>>
>> >>> This is where it gets weird. Despite the fact that I am telling
>> avwcreatehd
>> >>> to create a completely new header with pixdims of (3,3,3) it
>> actually
>> >>> creates one with pixdims of (-3,3,3) i.e. If I type avwinfo
>> >>> test.hdr, I get:
>> >>>
>> >>> ---------------------------------
>> >>> pixdim1 -3.0000000000
>> >>> pixdim2 3.0000000000
>> >>> pixdim3 3.0000000000
>> >>> ----------------------------------
>> >>>
>> >>> So, at least in my version of FSL, the creation of a negative x
>> pixdim seems
>> >>> almost hard-wired into the base-level code for creating Analyze
>> headers.
>> >>>
>> >>>
>> >>> I wonder if anyone has any insight/suggestions? Otherwise I will
>> have to
>> >>> write my own code for getting rid of negative pixdims.
>> >>>
>> >>> All the best and thanks again,
>> >>>
>> >>> Krish
>> >>>
>> >>> P.S. You might be wondering why I am bothered about this, given
>> that the FSL
>> >>> tools don't care. Its because I often use the FSL command-line
>> tools as
>> >>> preprocessing tools before analyses with other programs,
>> >>> including my own,
>> >>> some of which get very confused by negative pixdims.
>> >>>
>> >>>
>> >>> On 9/5/05 9:51 pm, "Brendon Nacewicz" <[log in to unmask]> wrote:
>> >>>
>> >>>
>> >>>> I had a similar problem with flirt & just used avwcpgeom to match
>> the
>> >>>> dimensions of my target image (or input image in this case). I
>> realize
>> >>>> that's not ideal but it's
>> >>>> scriptable & it works. I suppose if ip runs faster you might
>> also see
>> >>>> if two wrongs make a right & simply rerun it on the output image
>> with
>> >>>> 0 smoothing?
>> >>>>
>> >>>> Hope that helps,
>> >>>> Brendon
>> >>>>
>> >>>> --
>> >>>>
>> >>>> Brendon Nacewicz
>> >>>> Waisman Laboratory for Brain Imaging & Behavior
>> >>>> University of Wisconsin Medical School &
>> >>>> Neuroscience Training Program
>> >>>>
>> >>>>
>> >>>> On 5/9/05, Dr Krish Singh <[log in to unmask]
>> >>>> <mailto:[log in to unmask]>> wrote:
>> >>>>
>> >>>>> Hi everyone,
>> >>>>>
>> >>>>> I just used ip to spatially smooth some axial images and found
>> that, for
>> >>>>> Analyze output, it negates the first pixdim i.e. If the input
>> images have
>> >>>>> pixdims of (3x3x3 mm) than the output has pixdims of (-3x3x3
>> mm).
>> >>>>>
>> >>>>> I understand that there are complicated and deeply buried
>> >>>>> reasons why
>> >>>>>
>> >>>> this
>> >>>>
>> >>>>> was implemented, but its causing me some problems and I wonder
>> if
>> >>>>>
>> >>>> anyone had
>> >>>>
>> >>>>> a neat method for simply turning all the pixdims in an Analyze
>> header
>> >>>>> positive?
>> >>>>>
>> >>>>> All the best,
>> >>>>>
>> >>>>> Krish
>> >>>>>
>> >>>>> --
>> >>>>> Dr K.D. Singh
>> >>>>> Senior Lecturer and Convenor of the Neuroimaging Research Group,
>> Director, MRI Research Centre,
>> >>>>> Neurosciences Research Institute
>> >>>>> School of Life and Health Sciences
>> >>>>> Aston University, Birmingham B4 7ET, U.K.
>> >>>>> Tel/Fax: +44 (0)121 [204 3865/3864]/[333 4220]
>> >>>>> [log in to unmask] <mailto:[log in to unmask]>,
>> >>>>>
>> >>>> http://www.aston.ac.uk/lhs/staff/singhkd/
>> >>>> <http://www.aston.ac.uk/lhs/staff/singhkd/>
>> >>>>
>> >>>>>
>> >>>>>
>> >>>>
>> >>>>
>> >>>
>> >>> --
>> >>> Dr K.D. Singh
>> >>> Senior Lecturer and Convenor of the Neuroimaging Research Group,
>> Director, MRI Research Centre,
>> >>> Neurosciences Research Institute
>> >>> School of Life and Health Sciences
>> >>> Aston University, Birmingham B4 7ET, U.K.
>> >>> Tel/Fax: +44 (0)121 [204 3865/3864]/[333 4220]
>> >>> [log in to unmask], http://www.aston.ac.uk/lhs/staff/singhkd/
>> >>>
>> >>>
>> >>
>> >> --
>> >>
>> >>
>> > ----------------------------------------------------------------------
>> -------->
>> > -
>> >
>> >> Tim Behrens
>> >> Centre for Functional MRI of the Brain
>> >> The John Radcliffe Hospital
>> >> Headley Way Oxford OX3 9DU
>> >> Oxford University
>> >> Work 01865 222782
>> >> Mobile 07980 884537
>> >>
>> >>
>> > ----------------------------------------------------------------------
>> -------->
>> > -
>> >
>> >>
>> >>
>> >
>> > --
>> > Dr K.D. Singh
>> > Senior Lecturer and Convenor of the Neuroimaging Research Group,
>> Director, MRI Research Centre,
>> > Neurosciences Research Institute
>> > School of Life and Health Sciences
>> > Aston University, Birmingham B4 7ET, U.K.
>> > Tel/Fax: +44 (0)121 [204 3865/3864]/[333 4220]
>> > [log in to unmask], http://www.aston.ac.uk/lhs/staff/singhkd/
>> >
>>
>> ---
>> Russell A. Poldrack, Ph.d.
>> Assistant Professor
>> UCLA Department of Psychology
>> Franz Hall, Box 951563
>> Los Angeles, CA 90095-1563
>>
>> phone: 310-794-1224
>> fax: 310-206-5895
>> email: [log in to unmask]
>> web: www.poldracklab.org
>>
>>
>
> --
> 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
|