[MINC-users] conversion to analyze problem

Alex Zijdenbos alex at bic.mni.mcgill.ca
Mon Sep 17 17:11:15 EDT 2007


I have been somewhat stumped, as when I wrote my message last week I
did a number of minc-analyze-minc conversions and found the x-axis to
be flipped in that process. But then after Andrew's message I ran some
more tests, and now I'm not sure if I was in a twilight zone myself or
Andrew managed to change reality somehow - but I have not been able to
reproduce that  anymore :-( At this moment, any 'mnc2nii -analyze;
nii2mnc' loop i run appears to be internally consistent (not flip),
and i have no clue how I managed to get it to flip before.

Be that as it may, having looked at what people write on L/R sidedness
and how various tools treat it really is a sordid mess, as evidenced
by at least two web pages

   http://www.grahamwideman.com/gw/brain/orientation/orientterms.htm
   http://eeg.sourceforge.net/mri_orientation_notes.html

Since there does not seem to a 'right' way to represent orientaton in
ANALYZE, establishing whether or not 'mnc2nii -analyze'  does the
"right" thing is muddy territory. But if there is no standard, then
perhaps 'mnc2nii -analyze' should something more sensible and follow
the same (non-)standard that the tools that Lindsay refers to (MIPAV,
MEDx, FSLview) apparently follow - at least they appear to agree
amongst themselves.

But I'm afraid that none of this may be terribly helpful to you, so -
as much as I dislike it - I would suggest you to work around the
problem. I see a couple of options:

- teach your code to read NIFTI-1 (or MINC ;-) instead of ANALYZE
- flip the ANALYZE images that come out of 'mnc2nii -analyze'
- flip the MINC images before you feed them to mnc2nii

As a side note, I would suggest you to start using the latest version
of MINC and the associated conversion tools (2.0.13 just came out).

-- Alex


On 9/17/07, Walker, Lindsay (NIH/NICHD) [V] <walkerlin at mail.nih.gov> wrote:
> I just wanted to follow up on this earlier thread.  Is there anything we
> can do to fix the mnc2nii -analyze orientation problem?
>
> Thanks.
>
> Lindsay Walker.
>
> -----Original Message-----
> From: Walker, Lindsay (NIH/NICHD) [V]
> Sent: Monday, September 10, 2007 11:33 AM
> To: MINC users mailing list
> Subject: Re: [MINC-users] conversion to analyze problem
>
> Andrew,
>
> I can answer some of these questions.  Yes, I am using the -analyze
> flag, as I need to have my data in analyze format for a software
> pipeline that I use.
>
> In fact, mnc2nii converts the data correctly to nifti format (no issues
> with orientation), but when I add the -analyze flag it flips the x-axis.
>
> This axis is flipped when viewed in mipav, medx and fslview - so it is
> not just one software package that is handling the data incorrectly.
>
> The version of mnc2nii that I am using is:
>
> mnc2nii -version
> program: 1.5.1
> libminc: 1.5.1
> netcdf : "3.6.2"
>
> Lindsay.
>
> -----Original Message-----
> From: Andrew Janke [mailto:a.janke at gmail.com]
> Sent: Sunday, September 09, 2007 7:52 AM
> To: MINC users mailing list
> Subject: Re: [MINC-users] conversion to analyze problem
>
> > Although I am sympathetic to systemic problems and possible
> > ambiguities of the MINC <-> ANALYZE format conversions, I am as yet
> > not convinced that we are not looking at a bug; nor that the behaviour
> > of mnc2nii/nii2mnc can/should not be improved to "work" for users in
> > 95% of the cases instead of 5% (if that). Reasons being:
>
> Okie doke...
>
> > 1. I am yet to encounter the first case where flipping was not
> > necessary (and I have done my fair share - probably more - of these
> > types of conversions)
>
> OK.  (has not been my experience?  I will check with the XNAT guys and
> see what their experience is).
>
> > 2. If I take a MINC volume (without funky directions cosines and etc),
> > run mnc2nii (-analyze) followed by nii2mnc, the x-axis comes out
> > flipped.
>
> oh?  not so for me?  Although I questions why you are adding the
> -analyze flag. This will cause mnc2nii to write an old style (non
> oriented) analyze file as opposed to a Nifti 2-file format which I
> suspect is what you want.  My test:
>
>    $ mincreshape -dimrange xspace=0,100 \
>       icbm_avg_152_t1_tal_lin.mnc /tmp/out.mnc
>
>    $ mnc2nii out.mnc out.hdr
>    $ nii2mnc out.hdr two.mnc
>
>    $ register out.mnc two.mnc
>
> Beyond image scaling issues, this is fine?  What versions are you
> running?  myself:
>
> gordon:tmp$ nii2mnc -version
> program: 2.0.09
> libminc: 2.0.09
> netcdf : 3.6.1 of Mar  5 2007 07:16:16 $
>
> > 3. In the case that Lindsay reports, at least 3 different analyze
> > viewers agree that the x-axis is flipped (which I understand not to be
> > an issue of viewer/radiological/neurological convention, as evidenced
> > by a physical marker in the image).
>
> Is this when using a -analyze flag?
>
> > So notwithstanding MINC's conceptual superiority w/respect to
> > coordinate space handling and etc, it still makes no sense to me that
> > this conversion appears to not *ever* work correctly, nor that the
> > conversion on 'simple' files is not bijective when using the
> > conversion tools provided by MINC itself. Something just smells wrong
> > here...
>
> Myself I prefer to code to the spec and then add kludges later on for
> specific cases if needs be.  Meaning I dont think there would be a
> problem to write a quick and dirty conversion (shell) script called
> mnc2fsl for example.
>
> > Where does one actually find the formal specifications of
> > ANALYZE/NIFTi? For ANALYZE I keep stumbling on the same pdf describing
> > the ANALYZE 7.5 file format, but that is less than informative.
>
> The old analyze spec used to be on the Mayo site. But I just went
> looking for it an found nothing.  There is always the old .h file that
> went with it.  As for nifti, the best site is the sourceforge page.
>
>    http://niftilib.sourceforge.net/
>
> In any case, if what you describe above really is a bug I am more than
> happy to fix it.
>
>
> --
> Andrew Janke   (a.janke at gmail.com || http://a.janke.googlepages.com/)
> Canberra->Australia    +61 (402) 700 883
> _______________________________________________
> MINC-users at bic.mni.mcgill.ca
> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users
>
> _______________________________________________
> MINC-users at bic.mni.mcgill.ca
> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users
>
> _______________________________________________
> MINC-users at bic.mni.mcgill.ca
> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users
>
>


More information about the MINC-users mailing list