# How to implement CPR (curved planar reconstruction) from centerline?

**URL:** https://discourse.slicer.org/t/how-to-implement-cpr-curved-planar-reconstruction-from-centerline/9456
**Category:** Support
**Tags:** visualization
**Created:** [December 10, 2019, 3:01am UTC](https://discourse.slicer.org/t/how-to-implement-cpr-curved-planar-reconstruction-from-centerline/9456 "2019-12-10T03:01:27Z")
**Posts on this page:** 1
**Showing post:** 3

<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: [December 10, 2019, 7:57pm UTC](https://discourse.slicer.org/t/how-to-implement-cpr-curved-planar-reconstruction-from-centerline/9456/3 "2019-12-10T19:57:41Z")

</div>

> [@RayCui](#):
>
> How to import the csv file as a list of some point?

You can load a curve from a CSV file that has this structure:

```csv
# Markups fiducial file version = 4.11
# CoordinateSystem = 0
# columns = id,x,y,z,ow,ox,oy,oz,vis,sel,lock,label,desc,associatedNodeID
1,-48.966353538964675,-101.7065776156342,74.67105263157896,0,0,0,1,1,1,0,MarkupsCurve-1,,
1,-53.75692521242794,-85.6239441404361,66.4605263157895,0,0,0,1,1,1,0,MarkupsCurve-2,,
1,-60.86814580722918,-72.76476934319273,60.7763157894737,0,0,0,1,1,1,0,MarkupsCurve-3,,
1,-65.87663276996875,-62.425437293974404,57.87936805530591,0,0,0,1,1,1,0,MarkupsCurve-4,,
1,-73.58132198684874,-44.72104505093102,57.37936805530591,0,0,0,1,1,1,0,MarkupsCurve-5,,

```

To load from Python, you can `curveNode = slicer.util.loadMarkupsCurve('some/folder/MarkupsCurve.fcsv')` (this convenience function is available in Slicer Preview Release downloaded tomorrow or later).

> [@RayCui](#):
>
> How to reconstruction and show in the window?

I created a script for CPR earlier, but to make it more accessible, I’ve now added it as a module (“Curved Planar Reformat”) to SlicerSandbox extension. It is available for Slicer Preview Releases you download tomorrow or later (in Examples category).

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/0/4/047b2b59aee261fee3f5d24781436ed5b916629e.jpeg)

---

_[View the full topic](https://discourse.slicer.org/t/how-to-implement-cpr-curved-planar-reconstruction-from-centerline/9456)._
