GithubHelp home page GithubHelp logo

Comments (15)

julfou81 avatar julfou81 commented on May 29, 2024 2

Thank you for sharing! It was a perfect counter example! I also got a headache when I discover that AFNI 3drefit did not do anything to this file. I tried many thing, convert the nifti file to AFNI format, delete orientation before...
Finally I found the solution: your dataset is oblique according to AFNI, so the command that works is:
3drefit -deoblique -orient LSP sub-10_T1w_orig.nii.gz

Before:

Capture d’écran 2021-06-11 à 13 35 46

After:
Capture d’écran 2021-06-11 à 13 35 35

from prime-re.github.io.

niksirbi avatar niksirbi commented on May 29, 2024 1

You are completely right about the LR thing. Just trying to think through your example gave me a headache :). Plus, sometimes we don't know how the animal was registered during scanning. Markers are the only fail-proof way.

Meanwhile, I did some testing of your method. I loaded a misaligned macaque T1 image into fsleyes, and determined that the data orientation was RIA (x, y, z displays were increasing towards right, inferior, and anterior respectively). Then I ran: 3drefit -orient LSP my_image.nii.gz, followed by fslreorient2std my_image.nii.gz my_reoriented_image.nii.gz. This didn't help, the reoriented image was identical to the original. After some digging, I found that the problem was the 3drefit command: it was not resetting the orientation labels (which I could verify running 3dinfo my_image.nii.gz before and after 3drefit). So instead I tried mri_convert --in_orientation RAI my_image.nii.gz my_converted_image.nii.gz, followed by your fslreorient2std command. This actually did the trick! The correct image came out, with standard orientations and label. Trying mri_convert with LSP gave the wrong results, which I guess means that freesurfer uses the same convention as fsl?

Anyhow, I don't know why 3drefit doesn't work for me. It runs without errors, but it doesn't have any effect on the image or its header. Maybe you can include the mri_convert option as as an alternative in the wiki, for people that might encounter the same.

from prime-re.github.io.

julfou81 avatar julfou81 commented on May 29, 2024 1

I can confirm that freesurfer uses the same convention as FSL: https://surfer.nmr.mgh.harvard.edu/fswiki/mri_convert

Eg, if the volume is axial starting inferior and going superior the slice is oriented such that nose is pointing up and the right side of the subject is on the left side of the image, then this would correspond to LPS, ie, as the column increases, you move to the patients left; as the row increases, you move posteriorly, and as the slice increases, you move superiorly.

from prime-re.github.io.

julfou81 avatar julfou81 commented on May 29, 2024 1

It is also very good to know that this works also with freesurfer, it can be useful for users who don't use AFNI on their system!

from prime-re.github.io.

pcklink avatar pcklink commented on May 29, 2024 1

No rush. I was just scrolling through the issues as a reminder of things initiated but perhaps not completed 🙂

from prime-re.github.io.

niksirbi avatar niksirbi commented on May 29, 2024

Hi Julien, this seems like a smart solution, and I see no reason for it not to work universally.
As far as I understand, the only requirement is that you know which way is up, front, and left-right. The first two are obvious, the last one is sometimes impossible to know unless you have a marker (but this problem applies to every other reorientation hack as well).
I happen to have some misoriented monkey data, so I will give this method a try right away and let you know how it works.
And yes, I think this definitely deserves to be on the relevant section of the wiki.

from prime-re.github.io.

pcklink avatar pcklink commented on May 29, 2024

I agree. You have wiki editing rights, right? Just add a section. I'd suggest you present as you did here, that this solution works in your lab (perhaps @niksirbi can add a nudge if he confirms it on his data) so readers know it hasn't been tested on an extensive range of different datasets (even though I don't expect problems either). This is what the wiki is for: if people find that it doesn't work for them, or see ways to improve we can always adjust.

from prime-re.github.io.

julfou81 avatar julfou81 commented on May 29, 2024

Thank you Niko for your fast answer! Yes you are right, R-L is always very tricky and without a marker it may be difficult to know which is which. If you happen to know how the animal was registered at the console and how it was actually positioned in the tunnel, you may guess how wrong is the label. It happened to us recently:
The marmoset (with no pastille on the right temple) was registered "head first - supine" but was actually positioned feet first - supine in the magnet. In that case the labels are wrong in the following way: x and z axis are flipped, meaning that the L label in the image viewer is actually the right side of the monkey's head. In that case when you look at which direction the cursor is moving to, you can guess that if the cursor in moving to the 'L' label in the viewer, it is actually moving toward the right side of the monkey and the data storage is then 'R' for this dimension (FSL convention).

from prime-re.github.io.

julfou81 avatar julfou81 commented on May 29, 2024

Thank you also Chris! Yes I have editing rights.I will write with this cautionary note.

from prime-re.github.io.

julfou81 avatar julfou81 commented on May 29, 2024

ok! Thank you for checking! Would you mind sharing the file you wanted to correct to see if it something to do with your AFNI or with the file itself? or maybe just share the output of 3dinfo for this image?

from prime-re.github.io.

niksirbi avatar niksirbi commented on May 29, 2024

Sure! You can download the file from here: https://drive.google.com/file/d/1B8vq7V1N6KEC151YT3zYCBy4cvS7BGSh/view?usp=sharing

It's the original, unaltered nifti. You can assume that the R label is correct.

Below is a screenshot from the 3dinfo output before and after 3drefit
Screenshot from 2021-06-11 12-37-19

from prime-re.github.io.

niksirbi avatar niksirbi commented on May 29, 2024

This is fantastic @julfou81 ! Thanks for zeroing on the problem. We should definitely include this knowledge in the wiki now!

from prime-re.github.io.

julfou81 avatar julfou81 commented on May 29, 2024

Thank you @niksirbi for showing the mri_convert command!

from prime-re.github.io.

pcklink avatar pcklink commented on May 29, 2024

Anyone willing to add a section to the wiki, or did that already happen?

from prime-re.github.io.

julfou81 avatar julfou81 commented on May 29, 2024

My bad @pcklink , I am supposed to do it and got side-tracked. I will do it very soon.

from prime-re.github.io.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.