# When did the Slicer switch to LPS for fcsv?

**URL:** https://discourse.slicer.org/t/when-did-the-slicer-switch-to-lps-for-fcsv/36677
**Category:** Support
**Tags:** markups
**Created:** [June 10, 2024, 5:26am UTC](https://discourse.slicer.org/t/when-did-the-slicer-switch-to-lps-for-fcsv/36677 "2024-06-10T05:26:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)
#### Post date: [June 10, 2024, 5:26am UTC](https://discourse.slicer.org/t/when-did-the-slicer-switch-to-lps-for-fcsv/36677/1 "2024-06-10T05:26:38Z")

</div>

As per [Markups — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/developer_guide/modules/markups.html#markups-fiducial-point-list-file-format-fcsv)

There was a time coordinates was written in RAS. Is it possible to get the specific date LPS became the “standard” for markup files?

---

<div class="post-metadata">

### Author: ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)
#### Post date: [June 10, 2024, 11:19am UTC](https://discourse.slicer.org/t/when-did-the-slicer-switch-to-lps-for-fcsv/36677/2 "2024-06-10T11:19:23Z")

</div>

See the detailed commit message info in the following 2 commits:

> <https://github.com/Slicer/Slicer/commit/61b18e4906bfba3f7585c101e3dd5fb2d7762080>
>
> https://issues.slicer.org/view.php?id=4408
> 
> In recent years, LPS coordinate syst…em has become much more widely used than RAS.
> When Slicer saves a node to file, it already uses RAS for images and transforms and can use LPS for markups.
> However, model node have been still saved as RAS. This caused a problem, because when models and images are
> used or created by external software, models and images are not displayed consistently.
> 
> Unfortunately, generic mesh file formats have no standard way of storing coordinate system (axis orientation)
> information, therefore switching to LPS could not be performed in a single step without breaking backward compatibility.
> 
> Proposed solution: Switch to LPS-based model files in multiple steps.
> 
> Step 1: Write coordinate system information (SPACE=RAS) to model files. Use comments in STL, PLY, and OBJ files; as field data in VTK files.
> Keep writing data as RAS.
> 
> Step 2: Allow reading/writing models that use LPS coordinate system (add an option in Add data dialog; add an option in storage node).
> Use coordinate system that is stored in the file header. If no coordinate system information is found in the file then assume RAS.
> 
> Step 3: Write models to file in LPS coordinate system by default.
> 
> Step 4: If no coordinate system information is found in the file then assume LPS.
> 
> \---
> 
> Step 3-4 somewhat break backward compatibility, therefore there should be either sufficient amount of time (1-2 years) has to be
> left after Step 1, or these steps should be done in a new major release.
> 
> This commit implements Step 1 (with the limitation that coordinate system info cannot be saved into OBJ files and ascii STL files
> due to limitation of VTK API - but these formats are rarely used anyway).
> 
> svn-url: http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=26398
> git-svn-id: http://svn.slicer.org/Slicer4/trunk@26398 3bd1e089-480b-0410-8dfb-8563597acbee

> <https://github.com/Slicer/Slicer/commit/6036edbc4b67712822ccb4ee89139cab1cbce3f2>
>
> Slicer used LPS coordinate system when storing images, transforms, and markups. …All medical image computing software (maybe except a few very old ones) uses LPS coordinate system, too. Slicer started embedding coordinate system name in mesh files (STL, VTK, VTP, OBJ, PLY) a few years ago, but still has been using RAS by default for saving models. This caused inconsistencies when Slicer-exported data was used in third-party software. See https://issues.slicer.org/view.php?id=4445 for details.
> 
> This commit changes default coordinate system in saved models to LPS. When loading a model that has coordinate system information embedded in the file, then that coordinate system is used. If the model does not contain coordinate system information then the CoordinateSystem property of model storage node is used. CoordinateSystem is set to LPS by default but the user can change it in "Add data" dialog (in "Options" column).
> 
> Backward compatibility:
> \- all old Slicer scenes are loaded correctly (if model coordinate system is not specified in the storage node the mrml scene file, then it is assumed to be RAS)
> \- all standalone model files that Slicer created since 2017-09-27 (Slicer-4.8.0) are read correctly (except obj files created by Slicer-4.8.x)
> \- all files created by external software that use LPS coordinate system are read correctly
> \- as a result, the only files that require manual selection of RAS coordinate system (and only when loading without a scene): model files created by Slicer-4.6 (2017-09-27) and earlier; and obj files created by Slicer-4.6 and Slicer-4.8 (between 2016-10-11 and 2018-03-26).
> 
> Also cleaned up markups node coordinate system writing (use LPS/RAS string instead of magic numbers, similar style as model nodes, added tests).
> 
> svn-url: http://viewvc.slicer.org/viewvc.cgi/Slicer4?view=revision&revision=28794
> git-svn-id: http://svn.slicer.org/Slicer4/trunk@28794 3bd1e089-480b-0410-8dfb-8563597acbee

---

<div class="post-metadata">

### Author: ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)
#### Post date: [June 10, 2024, 2:42pm UTC](https://discourse.slicer.org/t/when-did-the-slicer-switch-to-lps-for-fcsv/36677/3 "2024-06-10T14:42:02Z")

</div>

Exactly what I needed. Thanks.
