ACPC Transform for MRI scans- Slicer 4.11

Hi,

I am trying to do an ACPC transform on Slicer 4.11, and have been unable to determine how to do so. I recently updated from an older version in which I used to be able to complete the transform, but lately it had not been registering the final step (i.e. the actual realignment of the MRI scan) following the fiducial list creation and the “Apply” step.

These are the instructions I was using a few years back: PPT - Slicer3 Tutorial: Registration Library Case 15 AC-PC Alignment PowerPoint Presentation - ID:5393167

Any help would be greatly appreciated.

Thank you!

In latest Slicer Stable Release (Slicer-4.11), you need to specify both the ACPC line and the Midline curve by placing markups fiducial points.

To make the behavior more intuitive, I’ll improve latest Slicer Preview Release (Slicer-4.13) to take a markups line and a markups curve instead. The updated Slicer Preview Release will be available for download tomorrow or the day after.

Thank you so much for your response! I did have to specify both ACPC and Midline with fiducial points in the last version, but I couldn’t figure out how to do so with the new setup. Is there any way you could upload instructions/screenshots here for how to assign the fiducials to a list and then apply the transform properly?

Thank you in advance!!

Hi Andras,

Thank you for the new release! I was able to create the two fiducial lists, but I wasn’t sure where to go from there, since I couldn’t find any specific module for an “ACPC Transform.” I’ve attached a few screenshots of what I tried:

I would also definitely be willing to write up some instructions with screenshots for how to do the transformation in the newest version for the next person!

Thank you so much,
Alexis

I did a quick recording of how ACPC alignment works in latest Slicer Preview Release:

It would be great if you could create a nice description/tutorial of how to use it (with a few screenshots). Slicer documentation is now in markdown format, which is the format that this forum uses, so you can write this as a new post in this topic and I will move it to the Slicer documentation when it is ready.

1 Like

Thank you so much, this was really helpful. I unfortunately am still coming across an error and haven’t been able to figure out why it’s happening despite trying multiple scans.

It seems like a Read Data error (pasted below). I understand if this is too particular to resolve, and can certainly still write up instructions for others given that my issue is only with the last ‘Apply’ step. Also, just to clarify, which topic would you prefer that I use?

ACPC Transform standard error:

ERROR: In /Volumes/D/P/S-0/Modules/Loadable/Markups/MRML/vtkMRMLMarkupsJsonStorageNode.cxx, line 105

vtkMRMLMarkupsJsonStorageNode (0x7f954730f650): vtkMRMLMarkupsJsonStorageNode::ReadDataInternal failed: error opening the file '/var/folders/j1/s687l10s5qxfrs8rwnbv_rpw0000gn/T/Slicer-alexisgiff/BAHCB_vtkMRMLMarkupsLineNodeC.json

ERROR: In /Volumes/D/P/S-0/Modules/Loadable/Markups/MRML/vtkMRMLMarkupsJsonStorageNode.cxx, line 1049

vtkMRMLMarkupsJsonStorageNode (0x7f954730f650): vtkMRMLMarkupsStorageNode::ReadDataInternal failed: error opening the file '/var/folders/j1/s687l10s5qxfrs8rwnbv_rpw0000gn/T/Slicer-alexisgiff/BAHCB_vtkMRMLMarkupsLineNodeC.json

Failed to read ACPC line from file /var/folders/j1/s687l10s5qxfrs8rwnbv_rpw0000gn/T/Slicer-alexisgiff/BAHCB_vtkMRMLMarkupsLineNodeC.json

ERROR: In /Volumes/D/P/S-0/Modules/Loadable/Markups/MRML/vtkMRMLMarkupsJsonStorageNode.cxx, line 105

vtkMRMLMarkupsJsonStorageNode (0x7f95473163a0): vtkMRMLMarkupsJsonStorageNode::ReadDataInternal failed: error opening the file '/var/folders/j1/s687l10s5qxfrs8rwnbv_rpw0000gn/T/Slicer-alexisgiff/BAHCB_vtkMRMLMarkupsFiducialNodeB.json

ERROR: In /Volumes/D/P/S-0/Modules/Loadable/Markups/MRML/vtkMRMLMarkupsJsonStorageNode.cxx, line 1049

