Hi everyone,<br><br>For the past few hours, I have been trying to find
out why I get this error on using vtkDICOMImageReader class. I am new
to VTK and was playing around with this class when I noticed this error.<br><br>I
initialize a DICOM reader object and attach it to a vtkDICOMImageViewer
object. This works fine. The error happens when I set the directory of
the DICOM reader to point to another DICOM directory. Then, I get the
error:
<br><br>libc detected: free() invalid pointer.<br><br>Here is my code:<br><br>&nbsp; vtkDICOMImageReader *reader = vtkDICOMImageReader::New();&nbsp; <br>&nbsp; vtkImageViewer* image_view = vtkImageViewer::New();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp; image_view-&gt;SetInput(reader-
<div>&gt;GetOutput());&nbsp;&nbsp;&nbsp; 
<br>&nbsp; <br>&nbsp; reader-&gt;SetDirectoryName(&quot;/home/luca/data/dicom/11089&quot;);<br>&nbsp; reader-&gt;Update();<br>&nbsp; <br>&nbsp; widget.SetRenderWindow(image_view-&gt;GetRenderWindow());&nbsp;&nbsp;&nbsp; <br>&nbsp; image_view-&gt;SetupInteractor(widget.GetRenderWindow

()-&gt;GetInteractor());&nbsp; <br><br>&nbsp; // When I display this without the next lines, it works fine. <br><br>&nbsp; // NOW I TRY TO UPDATE MY READER with a new input.<br><br>&nbsp; reader-&gt;SetDirectoryName(&quot;/home/luca/data/dicom/11088&quot;);
<br>&nbsp; reader-&gt;Update(); <br><br>&nbsp; When I call the SetDirectoryName method, the program crashes with libc error. I am new to VTK and maybe I am using it the way that it is not supposed to be used. Maybe, I have to pause the rendering or something. If anyone has any ideas, please help.
<br><br>I have no idea what is going on! Please help! I wish this bug did not happen on a Friday!<br><br>Thanks,
<br><br>Luca</div>