[vtkusers] Does vtkImageBlend or vtkAppendPolyData generate 3D / Volumetric representation of 2D Image Data or PolyData respectively
Cory Quammen
cory.quammen at kitware.com
Tue Jul 21 13:18:00 EDT 2015
Is your application and VTK built in 32-bit or 64-bit mode? You should
always build in 64-bit mode when working with image data like this because
typically the 32-bit address space is not large enough to hold the data.
What operating system are you running?
On Mon, Jul 20, 2015 at 6:22 PM, Neel007 <sayanmaity.10 at gmail.com> wrote:
> Dear Cory,
>
> Please disregard the previous post. I was doing a silly mistake of not
> including the "threshold->Update();" statement thus the threshold operation
> wasn't performing. After including the statement the vtkThreshold is
> working
> and giving me outputs: Code & plots are attached:
>
> *Code:*
> // Start by loading some data.
> vtkSmartPointer<vtkTIFFReader> reader =
> vtkSmartPointer<vtkTIFFReader>::New();
> reader->SetFileNameSliceOffset(1);
> reader->SetFileNameSliceSpacing(1);
>
>
> reader->SetFilePattern("S:\\GSoC_2015_Implementation\\test_images\\2.%d.bspline.tif");
> reader->SetDataExtent(0, 63, 0, 63, 1, 125);
>
> reader->SetOrientationType(3);
> reader->Update();
>
> vtkSmartPointer<vtkThreshold> threshold =
> vtkSmartPointer<vtkThreshold>::New();
> threshold->SetInputConnection(reader->GetOutputPort());
> threshold->ThresholdByUpper(1);
>
> //threshold->SetInputArrayToProcess(0, 0, 0,
> vtkDataObject::FIELD_ASSOCIATION_POINTS, "index");
> threshold->Update();
> vtkUnstructuredGrid* thresholdedPolydata = threshold->GetOutput();
> std::cout << "There are " << thresholdedPolydata->GetNumberOfCells()
> << " cells after thresholding." << std::endl;
>
> //Visualization UnstructuredGrid after threshold
>
>
> // Create a mapper and actor
> vtkSmartPointer<vtkDataSetMapper> mapper =
> vtkSmartPointer<vtkDataSetMapper>::New();
>
> mapper->SetInputData(thresholdedPolydata);
>
> vtkSmartPointer<vtkActor> actor =
> vtkSmartPointer<vtkActor>::New();
> actor->SetMapper(mapper);
> actor->GetProperty()->SetColor(1.0, 0.0, 0.0);
> actor->GetProperty()->SetRepresentationToWireframe();
> actor->GetProperty()->SetLineWidth(5);
>
> // Create a renderer, render window, and interactor
> vtkSmartPointer<vtkRenderer> renderer =
> vtkSmartPointer<vtkRenderer>::New();
> vtkSmartPointer<vtkRenderWindow> renderWindow =
> vtkSmartPointer<vtkRenderWindow>::New();
> renderWindow->AddRenderer(renderer);
> vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
> vtkSmartPointer<vtkRenderWindowInteractor>::New();
> renderWindowInteractor->SetRenderWindow(renderWindow);
>
> // Add the actors to the scene
> renderer->AddActor(actor);
> //renderer->AddActor(sphereActor);
> renderer->SetBackground(.1, .5, .8);; // Background color white
>
> // Render and interact
> renderWindow->Render();
> renderWindowInteractor->Start();
>
> *Plot of Unstructured grid using vtkThreshold :*
>
> <http://vtk.1045678.n5.nabble.com/file/n5733002/vtkThreshold.png>
>
> /***** Issue****/ *But I am facing some memory related problem, I have
> total
> 551 images (series/ stack) out of which only 125 images are loading in my
> PC
> (16 GB memory installed) while using vtkThreshold anything more than that
> throwing error related Memory overloading, error window shown below. Please
> suggest me how to handle this memory allocation problem :*
>
> ""ERROR: In f:\vtk\vtk-6.2.0\common\core\vtkDataArrayTemplate.txx, line 142
> vtkIdTypeArray (0000000001C83C90): Unable to allocate 996245250 elements of
> size 8 bytes.
>
> <http://vtk.1045678.n5.nabble.com/file/n5733002/Capture.png>
>
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/Does-vtkImageBlend-or-vtkAppendPolyData-generate-3D-Volumetric-representation-of-2D-Image-Data-or-Poy-tp5732834p5733002.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
--
Cory Quammen
R&D Engineer
Kitware, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150721/3073cf6c/attachment.html>
More information about the vtkusers
mailing list