# import slicer in a local python/virtualenv and load correctly image orientation

**URL:** <https://discourse.slicer.org/t/import-slicer-in-a-local-python-virtualenv-and-load-correctly-image-orientation/12092>\
**Category:** Support\
**Created:** [June 18, 2020, 11:23am UTC](https://discourse.slicer.org/t/import-slicer-in-a-local-python-virtualenv-and-load-correctly-image-orientation/12092 "2020-06-18T11:23:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![emiltoft](https://avatars.discourse-cdn.com/v4/letter/e/0ea827/32.png) [@emiltoft](https://discourse.slicer.org/u/emiltoft)\
**Post date:** [June 18, 2020, 11:23am UTC](https://discourse.slicer.org/t/import-slicer-in-a-local-python-virtualenv-and-load-correctly-image-orientation/12092/1 "2020-06-18T11:23:55Z")

</div>

Is it possible to use slicer’s python api in a custom made program? Specifically, am I interested in the dicom-image loading due to the correctly dicom volume-image orientation.

I have can see in previous posts that it’s not possible to use the system’s python - is it still the case? -and I guess it is the same using a virtualenv?

I’m currently using vtk’s python api but I’m unable to correctly orienting the dicom volume-images. How does your implementation of vtk work?

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [June 18, 2020, 5:39pm UTC](https://discourse.slicer.org/t/import-slicer-in-a-local-python-virtualenv-and-load-correctly-image-orientation/12092/2 "2020-06-18T17:39:51Z")

</div>

Probably best to use the `PythonSlicer` executable that comes with Slicer. It’s a pretty complete python distribution with vtk and many other useful things built. Plus you can pip install most packages.
