# CartesianIndex tuple accessor

**URL:** <https://discourse.julialang.org/t/cartesianindex-tuple-accessor/19613>\
**Category:** General Usage\
**Tags:** question\
**Created:** [January 14, 2019, 11:21am UTC](https://discourse.julialang.org/t/cartesianindex-tuple-accessor/19613 "2019-01-14T11:21:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [January 14, 2019, 11:21am UTC](https://discourse.julialang.org/t/cartesianindex-tuple-accessor/19613/1 "2019-01-14T11:21:26Z")

</div>

What is the API for extracting the `I` from a `CartesianIndex(I)`? I need it as a `Tuple` of integers.

I can `convert`, eg

```julia
convert(Tuple, CartesianIndex((1, 2, 3)))

```

but I am wondering if this is the supported way.

---

<div class="post-metadata">

**Author:** ![under-Peter](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/under-peter/32/3626_2.png) [@under-Peter](https://discourse.julialang.org/u/under-Peter)\
**Post date:** [January 14, 2019, 11:52am UTC](https://discourse.julialang.org/t/cartesianindex-tuple-accessor/19613/2 "2019-01-14T11:52:42Z")

</div>

You can do `Tuple(CartesianIndex((1,2,3)))`.

It is defined in `multidimensional.jl` as:

```julia
# access to index tuple
Tuple(index::CartesianIndex) = index.I

```

which sounds like it should be the way to go.

Cheers