vtkMRMLMarkupsJsonStorageNode (0x7f95473163a0): vtkMRMLMarkupsStorageNode::ReadDataInternal failed: error opening the file '/var/folders/j1/s687l10s5qxfrs8rwnbv_rpw0000gn/T/Slicer-alexisgiff/BAHCB_vtkMRMLMarkupsFiducialNodeB.json

Failed to read midline points from file /var/folders/j1/s687l10s5qxfrs8rwnbv_rpw0000gn/T/Slicer-alexisgiff/BAHCB_vtkMRMLMarkupsFiducialNodeB.json

At least ACPC line or midline points must be specified

ACPC Transform standard output:

vtkDebugLeaks has found no leaks.

Which Slicer version do you use?

Try the following: enable “Preserve CLI module data files” in menu → Edit → Application settings → Developer and restart Slicer, run the module, then check if the referenced json file (such as /var/folders/j1/s687l10s5qxfrs8rwnbv_rpw0000gn/T/Slicer-alexisgiff/BAHCB_vtkMRMLMarkupsLineNodeC.json in your examples above) exist.

I’m currently using the latest preview release-- 4.13.0-2021-02-04. Unfortunately, I’m still getting the same error across the scans with the json files. Would you advise trying with an earlier version?

I’ve tested the module with the latest Slicer Preview Release (4.13.0-2021-02-11 (revision 29702 / 6942d70)) and it worked well. Please try this version (or the newest Slicer Preview Release).

If you still keep having problems then check if your user has write access to “Temporary directory” (in menu: Edit → Application Settings → Modules). Based on your logs that you previously posted, it is probably /var/folders/j1/s687l10s5qxfrs8rwnbv_rpw0000gn/T/Slicer-alexisgiff/.

Hi Andras,

I tried again with the latest preview release and the same issue is occurring- I’ve attached a photo below of the Modules tab in the menu. The directory that seems to be having issues is the one that is selected, so I’m not sure if there’s anything else I can change.

Thank you,
Alexis

Could you attach the complete application logs of a failed execution (in menu: Help / Report a bug)? Preferably upload the log to somewhere (such as pastebin, or to dropbox, onedrive, …) and post just the link here. Thank you!

For some reason, the log window is completely empty when I bring it up after trying the transform. I’m not sure if I’m doing something wrong, but I just completed the module and then went to Report a bug. Here is what I am seeing:


Thank you so much for all your help.

This further confirms that the temporary folder that is set in application settings is not writable for your user. I’ve updated temporary folder check at startup 1-2 days ago to deal with such issues. It would be great if you could try if you the latest Slicer Preview Release works correctly.

Hi Andras,

It works!! Thank you so much for all the help. I really appreciate it. For the tutorial of this process, which topic should I put it under?

Awesome!

Regarding module documentation/tutorial: Since the Slicer documentation uses the same markdown format as this forum, the simplest is if you can write the tutorial as a new post in this topic. When it is ready, I’ll move it over to readthedocs.

Hi Andras,

I’ve just posted the instructions! Let me know if I can make any changes.

Best,
Alexis

Thank you! I’ve found it - Slicer ACPC Transformation Instructions

1 Like
  1. Begin by opening the ACPC module in the upper left. Under the ‘Transform Panel’, create a new markups line.

  2. Use this line to define the posterior border of the anterior commissure as well as the anterior border of the posterior commissure in the axial slice. You will need to toggle between slices before you place the second point to do this. Verify in the sagittal slice that this line is accurate.


  3. To create the midline, select ‘Create New MarkupsFiducial’ from the dropdown.


    Select at least 5 points along reliable midline structures, (e.g. third ventricle, cerebral aqueduct, etc) ideally on different slices.

  4. Under output transform, select ‘Create New Transform,’ and then Apply.
    Screen Shot 2021-02-26 at 11.47.56 AM

  5. Open ‘Data’ in the dropdown to navigate to the Subject hierarchy. Screen Shot 2021-02-26 at 11.49.14 AM

  6. Right click on the grid along your original MRI scan and select ‘Output transform’. Then, reselect this same scan, and select ‘Harden transform’.

You have now completed your AC-PC transformation!

@shebaelena FYI, the documentation update has been submitted for review. I’ve also added a “Center volume” option that moves the AC point to the origin, allowing transforming the volume into standard Talairach coordinate system. The changes should appear in the Slicer Preview Release within a few days.

1 Like