Giter Site home page Giter Site logo

Comments (4)

bennyrowland avatar bennyrowland commented on September 15, 2024

Hi @PichardRarker, sorry to hear you are having trouble with this. I always found the Siemens data formats to be annoyingly under specified in terms of orientation, and in particular my experience is mostly with either .RDA or TWIX formats, rather than Siemens DICOM, but it looks like you have got things correct. There are lots of things that could be going on, but without any data it is hard to narrow down the problem. When you say that the voxel is rotated, do you mean rotated about its center, or about the centre of the image, or the isocentre of the magnet? Are these images axial/sagittal/coronal? How did you convert the image slices to .nii?

Is this a one off or happening reliably on your data? Can you either obtain some shareable data or do some anonymisation of the data you do have? Without some kind of data it is going to be really hard to do more than suggest possible problems that you will have to investigate further.

from suspect.

PichardRarker avatar PichardRarker commented on September 15, 2024

Hi Ben,

Thanks for the detailed reply. I'm currently in talks with trial sponsor about getting permission to share some data with you. In the meantime, here are the answers to your questions, in case they are particularly informative:

do you mean rotated about its center, or about the centre of the image, or the isocentre of the magnet?

Rotated around the centre of the voxel, it seems. The true voxel location is the left-hemipshere putamen, with the longest axis of the oblong in the anterior-posterior plane. The voxel I'm seeing is still in the left hemisphere, but is rotated so that the longest axis runs left to right in real-world space.

Are these images axial/sagittal/coronal?

The T1 was acquired sagittaly

How did you convert the image slices to .nii?

An old build of dcm2nii (I can find find the exact build, if helpful). The conversion was run without reorienting the data (as is standard practice nowadays with dcm2niix). As part of my initial investigation I tried reorienting the T1 to match that of the MRS (by calling nibabel.aff2axcodes on the .transform attribute of the MRSData object, then reorienting the T1 accordingly) but this produced the same result

Best,

Rich

from suspect.

bennyrowland avatar bennyrowland commented on September 15, 2024

If the voxel appears rotated through 90 degrees about its own centre, the most likely thing is that the length/width/height of the voxel are being read into the wrong fields. This could be a bug in Suspect caused by only previously using square voxels with Siemens DICOM files, or it could be something more subtle relating to the voxel being planned sagittally (I am assuming the voxels were planned on the T1?) that is not being correctly taken into account.

Looking back at the code (io/siemens.py) I am reminded that Siemens specifies the voxel with a normal vector and a rotation angle in the plane. I don't believe this is enough information to uniquely specify a voxel, but I have never been able to get Siemens to confirm to me how to get the X/Y/Z vectors from the values they provide, and so everything is basically a best guess on my part, working with a small amount of data, and it looks like you have found something where it is different.

To work around this, you can probably just permute the columns of the transform of the MRS voxel to swap the two offending direction vectors over, everything else should then work correctly. If you fancy having a look at the loading code, I think this is the problem line:

x_vector = numpy.array([-1, 0, 0])

which needs to be different for sagittal voxels if we can figure out which voxels are sagittal/axial/coronal from some other data.

from suspect.

PichardRarker avatar PichardRarker commented on September 15, 2024

I think that did the trick! If I set the vector to [0, -1, 0], and additionally flip the sign of the in-plane rotation angle, I seem to recover the correction orientation

Thank you so much for your help!

from suspect.

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.