[vtkusers] Error T vtkStreamingDemandDrivenPipeline why?!

Ali Habib ali.mahmoud.habib at gmail.com
Fri Sep 17 18:17:14 EDT 2010


i forget that the code work well for small large sets

Best regards

On Sat, Sep 18, 2010 at 1:16 AM, Ali Habib <ali.mahmoud.habib at gmail.com>wrote:

> Hi All,
>
> I want to Read dicom data series (761 file) and surround it by VTKboxwidget
> but the code crash at the reading , and give the following error
>
>
> *ERROR: In
> m:\dev\cur\vtkdotnet\branch\50\Filtering\vtkStreamingDemandDrivenPipeline.cxx,
> line 628*
> *vtkStreamingDemandDrivenPipeline (070B2110): The update extent specified
> in the information for output port 0 on algorithm
> vtkTrivialProducer(070AA4B0) is 0 1 0 1 0 1, which is outside the whole
> extent 0 -1 0 -1 0 -1.*
> *
> *
> *ERROR: In m:\dev\cur\vtkdotnet\branch\50\Filtering\vtkImageData.cxx, line
> 1450*
> *vtkImageData (070A6710): GetScalarPointer: Pixel (0, 0, 0) not in memory.
> *
> * Current extent= (0, -1, 0, -1, 0, -1)*
>
> the code is:
>
>             vtk.vtkDICOMImageReader VDR = new vtk.vtkDICOMImageReader();
>             VDR.SetDirectoryName(@"E:\Master Degree\test
> DataSet\Asmaa_pre\08151449"); //E:\Master
> Degree\DataSet\case2\DICOM\PA1\ST1\SE2
>            // VDR.SetDataOrigin(0, 0, 0);
>             VDR.Update();
>
>             vtkImageData d = new vtkImageData();
>             d.DeepCopy(VDR.GetOutput());
>
>            int t =  d.GetMaxCellSize();
>
>             // decrease the dataset data for large data preprocessing
>
>             vtkImageShrink3D VIS = new vtkImageShrink3D();
>             VIS.SetShrinkFactors(2, 2, 2);
>             VIS.SetInput (d);
>             VIS.Update();
>
>             vtkImageThreshold VIT = new vtkImageThreshold();
>             VIT.ThresholdBetween(200, 2000);
>             VIT.SetInputConnection(VIS.GetOutputPort());
>             VIT.Update();
>
>             ///// Start the creation of volume rendering
>
>
>             // Render the skin - Soft tissue
>             double isovalue = 500;
>
>
>             vtkContourFilter skinExtractor = new vtkContourFilter();
>             skinExtractor.SetInputConnection(VIT.GetOutputPort());
>             skinExtractor.SetValue(0, isovalue);
>             skinExtractor.ComputeGradientsOn();
>             skinExtractor.Update();
>
>             gpd = new vtkPolyData();
>             gpd.DeepCopy(skinExtractor.GetOutput());
>
>
>             int x = gpd.GetNumberOfCells();
>             int y = gpd.GetNumberOfPoints();
>
>
>
>             vtk.vtkPolyDataMapper coneMapper = new vtk.vtkPolyDataMapper();
>             coneMapper.SetInput(gpd);
>             coneMapper.ScalarVisibilityOff();
>
>             maceActor = new vtkLODActor();
>             maceActor.SetMapper(coneMapper);
>             maceActor.GetProperty().SetColor(1,0,0);
>             //////////////////////// Selection Part
> /////////////////////////
>             planes = new vtkPlanes();
>
>             clipper = new vtkClipPolyData();
>             clipper.SetInput(gpd);
>             clipper.SetClipFunction(planes);
>             clipper.InsideOutOn();
>             clipper.Modified();
>             vtkPolyDataMapper selectMapper = new vtkPolyDataMapper();
>             selectMapper.SetInput(clipper.GetOutput());
>             selectMapper.ScalarVisibilityOff();
>
>             selectActor = new vtkLODActor();
>             selectActor.SetMapper(selectMapper);
>             selectActor.GetProperty().SetColor(0, 1, 0);
>             selectActor.VisibilityOff();
>             selectActor.SetScale(1.01, 1.01, 1.01);
>
>             /////////////////////// End of selection
> part////////////////////
>
>             //////////////////////////// Cutting part
> /////////////////////////////////
>
>
>             clipper_cutting = new vtkClipPolyData();
>             clipper_cutting.SetInput(gpd);
>             clipper_cutting.SetClipFunction(planes);
>             clipper_cutting.InsideOutOff();
>             clipper_cutting.GenerateClippedOutputOff();
>             clipper_cutting.Modified();
>             vtkPolyDataMapper selectMapper_cutting = new
> vtkPolyDataMapper();
>             selectMapper_cutting.SetInput(clipper_cutting.GetOutput());
>             selectMapper_cutting.ScalarVisibilityOff();
>
>             selectActor_cutting = new vtkLODActor();
>             selectActor_cutting.SetMapper(selectMapper_cutting);
>             selectActor_cutting.GetProperty().SetColor(1, 0, 0);
>             selectActor_cutting.VisibilityOff();
>             selectActor_cutting.SetScale(1.01, 1.01, 1.01);
>
>             //////////////////////////// End Cutting part
> //////////////////////////////////////
>             vtk.vtkRenderer ren1 = new vtk.vtkRenderer();
>
>             renWin.AddRenderer(ren1);
>             //ren1.SetBackground(0.0f, 0.0f, 0.0f);
>
>             vtkRenderWindowInteractor iren = new
> vtkRenderWindowInteractor();
>             iren.SetRenderWindow(renWin);
>
>
>
>             //The SetInteractor method is how 3D widgets are associated
> with the
>             //render window interactor.  Internally, SetInteractor sets up
> a bunch
>             //of callbacks using the Command/Observer mechanism
> (AddObserver()).
>             vtkBoxWidget boxWidget = new vtkBoxWidget();
>             boxWidget.SetInteractor(iren);
>             boxWidget.SetPlaceFactor(1.25);
>             boxWidget.TranslationEnabledOn();
>
>
>
>             ren1.AddActor(maceActor);
>             ren1.AddActor(selectActor);
>             ren1.AddActor(selectActor_cutting);
>
>             boxWidget.SetInput(gpd);
>             boxWidget.Modified();
>             boxWidget.PlaceWidget();
>
>             boxWidget.AddObserver((uint)vtk.EventIds.StartInteractionEvent,
> new vtk.vtkDotNetCallback(StartInteractionEvent));
>             boxWidget.AddObserver((uint)vtk.EventIds.InteractionEvent, new
> vtk.vtkDotNetCallback(InteractionEvent));
>             boxWidget.AddObserver((uint)vtk.EventIds.EndInteractionEvent,
> new vtk.vtkDotNetCallback(EndInteractionEvent));
>
>
>             boxWidget.On();
>
>
>             renWin.AddRenderer(ren1);
>
>             GC.Collect();
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100918/bc6edbf4/attachment.htm>


More information about the vtkusers mailing list