[vtkusers] Exception problems

ivan gm ivan.gm.itk at gmail.com
Mon May 26 05:49:14 EDT 2008


I could solve the problem writing the following lines:

            this->DistanceMapper->ImmediateModeRenderingOn();
            this->BoneMapper->ImmediateModeRenderingOn();

the information about it is in:
    http://www.vtk.org/Wiki/VTK_FAQ



On Mon, Apr 28, 2008 at 11:08 AM, ivan gm <ivan.gm.itk at gmail.com> wrote:

> Hello:
>
> 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:
>
> ....
> pitkDICOMReader->SetFileNames(files);
> pitkDICOMReader->SetImageIO( itk::GDCMImageIO::New() );
> pitkDICOMReader->Update();
> filter = ThresholdType::New();
> filter->SetInput( this->pitkDICOMReader);
> filter->ThresholdOutside(minT, maxT);
> filter->Update();
> ...
> ( typedef itk::ImageToVTKImageFilter<ImageType> ConnectorType; )
> connector->SetInput( filter->GetOutput() );
> connector->Update();
>
> /*now I create a 3D polydata*/
> contourFilter->SetInput(connector->GetOutput());
> contourFilter->Update();
> smoothFilter->SetInputConnection(contourFilter->GetOutputPort());
> smoothFilter->SetNumberOfIterations(30);
> smoothFilter->SetRelaxationFactor(1.0);
> smoothFilter->Update();
> polyDataNormals->SetInputConnection(smoothFilter->GetOutputPort());
> polyDataNormals->Update();
> this->BoneMapper->SetInput(polyDataNormals->GetOutput());
> this->BoneMapper->Update();
> this->BoneActor->SetMapper(this->BoneMapper);
> this->BoneActor->GetProperty()->SetColor(1.0, 1.0, 0.0);
> this->BoneActor->GetProperty()->SetDiffuse(0.0);
> this->BoneActor->GetProperty()->SetSpecular(1.0);
> this->BoneActor->GetProperty()->SetSpecularPower(5);
> this->pvtkRenderer3D->AddActor(this->BoneActor);
> this->pvtkRenderer3D->ResetCamera();
> if (this->pvtkMFCWindow3D)    this->pvtkMFCWindow3D->RedrawWindow();
> //"the program crash here"
>
> 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:
>
> Excepción no controlada en 0x0d9e5c01 en myaplication.exe: 0xC0000005:
> Infracción de acceso al escribir en la ubicación 0x00000000.
>
> After that the file ftime64.c apairs in Visual Studio at line 130 where it
> calls to _ftime64_s(tp);
>
> In addition, when I comment the smoothfilter and other previous filters it
> works good.
>
> What could the problem be? Do you know how I can solve it?
>
>
> Thanks a lot.
>
> Iván García Martínez.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080526/1c91419d/attachment.htm>


More information about the vtkusers mailing list