<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi David,<div class=""><br class=""></div><div class="">Thank you very much for your prompt reply. You solved this problem in seconds! I now understand the two different pipeline better.</div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">Quentan</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 13 Jun 2015, at 14:06, David Gobbi <<a href="mailto:david.gobbi@gmail.com" class="">david.gobbi@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi Quental,<div class=""><br class=""></div><div class="">The solution is as follows:</div><div class=""><br class=""></div><div class="">    cast.Update()</div><div class="">    implicit_volume.SetVolume(cast.GetOutput()) <br class=""></div><div class=""><br class=""></div><div class="">The VTK pipeline recognizes two very distinct kinds of objects:</div><div class=""><br class=""></div><div class="">The vtkImageCast object is a vtk "algorithm" object (derived from vtkAlgorithm).</div><div class="">The vtkImageData object is a vtk "data" object (derived from vtkDataObject).</div><div class=""><br class=""></div><div class="">An algorithm can never be data.  An algorithm _operates_ on data.</div><div class="">So the algorithm's input is data, and its output is data.</div><div class=""><br class=""></div><div class=""> - David</div><div class=""><br class=""></div><div class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Sat, Jun 13, 2015 at 6:36 AM, Quentan Qi <span dir="ltr" class=""><<a href="mailto:quentan@gmail.com" target="_blank" class="">quentan@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi there,<br class="">
<br class="">
After casting an image using vtkImageCast, it becomes a vtkImageCast object, but I want to use vtkImplicitVolume which requires vtkImageData type. How to convert vtkImageCast back to vtkImageData?<br class="">
<br class="">
```Python<br class="">
<br class="">
reader = read_DICOM(path_dicom)  # result is a vtkImageData<br class="">
<br class="">
cast = vtk.vtkImageCast()<br class="">
cast.SetInputData(reader)  # vtkImageData —> vtkImageCast<br class="">
cast.SetOutputScalarTypeToShort()  # I need this type<br class="">
<br class="">
implicit_volume = vtk.vtkImplicitVolume()<br class="">
implicit_volume.SetVolume(reader)  # It works but I need “cast” instead<br class="">
# implicit_volume.SetVolume(cast)  # It’s wrong because vtkImageData is required, but a vtkImageCast was given<br class="">
# other things<br class="">
<br class="">
```<br class="">
<br class="">
Thanks a lot!<br class="">
<br class="">
Cheers,<br class="">
Quentan<br class="">
</blockquote></div><br class=""></div></div></div>
</div></blockquote></div><br class=""></div></body></html>