SPECTUB image/rotation flips #1180
Replies: 10 comments 2 replies
-
file format pointersDICOMhttps://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.8.4.11.html#table_C.8-11 defines NM DICOM angles:
This definition says that the angle definition depends on the patient orientation. Interfile 3.3
This doesn't say if it's w.r.t patient or gantry, nor which side you're looking from. I really don't know what they mean with "in orientation as specified above". Note that "zero" seems 180 different from DICOM. |
Beta Was this translation helpful? Give feedback.
-
Interfile header manipulation experimentTo check the influence of the start angle and CW I did the following:
Clearly, changing the rotation direction from CW to CCW causes a flip along an axis given by the start angle (which makes sense). Therefore, for an acquisition with start angle 0 or 180, it causes an "y-flip", and for an acquisition with start angle 90 or 270, it causes an "x-flip". |
Beta Was this translation helpful? Give feedback.
-
Hi Kris and STIR SPECT users! Apologies in advance for a relatively unhelpful response. But I thought I should mention my experience with this issue in STIR (having used STIR extensively for SPECT reconstructions in the past). I recall a couple of years ago wanting to use STIR on my university cluster. I noticed this "flipping" issue... something I had not seen before when using STIR on my native (MacBook) installation (which was some version of STIR, 3.something). For some reason STIR V 4.0 (which is what the cluster defaulted to) had this flipping issue. I recall (though it was a long time ago) thinking it had something to do with a mismatch in how STIR read in the attenuation map vs the data I wanted to reconstruct. Ultimately, I just used older versions of STIR (either my native MacBook installation, or by specifying an older version of STIR on the cluster). I don't quite recall why I thought it had something to do with the attenuation map. I haven't dived into the source code in detail, but at some point (between versions) the code changed, and this flipping issue was introduced. I tried to find a workaround by playing with the interfile header data for each of the files used in the recons, but I did not manage to find a solution. I also did not attempt to find the source of the issue in the v4.0 code. My suggestion would be to look at any changes between STIR versions 3 and 4 to see what change could be causing this. I am certain that the possible fix to this issue lies in the source code of STIR versions prior to 4.0. All the best! |
Beta Was this translation helpful? Give feedback.
-
Hi all! While integrating the PinholeSPECTUB code, I regularly referred to the original SPECTUB code to identify any bits of code that should be similarly implemented. One bit of code that I didn’t implement in the pinhole case was the x-axis inversion of the weight matrix. I didn’t implement this because I observed that it flipped the matrix but not the corresponding attenuation map (and explicit mask?). To obtain the correct orientation of pinhole SPECT reconstructed images in STIR’s coordinate system, I had to invert the x-axis of my projection images before passing them to STIR. I wonder if a similar x-axis inversion of projection data and not the weight matrix would correct this issue. I presume that Carles wrote the code with a consistent coordinate system between the two weight matrix codes. |
Beta Was this translation helpful? Give feedback.
-
Hi Mathew,
I think your suggestion is something that worked for me a few years ago. I found a WhatsApp message I sent to Daniel Deidda a few years ago saying
"In order for the recon to be aligned I have to flip the raw (spect) data on the x axis and specify cw rotation other than ccw rotation in the header."
Not saying this is the correct fix. But your suggestion reminded me that doing this fixed the flipping issue for me.
Regards,
Harry
Get Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Matthew Strugari ***@***.***>
Sent: Sunday, April 2, 2023, 9:56 AM
To: UCL/STIR ***@***.***>
Cc: Marquis, Harry ***@***.***>; Comment ***@***.***>
Subject: [EXTERNAL] Re: [UCL/STIR] SPECTUB image/rotation flips (Discussion #1180)
Hi all! While integrating the PinholeSPECTUB code, I regularly referred to the original SPECTUB code to identify any bits of code that should be similarly implemented. One bit of code that I didn’t implement in the pinhole case was the x-axis
Hi all!
While integrating the PinholeSPECTUB code, I regularly referred to the original SPECTUB code to identify any bits of code that should be similarly implemented. One bit of code that I didn’t implement in the pinhole case was the x-axis inversion of the weight matrix. I didn’t implement this because I observed that it flipped the matrix but not the corresponding attenuation map (and explicit mask?).
To obtain the correct orientation of pinhole SPECT reconstructed images in STIR’s coordinate system, I had to invert the x-axis of my projection images. I wonder if a similar x-axis inversion of projection data and not the weight matrix would correct this issue.
—
Reply to this email directly, view it on GitHub<https://urldefense.com/v3/__https://github.com/UCL/STIR/discussions/1180*discussioncomment-5501789__;Iw!!KVWo1iE!UvgY2Bjmjjgid8tvoC5UpEXd_Pofb77K0sm98ng1DGbK45f5LLMMHp7QPDpGDcrqi135FqGD1md0KOrKNgE-W2qr$>, or unsubscribe<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/A647R5RRFFPJOL6PV2G2ZRTW7GAPRANCNFSM6AAAAAAWPQ7C2E__;!!KVWo1iE!UvgY2Bjmjjgid8tvoC5UpEXd_Pofb77K0sm98ng1DGbK45f5LLMMHp7QPDpGDcrqi135FqGD1md0KOrKNkx-4_9G$>.
You are receiving this because you commented.Message ID: ***@***.***>
=====================================================================
Please note that this e-mail and any files transmitted from
Memorial Sloan Kettering Cancer Center may be privileged, confidential,
and protected from disclosure under applicable law. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any reading, dissemination, distribution,
copying, or other use of this communication or any of its attachments
is strictly prohibited. If you have received this communication in
error, please notify the sender immediately by replying to this message
and deleting this message, any attachments, and all copies and backups
from your computer.
Disclaimer ID:MSKCC
|
Beta Was this translation helpful? Give feedback.
-
Let's try to get some evidence together, with complete info, as otherwise we will get lost. i think we need the following: I also suggest to display the "Interfile converted" CT and STIR-NAC-OSEM Interfile-image with amide. That'll take voxel size into account (but not any offsets, i.e. it will centre each image as far as I know) Example command lines
|
Beta Was this translation helpful? Give feedback.
-
NEMA phantom on GE 670 (FFS,CW, start angle 180)Needed x and z flip (= 180 degree rotation around y) for images to match. After that a small x-shift was still visible
screenshot after inverting x&z axis in amide |
Beta Was this translation helpful? Give feedback.
-
NEMA phantom (with added 60mm sphere) on Siemens Symbia Glasgow Royal Infirmary (FFS, start angle 180, CCW rotation)Needed x and z flip (= 180 degree rotation around y) for images to match. After that a small z-shift was still visible
Screenshot from loading CT and SPECT data (reconstructed in STIR) to AMIDE: Screenshot after flipping CT in x- and z-directions (residual mis-registration in z-direction): Screenshot after shifting the CT data by 4 pixels (12mm) in the z-direction: Output from SPECT_dicom_to_interfile (had to edit the number of projections, rotation extent and Radii info) |
Beta Was this translation helpful? Give feedback.
-
NEMA phantom on Mediso AnyScan (HFS, CCW, start angle 0)I did not need any flip to match the CT with the recon CT: SPECT the image seem OK to me with no registration issue |
Beta Was this translation helpful? Give feedback.
-
From the above it seems that the 3 manufacturers interpret the "ImagePositionPatient" very differently: Looking at the L&P coordinates divided by the pixel size (S is presumably largely determined by bed position):
It's conceivable that GE and Mediso encode a CT/SPECT gantry offset in these. Possibly Mediso uses the detector radius (but how?). Oh well |
Beta Was this translation helpful? Give feedback.
-
We're struggling with image flips etc for SPECT reconstructions. e.g. PR #474 removed some x-flipping, but probably caused bug #452.
We should fix things such that orientation is the same as what is output by clinical systems (which presumably are validated). A complication is that STIR uses a gantry-based coordinate system, while DICOM is patient-based. Assuming that our use of ITK to read DICOM (which handles PatientOrientation etc) is correct , I suggest that we check this by using STIR to convert to DICOM to Interfile (as the Interfile output will always fix the orientation), e.g.
An interesting complication is that for SPECT, this depends on the interpretation of detector rotation direction (CW or CCW) and start angle.
@RebeccaGillen @danieldeidda @samdporter I've created this issue to try and document some findings.
Beta Was this translation helpful? Give feedback.
All reactions