title: Copy vtkImageData into another vtkImageData
body: <p>I have a <strong>vtkDICOMReader</strong> in a VC++/MFC application, in the main thread. Because retrieving data in this object could take long time, I would like to get data, let say from HDD, into separate thread. In that second thread, I create another <strong>vtkDICOMReader</strong> object. And this <strong>vtkDICOMReader</strong> should be transferred into <strong>vtkDICOMReader</strong> <em>from the main thread</em> ... how can I do that ?</p>
  
  <p>Kind of pseudocode:</p>
  
  <pre><code>CMyDoc::m_pDICOMReader;
  </code></pre>
  
  <p>in the second thread, I create a local <strong>vtkDICOMReader</strong> with </p>
  
  <pre><code>vtkDICOMReader* pReader = vtkDICOMReader::New();
  pReader-&gt;ReadData(...);  // could take long time
  ::PostMessage(AfxGetMainWnd()-&gt;GetSafeHwnd(), WMU_TRANSFER, 0, (LPARAM)pReader);
  </code></pre>
  
  <p>In the main thread:</p>
  
  <pre><code>LRESULT CMyDoc::OnTransfer(WPARAM wParam, LPARAM lParam)
  {
      vtkDICOMReader* pReader = (vtkDICOMReader*)lParam;
      // transfer pReader to m_pDICOMReader somehow ...
      m_pDICOMReader = pReader;    // &lt;-- this is the point where I don't know how to transfer data from pReader to m_pDICOMReader
      pReader-&gt;Delete();
  }
  </code></pre>
  
  <p>Or, to avoid this transfer, from a separate thread <strong>vtkImageData</strong> to the main thread <strong>vtkImageData</strong>, can I load data directly into <strong>vtkImageData</strong> main thread in such a way that I can cancel reading input data ? If is possible, how can I do that ?</p>