# Whitematteranalysis subject space problem

**URL:** <https://discourse.slicer.org/t/whitematteranalysis-subject-space-problem/17883>\
**Category:** Support\
**Created:** [May 31, 2021, 12:23pm UTC](https://discourse.slicer.org/t/whitematteranalysis-subject-space-problem/17883 "2021-05-31T12:23:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ferru](https://avatars.discourse-cdn.com/v4/letter/f/ce73a5/32.png) [@ferru](https://discourse.slicer.org/u/ferru)\
**Post date:** [May 31, 2021, 12:23pm UTC](https://discourse.slicer.org/t/whitematteranalysis-subject-space-problem/17883/1 "2021-05-31T12:23:02Z")

</div>

Operating system: Mac OS  
Slicer version: 4.11  
Expected behavior:  
Actual behavior:

Hi,

 ![Captura de Pantalla 2021-05-31 a la(s) 01.10.23](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/4/74d8ba359818cf88d4c81313dbea4b1953256807.png)  
I run de pipeline to perform the whole-brain tractography parcellation using the WMA. software and the anatomically ORG white matter atlas.  
This includes the “wm\_harden\_transform.py” to transforms the fiber clusters in the atlas space back to the DWI subject space (Ussing “-i” in the command).  
Finally I get the anatomical fibers, but they are not in the subject or the atlas space (see picture).

Any suggestions?

Thanks a lot

---

<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:** [May 31, 2021, 7:21pm UTC](https://discourse.slicer.org/t/whitematteranalysis-subject-space-problem/17883/2 "2021-05-31T19:21:39Z")

</div>

DICOM and all medical image computing software standardized on using LPS coordinate system in files. It was painful to achieve this in 3D Slicer (only reached it in Slicer-4.11), but now we are fully compliant. See more information [here](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Tutorials/MigrationGuide/Slicer#Slicer_5.0:_Models_are_saved_in_LPS_coordinate_system_by_default).

In your case, probably the simplest is to specify to Slicer that the input model is in RAS by changing this line:

> <https://github.com/SlicerDMRI/whitematteranalysis/blob/3b1a57b1e7593ab99496851de17c61e33758a45b/bin/harden_transform_with_slicer.py#L16>

To this (to use a lower level API that allows specification of the coordinate system of the loaded model):

```python
slicer.util.loadNodeFromFile(str(polydata), 'ModelFile',
  {'coordinateSystem': slicer.vtkMRMLModelStorageNode.CoordinateSystemRAS},
  returnNode=True)

```

---

<div class="post-metadata">

**Author:** ![ferru](https://avatars.discourse-cdn.com/v4/letter/f/ce73a5/32.png) [@ferru](https://discourse.slicer.org/u/ferru)\
**Post date:** [June 4, 2021, 7:17pm UTC](https://discourse.slicer.org/t/whitematteranalysis-subject-space-problem/17883/3 "2021-06-04T19:17:48Z")

</div>

Thanks Andras for your answer.  
I use the Slicer 4.11v and I can choose the coordinate system before loading the model (RAS or LPS) but neither of the two works (see picture for the T\_CST\_left tract)

Best regards

 ![Captura de Pantalla 2021-06-04 a la(s) 16.16.24](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/e/ceb267e3b0ee646ab3772b4d8a6139c34c9ac963.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:** [June 4, 2021, 7:50pm UTC](https://discourse.slicer.org/t/whitematteranalysis-subject-space-problem/17883/4 "2021-06-04T19:50:07Z")

</div>

NRRD image file coordinate system is very well defined, surface mesh coordinate systems are also clearly defined (as long as you know if LPS or RAS axis directions are used), so if there is misalignment then it is how the data is created or processed. You need to contact WMA software developers, for example by submitting a bug report to their repository. Copy here the link to the submitted bug report for future reference.
