I could solve the problem writing the following lines:<br><br> this->DistanceMapper->ImmediateModeRenderingOn();<br> this->BoneMapper->ImmediateModeRenderingOn();<br><br>the information about it is in:<br>
<a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br><br><br><div class="gmail_quote">On Mon, Apr 28, 2008 at 11:08 AM, ivan gm <<a href="mailto:ivan.gm.itk@gmail.com">ivan.gm.itk@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hello:<br><br>I have a problem with a not controled exception in runtime. I'm using windows, MFC, VTK, ITK in Visual Studio 2005. My code looks like this:<br>
<br>....<br>pitkDICOMReader->SetFileNames(files);<br>pitkDICOMReader->SetImageIO( itk::GDCMImageIO::New() );<br>
pitkDICOMReader->Update();<br>filter = ThresholdType::New();<br>filter->SetInput( this->pitkDICOMReader);<br>filter->ThresholdOutside(minT, maxT);<br>filter->Update();<br>...<br>( typedef itk::ImageToVTKImageFilter<ImageType> ConnectorType; )<br>
connector->SetInput( filter->GetOutput() );<br>connector->Update();<br><br>/*now I create a 3D polydata*/<br>contourFilter->SetInput(connector->GetOutput());<br>contourFilter->Update();<br>smoothFilter->SetInputConnection(contourFilter->GetOutputPort());<br>
smoothFilter->SetNumberOfIterations(30);<br>smoothFilter->SetRelaxationFactor(1.0);<br>smoothFilter->Update();<br>polyDataNormals->SetInputConnection(smoothFilter->GetOutputPort());<br>polyDataNormals->Update();<br>
this->BoneMapper->SetInput(polyDataNormals->GetOutput());<br>this->BoneMapper->Update();<br>this->BoneActor->SetMapper(this->BoneMapper);<br>this->BoneActor->GetProperty()->SetColor(1.0, 1.0, 0.0);<br>
this->BoneActor->GetProperty()->SetDiffuse(0.0);<br>this->BoneActor->GetProperty()->SetSpecular(1.0);<br>this->BoneActor->GetProperty()->SetSpecularPower(5);<br>this->pvtkRenderer3D->AddActor(this->BoneActor);<br>
this->pvtkRenderer3D->ResetCamera();<br>if (this->pvtkMFCWindow3D) this->pvtkMFCWindow3D->RedrawWindow(); //"the program crash here"<br><br>When I open 3D images with 100 slices it runs perfect but with one of the images (with 350 slices) the program crash in runtime and Visual Studio shows the following error message:<br>
<br>Excepción no controlada en 0x0d9e5c01 en myaplication.exe: 0xC0000005: Infracción de acceso al escribir en la ubicación 0x00000000.<br><br>After that the file ftime64.c apairs in Visual Studio at line 130 where it calls to _ftime64_s(tp);<br>
<br>In addition, when I comment the smoothfilter and other previous filters it works good.<br><br>What could the problem be? Do you know how I can solve it?<br><br><br>Thanks a lot.<br><br>Iván García Martínez.<br>
</blockquote></div><br>