<div dir="ltr"><div><div><div>Hi!</div><div><br></div><div>I'd like to copy image data from a textfile (csv) into vtkImageData. </div><div>The textfile have voxel values for x,y,z and image intensity. I already have read the textfile into VTK with the vtkDelimitedTextReader class:</div><div><br></div><div>Table loaded from CSV file:</div></div><div>+-----------+-----------+-----------+------------+</div><div>| Field 0 | Field 1 | Field 2 | Field 3 |</div><div>+-----------+-----------+-----------+------------+</div><div>| 510 | 291 | 0 | 32 |</div><div>| 511 | 291 | 0 | 128 |</div><div>| 510 | 292 | 0 | 104 |</div><div>| 511 | 292 | 0 | 104 |</div><div>| 510 | 293 | 0 | 40 |</div><div>| 511 | 293 | 0 | 240 |</div><div>| 510 | 294 | 0 | 104 |</div><div>| 511 | 294 | 0 | 96 |</div><div>| 506 | 295 | 0 | 64 |</div><div>| 507 | 295 | 0 | 16 |</div><div> .....</div><div> .....</div><div><div>The file is an exported segmented dataset.</div><div><br></div><div>I am following the tips from this similar question <a href="http://vtk.1045678.n5.nabble.com/importing-image-data-into-VTK-from-textfile-mimics-td1243332.html">http://vtk.1045678.n5.nabble.com/importing-image-data-into-VTK-from-textfile-mimics-td1243332.html</a></div><div>I have created an appropriate vtkimagedata (volume):</div><div><br></div><div>imageData = vtk.vtkImageData()</div><div>imageData.SetDimensions(512, 512, 192)</div><div>imageData.SetOrigin(0.0, 0.0, 0.0)</div><div>imageData.SetSpacing(1, 1, 1)</div><div>imageData.SetNumberOfScalarComponents(1)</div><div>imageData.Update()</div><div><br></div><div>However I don't know how to copy the data loaded from vtkDelimitedTextReader into vtkImageData. How do I copy the x,y,z voxel values into vtkImageData? How do I copy the intensity valuesVtkImageData?</div><div><br></div><div>Any help provided for this would be greatly appreciated!</div><div><br></div><div>Lizeth</div></div></div><div><br></div><div><br></div>
</div>