# About ImageCPRMapper

**URL:** https://discourse.vtk.org/t/about-imagecprmapper/14888
**Category:** vtk.js
**Created:** [November 18, 2024, 10:53am UTC](https://discourse.vtk.org/t/about-imagecprmapper/14888 "2024-11-18T10:53:03Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![d\_a](https://discourse.vtk.org/user_avatar/discourse.vtk.org/d_a/32/6825_2.png) [@d\_a](https://discourse.vtk.org/u/d_a)
#### Post date: [November 18, 2024, 10:53am UTC](https://discourse.vtk.org/t/about-imagecprmapper/14888/1 "2024-11-18T10:53:03Z")

</div>

I have obtained the coordinates of the mouse by drawing a line on the MPR. How can I calculate the direction or obtain the direction data? I am confused now. I can only draw a line on the sagittal plane and render the coronal spinal image. How can I draw a line on other planes of the MPR and render the sagittal CPR?

 ![1731926844353](https://discourse.vtk.org/uploads/default/original/2X/5/5c09573d3251d2e0618fc8432b04f136fff6cd70.jpeg)

---

<div class="post-metadata">

### Author: ![finetjul](https://discourse.vtk.org/user_avatar/discourse.vtk.org/finetjul/32/154_2.png) [@finetjul](https://discourse.vtk.org/u/finetjul)
#### Post date: [November 18, 2024, 11:00am UTC](https://discourse.vtk.org/t/about-imagecprmapper/14888/2 "2024-11-18T11:00:41Z")

</div>

A line is rendered by the reslice cursor widget (RCW) as a representation of the intersection of the current plane and the other RCW planes.  
You can specify multiple (!=3) planes in the RCW. It can be done at instantiation: `vtkResliceCursorWidget.newInstance({planes: ['X', 'Y', 'Z', 'O']})`.

---

<div class="post-metadata">

### Author: ![d\_a](https://discourse.vtk.org/user_avatar/discourse.vtk.org/d_a/32/6825_2.png) [@d\_a](https://discourse.vtk.org/u/d_a)
#### Post date: [November 19, 2024, 6:02am UTC](https://discourse.vtk.org/t/about-imagecprmapper/14888/3 "2024-11-19T06:02:38Z")

</div>

Hello, Julien Finet, I mean, I draw a line on the mpr plane to collect the centerline point position coordinates to render the CPR image, but the centerline `orientation` uses the `orientation` in `aorta_centerline.json` in the demo. I also drew the coronal CPR. Now I want to draw the sagittal CPR. I think I need to change the centerline `orientation`. How can I collect the centerline `orientation` of the CPR?

---

<div class="post-metadata">

### Author: ![finetjul](https://discourse.vtk.org/user_avatar/discourse.vtk.org/finetjul/32/154_2.png) [@finetjul](https://discourse.vtk.org/u/finetjul)
#### Post date: [November 19, 2024, 7:38am UTC](https://discourse.vtk.org/t/about-imagecprmapper/14888/4 "2024-11-19T07:38:13Z")

</div>

Did you check `setAngleFromSlider` from the [ImageCPRMapper](https://kitware.github.io/vtk-js/examples/ImageCPRMapper.html) example ?

---

<div class="post-metadata">

### Author: ![d\_a](https://discourse.vtk.org/user_avatar/discourse.vtk.org/d_a/32/6825_2.png) [@d\_a](https://discourse.vtk.org/u/d_a)
#### Post date: [November 20, 2024, 10:50am UTC](https://discourse.vtk.org/t/about-imagecprmapper/14888/5 "2024-11-20T10:50:47Z")

</div>

Hello, Julien Finet,I collected the centerline coordinates, and then rendered an image in Straightened Mode. Why is there a missing section? Switching to Stretched Mode is normal. Maybe I don’t know the rules for the centerline coordinates. According to your reply, I configured RCW like this: `const widget = vtkResliceCursorWidget.newInstance({ planes: ['X', 'Y', 'Z'] });`

 ![1732099427032](https://discourse.vtk.org/uploads/default/original/2X/c/c7db5ec599b7722a3d074cbc27fcf60cc2f12d2c.jpeg)  
 ![1732099737582](https://discourse.vtk.org/uploads/default/original/2X/f/f1c08276517d46dcc654eb43090c596334c7e125.jpeg)
