<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>Dear VTK users,</div><div><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">I'm new to VTK and ITK, and I still have problems.</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">I'm working as a trainee on an existing project. So I can't really show you all of my code because it's cut in a lot of classes, and it's hard for me to find how the existing project works.</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">Here is my problem:</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family:
 times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">I'm trying to connect ITK and VTK: i get an ITK image, apply itk::ConnectedThresholdImageFilter to it, then connect the pipeline to vtk to stock it in a vtkVolume.</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">But the software crashes, and in debug mode I see it crashes in vtkImageImport::InvokeUpdateInformationCallbacks().</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif;
 background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">I'm using VTK 5.1 and ITK 3.2.0.</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">Here is my code:</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span class="tab">&nbsp;&nbsp;&nbsp; </span>typedef signed short&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PixelType;</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif;
 background-color: transparent; font-style: normal;"><span class="tab">&nbsp;&nbsp;&nbsp; </span>const&nbsp;&nbsp; unsigned int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dimension = 3;<br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span class="tab">&nbsp;&nbsp;&nbsp; </span>typedef itk::Image&lt; PixelType, Dimension &gt;&nbsp;&nbsp; ImageType;<br><span class="tab">&nbsp;&nbsp;&nbsp; </span>typedef itk::ImageToVTKImageFilter&lt; ImageType &gt; ITKToVTKConnector;<br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px;
 font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span class="tab">&nbsp;&nbsp;&nbsp; //The itk Image<br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span class="tab">&nbsp;&nbsp;&nbsp; </span>ImageType::Pointer image = this-&gt;dicom-&gt;getImagePointer();</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span class="tab">&nbsp;&nbsp;&nbsp; //The connected filter, using a random seed, just to test<br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif;
 background-color: transparent; font-style: normal;"><span class="tab">&nbsp;&nbsp;&nbsp; </span>typedef itk::ConnectedThresholdImageFilter&lt; ImageType, ImageType &gt; ConnectedFilterType;<br>&nbsp;&nbsp;&nbsp; ConnectedFilterType::Pointer connectedThreshold = ConnectedFilterType::New();<br>&nbsp;&nbsp;&nbsp; connectedThreshold-&gt;SetInput( image);<br>&nbsp;&nbsp;&nbsp; connectedThreshold-&gt;SetLower(&nbsp; 150 );<br>&nbsp;&nbsp;&nbsp; connectedThreshold-&gt;SetUpper(&nbsp; 350&nbsp; );<br>&nbsp;&nbsp;&nbsp; connectedThreshold-&gt;SetReplaceValue( 255 );<br>&nbsp;&nbsp;&nbsp; ImageType::IndexType&nbsp; index;<br>&nbsp;&nbsp;&nbsp; index[0] = 150;<br>&nbsp;&nbsp;&nbsp; index[1] = 250;<br>&nbsp;&nbsp;&nbsp; index[2] = 150;<br>&nbsp;&nbsp;&nbsp; connectedThreshold-&gt;SetSeed( index );<br>&nbsp;&nbsp;&nbsp; connectedThreshold-&gt;ReleaseDataFlagOn();<br>&nbsp;&nbsp;&nbsp; connectedThreshold-&gt;Update();</div><div style="color: rgb(0, 0, 0); font-size:
 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span class="tab">&nbsp;&nbsp;&nbsp; </span>//The Connector. I first used it like it's normally used but, as it didn't work, i tried to get the exporter and importer, and see if it works. It doesn't.<br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span class="tab">&nbsp;&nbsp;&nbsp; </span>ITKToVTKConnector::Pointer connect2=ITKToVTKConnector::New();<br>&nbsp;&nbsp;&nbsp; //connect2-&gt;SetInput(connectedThreshold-&gt;GetOutput());<br>&nbsp;&nbsp;&nbsp; //connect2-&gt;ReleaseDataFlagOn();<br>&nbsp;&nbsp;&nbsp; //connect2-&gt;Update();<br>&nbsp;&nbsp;&nbsp;
 connect2-&gt;GetExporter()-&gt;SetInput( connectedThreshold-&gt;GetOutput() );<br>&nbsp;&nbsp;&nbsp; connect2-&gt;GetImporter()-&gt;Update();</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span class="tab">&nbsp;&nbsp;&nbsp; //The mapper, a class attribute<br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span class="tab">&nbsp;&nbsp;&nbsp; volumeRayCastMapper-&gt;SetInput(connect2-&gt;GetImporter()-&gt;GetOutput());<br>&nbsp;&nbsp;&nbsp; volumeRayCastMapper-&gt;ReleaseDataFlagOn();<br>&nbsp;&nbsp;&nbsp; volumeRayCastMapper-&gt;Update();<br>&nbsp;&nbsp;&nbsp;
 <br></span><span class="tab">&nbsp;&nbsp;&nbsp; //The volume, a class attribute</span><br><span class="tab"></span><span class="tab">&nbsp;&nbsp;&nbsp; this-&gt;getVolume()/*m_lastVolumeCreated*/-&gt;SetMapper( volumeRayCastMapper );<br></span><span class="tab">&nbsp;&nbsp;&nbsp; </span><span class="tab">this-&gt;getVolume()/*m_lastVolumeCreated*/-&gt;SetProperty( this-&gt;volumeProperty );</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br><span class="tab"></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span class="tab">After that, the volume is used in some other classes which Render the volume. The problem seems to be in the end of the ITK pipeline. I don't know what to try anymore.</span></div><div style="color:
 rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">Any kind of help would be appreciated and, please, excuse my english.</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">Thank you,</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif;
 background-color: transparent; font-style: normal;"><span class="tab">&nbsp;&nbsp;&nbsp; </span><span class="tab">&nbsp;&nbsp;&nbsp; </span><span class="tab">&nbsp;&nbsp;&nbsp; </span><span class="tab">&nbsp;&nbsp;&nbsp; </span><span class="tab">&nbsp;&nbsp;&nbsp; </span><span class="tab">&nbsp;&nbsp;&nbsp; </span><span class="tab">&nbsp;&nbsp;&nbsp; Crampon</span><br><span class="tab"></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span class="tab"><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px;
 font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br><br></div></div></body></html>