# ACPC Transform for MRI scans- Slicer 4.11

**URL:** <https://discourse.slicer.org/t/acpc-transform-for-mri-scans-slicer-4-11/15762>\
**Category:** Support\
**Tags:** mri\
**Created:** [February 1, 2021, 1:55am UTC](https://discourse.slicer.org/t/acpc-transform-for-mri-scans-slicer-4-11/15762 "2021-02-01T01:55:01Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![shebaelena](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/shebaelena/32/9708_2.png) [@shebaelena](https://discourse.slicer.org/u/shebaelena)\
**Post date:** [February 1, 2021, 1:55am UTC](https://discourse.slicer.org/t/acpc-transform-for-mri-scans-slicer-4-11/15762/1 "2021-02-01T01:55:01Z")

</div>

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](https://www.slideserve.com/jacoba/slicer3-tutorial-registration-library-case-15-ac-pc-alignment)

Any help would be greatly appreciated.

Thank you!

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 1, 2021, 5:55am UTC](https://discourse.slicer.org/t/acpc-transform-for-mri-scans-slicer-4-11/15762/2 "2021-02-01T05:55:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![shebaelena](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/shebaelena/32/9708_2.png) [@shebaelena](https://discourse.slicer.org/u/shebaelena)\
**Post date:** [February 1, 2021, 10:02pm UTC](https://discourse.slicer.org/t/acpc-transform-for-mri-scans-slicer-4-11/15762/3 "2021-02-01T22:02:39Z")

</div>

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!!

---

<div class="post-metadata">

**Author:** ![shebaelena](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/shebaelena/32/9708_2.png) [@shebaelena](https://discourse.slicer.org/u/shebaelena)\
**Post date:** [February 7, 2021, 7:42pm UTC](https://discourse.slicer.org/t/acpc-transform-for-mri-scans-slicer-4-11/15762/4 "2021-02-07T19:42:28Z")

</div>

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:

 ![1](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/5/a5e7d2f4341f78095b7f5a177048f30425de5a18.jpeg)

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

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 10, 2021, 4:29am UTC](https://discourse.slicer.org/t/acpc-transform-for-mri-scans-slicer-4-11/15762/5 "2021-02-10T04:29:35Z")

</div>

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

[![](https://img.youtube.com/vi/sdrRv3JrgTU/maxresdefault.jpg "acpcdemo") ](https://www.youtube.com/watch?v=sdrRv3JrgTU)

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.

---

<div class="post-metadata">

**Author:** ![shebaelena](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/shebaelena/32/9708_2.png) [@shebaelena](https://discourse.slicer.org/u/shebaelena)\
**Post date:** [February 11, 2021, 11:44pm UTC](https://discourse.slicer.org/t/acpc-transform-for-mri-scans-slicer-4-11/15762/6 "2021-02-11T23:44:30Z")

</div>

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.

 ![Slicer 2-11](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/1/c1ea6af305b210f0da80704b4087c992c9d86b2b.jpeg)

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.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 12, 2021, 1:53am UTC](https://discourse.slicer.org/t/acpc-transform-for-mri-scans-slicer-4-11/15762/7 "2021-02-12T01:53:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![shebaelena](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/shebaelena/32/9708_2.png) [@shebaelena](https://discourse.slicer.org/u/shebaelena)\
**Post date:** [February 12, 2021, 5:55pm UTC](https://discourse.slicer.org/t/acpc-transform-for-mri-scans-slicer-4-11/15762/8 "2021-02-12T17:55:45Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 13, 2021, 3:34am UTC](https://discourse.slicer.org/t/acpc-transform-for-mri-scans-slicer-4-11/15762/9 "2021-02-13T03:34:52Z")

</div>

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/`.

---

<div class="post-metadata">

**Author:** ![shebaelena](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/shebaelena/32/9708_2.png) [@shebaelena](https://discourse.slicer.org/u/shebaelena)\
**Post date:** [February 15, 2021, 11:58pm UTC](https://discourse.slicer.org/t/acpc-transform-for-mri-scans-slicer-4-11/15762/10 "2021-02-15T23:58:16Z")

</div>

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

 ![Screen Shot 2021-02-15 at 6.56.28 PM](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/8/e8d84c02f3303eddf96ad73fa1022d45ea12bae0.jpeg)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 16, 2021, 12:18am UTC](https://discourse.slicer.org/t/acpc-transform-for-mri-scans-slicer-4-11/15762/11 "2021-02-16T00:18:41Z")

</div>

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](https://pastebin.com/), or to dropbox, onedrive, …) and post just the link here. Thank you!

---

<div class="post-metadata">

**Author:** ![shebaelena](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/shebaelena/32/9708_2.png) [@shebaelena](https://discourse.slicer.org/u/shebaelena)\
**Post date:** [February 17, 2021, 5:09pm UTC](https://discourse.slicer.org/t/acpc-transform-for-mri-scans-slicer-4-11/15762/12 "2021-02-17T17:09:18Z")

</div>

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:

 ![Screen Shot 2021-02-17 at 12.07.28 PM](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/a/7a9d051bbd384889d5c6086b42b14b57e81e3c51.jpeg)  
Thank you so much for all your help.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 17, 2021, 5:11pm UTC](https://discourse.slicer.org/t/acpc-transform-for-mri-scans-slicer-4-11/15762/13 "2021-02-17T17:11:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![shebaelena](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/shebaelena/32/9708_2.png) [@shebaelena](https://discourse.slicer.org/u/shebaelena)\
**Post date:** [February 17, 2021, 5:41pm UTC](https://discourse.slicer.org/t/acpc-transform-for-mri-scans-slicer-4-11/15762/14 "2021-02-17T17:41:57Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 17, 2021, 6:28pm UTC](https://discourse.slicer.org/t/acpc-transform-for-mri-scans-slicer-4-11/15762/15 "2021-02-17T18:28:00Z")

</div>

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](https://slicer.readthedocs.io/en/latest/).

---

<div class="post-metadata">

**Author:** ![shebaelena](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/shebaelena/32/9708_2.png) [@shebaelena](https://discourse.slicer.org/u/shebaelena)\
**Post date:** [February 26, 2021, 4:58pm UTC](https://discourse.slicer.org/t/acpc-transform-for-mri-scans-slicer-4-11/15762/16 "2021-02-26T16:58:55Z")

</div>

Hi Andras,

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

Best,  
Alexis

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 26, 2021, 10:06pm UTC](https://discourse.slicer.org/t/acpc-transform-for-mri-scans-slicer-4-11/15762/17 "2021-02-26T22:06:50Z")

</div>

Thank you! I’ve found it - [Slicer ACPC Transformation Instructions](https://discourse.slicer.org/t/slicer-acpc-transformation-instructions/16244)

---

<div class="post-metadata">

**Author:** ![shebaelena](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/shebaelena/32/9708_2.png) [@shebaelena](https://discourse.slicer.org/u/shebaelena)\
**Post date:** [February 26, 2021, 4:55pm UTC](https://discourse.slicer.org/t/acpc-transform-for-mri-scans-slicer-4-11/15762/18 "2021-02-26T16:55:19Z")

</div>

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. 

4. Under output transform, select ‘Create New Transform,’ and then Apply.  
 ![Screen Shot 2021-02-26 at 11.47.56 AM](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/1/519fcd27efe4da24074c0018d1dd11aa50719ed6.png)

5. Open ‘Data’ in the dropdown to navigate to the Subject hierarchy. ![Screen Shot 2021-02-26 at 11.49.14 AM](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/0/a035de08f916158717739b919fe2763f69cdb620.png)

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!

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 28, 2021, 3:23pm UTC](https://discourse.slicer.org/t/acpc-transform-for-mri-scans-slicer-4-11/15762/19 "2021-02-28T15:23:55Z")

</div>

@shebaelena FYI, the documentation update has been [submitted for review](https://github.com/Slicer/Slicer/pull/5492). 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.
