<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hi Sebastien,</p>
    I stored the data as vtk data and used the vtkDataConverter which
    seemed to work fine. When I run the code, every actor appears
    exactly at the right place. So I guess the information in the vtk
    data must be correct (without ever using any function like
    "setPosition"). Though I do not understand why I cannot retrieve the
    information of their positions in the code. <br>
    <p>Here is how I read my data files, it is a function I found in the
      documentation:</p>
    <p>function loadSegment(string, actor, renderer, i){<br>
          const reader = vtkHttpDataSetReader.newInstance({ fetchGzip:
      true });<br>
      reader.setUrl(string).then(() => {<br>
        reader.loadData().then(() => {<br>
          renderer.resetCamera();<br>
          renderWindow.render();<br>
        });<br>
      });<br>
      const mapper = vtkMapper.newInstance();<br>
      mapper.setInputConnection(reader.getOutputPort());<br>
      actor.setMapper(mapper);<br>
      renderer.addActor(actor);<br>
      }</p>
    <p>Any ideas what could be wrong?</p>
    <p>Thank you for your help!<br>
    </p>
    <br>
    <div class="moz-cite-prefix">Am 20.10.2017 um 21:39 schrieb
      Sebastien Jourdain:<br>
    </div>
    <blockquote
cite="mid:CABObKxegcx0h0Nm2XVjVQkzXue+Rq+jumZNN=yjX_MbLnEeOaQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">Then I believe your dataset is not valid. How did
        you build it?
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Fri, Oct 20, 2017 at 1:07 PM, Katrin
          Hartwig <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:katrin_hartwig@gmx.de" target="_blank">katrin_hartwig@gmx.de</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div>
              <div style="font-family:Verdana;font-size:12.0px">
                <div>Hi Sebastian and Logan,
                  <div>
                    <div> </div>
                    <div>thank you a lot for your help and i apologize
                      for my late answer!</div>
                    <div>Unfortunately I still could not solve the
                      problem. I tried both suggestions:</div>
                    <div>With <strong>actor</strong>.getCenter() I get
                      the default-values (0,0,0) for each actor. So I
                      tried to get the information of the dataset as you
                      suggested:</div>
                    <span class="">
                      <div> </div>
                      <div>       dataset = mapper.getInputData();</div>
                      <div>       bounds = dataset.getBounds();</div>
                      <div> </div>
                    </span>
                    <div>By doing so I get the following error massage:</div>
                    <div><strong>       "getBounds called on an array
                        with components of 1"</strong></div>
                    <div> </div>
                    <div>The output of getBounds remains default because
                      of the error.</div>
                    <div> </div>
                    <div>As I could not find any solutions yet, I would
                      be grateful for any help!</div>
                    <div> </div>
                    <div>Thank you</div>
                    <div>Katrin</div>
                    <div> </div>
                    <div name="quote" style="margin:10px 5px 5px
                      10px;padding:10px 0 10px 10px;border-left:2px
                      solid #c3d9e5;word-wrap:break-word">
                      <div style="margin:0 0 10px 0"><b>Gesendet:</b> Montag,
                        18. September 2017 um 16:38 Uhr<br>
                        <b>Von:</b> "Sebastien Jourdain" <<a
                          moz-do-not-send="true"
                          href="mailto:sebastien.jourdain@kitware.com"
                          target="_blank">sebastien.jourdain@kitware.<wbr>com</a>><br>
                        <b>An:</b> "Katrin Hartwig" <<a
                          moz-do-not-send="true"
                          href="mailto:katrin_hartwig@gmx.de"
                          target="_blank">katrin_hartwig@gmx.de</a>><br>
                        <b>Cc:</b> vtkusers <<a
                          moz-do-not-send="true"
                          href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>><br>
                        <b>Betreff:</b> Re: [vtkusers] VTK-JS: How to
                        get Position of actor</div>
                      <div>
                        <div class="h5">
                          <div name="quoted-content">
                            <div>Hi Katrin,
                              <div> </div>
                              <div>The actor position only describe the
                                relative position to the data, that's
                                why by default they are always (0,0,0).</div>
                              <div>Which means its your source or
                                dataset that has the information about
                                the position that you are looking for.</div>
                              <div> </div>
                              <div>For example to find the bounds of a
                                rendered dataset you can do as follow.</div>
                              <div> </div>
                              <div>dataset = mapper.getInputData();</div>
                              <div>bounds = dataset.getBounds();</div>
                              <div> </div>
                              <div>// bounds is an array as follow:</div>
                              <div>// [ minX, maxX, minY, maxY, minZ,
                                maxZ]</div>
                              <div> </div>
                              <div>Hope that helps,</div>
                              <div> </div>
                              <div>Otherwise you can learn more on the
                                basic concepts behind VTK here: <a
                                  moz-do-not-send="true"
                                  href="https://www.vtk.org/vtk-users-guide/"
                                  target="_blank">https://www.vtk.org/vtk-<wbr>users-guide/</a></div>
                              <div> </div>
                              <div>Seb</div>
                            </div>
                            <div class="gmail_extra"> 
                              <div class="gmail_quote">On Mon, Sep 18,
                                2017 at 7:31 AM, Katrin Hartwig <span><<a
                                    moz-do-not-send="true"
                                    href="mailto:katrin_hartwig@gmx.de"
                                    target="_blank">katrin_hartwig@gmx.de</a>></span>
                                wrote:
                                <blockquote class="gmail_quote"
                                  style="margin:0 0 0
                                  0.8ex;border-left:1.0px
                                  rgb(204,204,204)
                                  solid;padding-left:1.0ex">
                                  <div>
                                    <div
                                      style="font-family:Verdana;font-size:12.0px">
                                      <div>Dear all,</div>
                                      <div> </div>
                                      <div>I am using a visualization of
                                        several actors with VTK-js.
                                        Unfortunately, when using <em>actor.getPosition()
                                        </em>I always get [0,0,0] as a
                                        result, no matter which actor I
                                        checked, although they appear on
                                        different positions in my
                                        rendering window.</div>
                                      <div>How can I get the real
                                        positions or centers of the
                                        different actors?</div>
                                      <div> </div>
                                      <div>As I am completely new to
                                        VTK-js and I could not find any
                                        solutions to my problem, any
                                        help would be great!</div>
                                      <div> </div>
                                      <div>Thank you</div>
                                      <div><span
                                          class="m_9222974002551251524HOEnZb"><font
                                            color="#888888">Katrin</font></span></div>
                                    </div>
                                  </div>
                                  <br>
                                  ______________________________<wbr>_________________<br>
                                  Powered by <a moz-do-not-send="true"
                                    href="http://www.kitware.com"
                                    target="_blank">www.kitware.com</a><br>
                                  <br>
                                  Visit other Kitware open-source
                                  projects at <a moz-do-not-send="true"
href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
                                  <br>
                                  Please keep messages on-topic and
                                  check the VTK FAQ at: <a
                                    moz-do-not-send="true"
                                    href="http://www.vtk.org/Wiki/VTK_FAQ"
                                    target="_blank">http://www.vtk.org/Wiki/VTK_<wbr>FAQ</a><br>
                                  <br>
                                  Search the list archives at: <a
                                    moz-do-not-send="true"
                                    href="http://markmail.org/search/?q=vtkusers"
                                    target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
                                  <br>
                                  Follow this link to
                                  subscribe/unsubscribe:<br>
                                  <a moz-do-not-send="true"
                                    href="http://public.kitware.com/mailman/listinfo/vtkusers"
                                    target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/vtkusers</a><br>
                                   </blockquote>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>