<div dir="ltr">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?</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 20, 2015 at 6:22 PM, Neel007 <span dir="ltr"><<a href="mailto:sayanmaity.10@gmail.com" target="_blank">sayanmaity.10@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear Cory,<br>
<br>
Please disregard the previous post. I was doing a silly mistake of not<br>
including the "threshold->Update();" statement thus the threshold operation<br>
wasn't performing. After including the statement the vtkThreshold is working<br>
and giving me outputs: Code & plots are attached:<br>
<br>
*Code:*<br>
<span class=""> // Start by loading some data.<br>
</span><span class=""> vtkSmartPointer<vtkTIFFReader> reader =<br>
vtkSmartPointer<vtkTIFFReader>::New();<br>
reader->SetFileNameSliceOffset(1);<br>
reader->SetFileNameSliceSpacing(1);<br>
<br>
reader->SetFilePattern("S:\\GSoC_2015_Implementation\\test_images\\2.%d.bspline.tif");<br>
</span> reader->SetDataExtent(0, 63, 0, 63, 1, 125);<br>
<span class=""><br>
reader->SetOrientationType(3);<br>
reader->Update();<br>
<br>
vtkSmartPointer<vtkThreshold> threshold =<br>
vtkSmartPointer<vtkThreshold>::New();<br>
threshold->SetInputConnection(reader->GetOutputPort());<br>
threshold->ThresholdByUpper(1);<br>
<br>
</span> //threshold->SetInputArrayToProcess(0, 0, 0,<br>
vtkDataObject::FIELD_ASSOCIATION_POINTS, "index");<br>
threshold->Update();<br>
<div><div class="h5"> vtkUnstructuredGrid* thresholdedPolydata = threshold->GetOutput();<br>
std::cout << "There are " << thresholdedPolydata->GetNumberOfCells()<br>
<< " cells after thresholding." << std::endl;<br>
<br>
//Visualization UnstructuredGrid after threshold<br>
<br>
<br>
// Create a mapper and actor<br>
vtkSmartPointer<vtkDataSetMapper> mapper =<br>
vtkSmartPointer<vtkDataSetMapper>::New();<br>
<br>
mapper->SetInputData(thresholdedPolydata);<br>
<br>
vtkSmartPointer<vtkActor> actor =<br>
vtkSmartPointer<vtkActor>::New();<br>
actor->SetMapper(mapper);<br>
actor->GetProperty()->SetColor(1.0, 0.0, 0.0);<br>
actor->GetProperty()->SetRepresentationToWireframe();<br>
actor->GetProperty()->SetLineWidth(5);<br>
<br>
// Create a renderer, render window, and interactor<br>
vtkSmartPointer<vtkRenderer> renderer =<br>
vtkSmartPointer<vtkRenderer>::New();<br>
vtkSmartPointer<vtkRenderWindow> renderWindow =<br>
vtkSmartPointer<vtkRenderWindow>::New();<br>
renderWindow->AddRenderer(renderer);<br>
vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =<br>
vtkSmartPointer<vtkRenderWindowInteractor>::New();<br>
renderWindowInteractor->SetRenderWindow(renderWindow);<br>
<br>
// Add the actors to the scene<br>
renderer->AddActor(actor);<br>
</div></div> //renderer->AddActor(sphereActor);<br>
renderer->SetBackground(.1, .5, .8);; // Background color white<br>
<span class=""><br>
// Render and interact<br>
renderWindow->Render();<br>
renderWindowInteractor->Start();<br>
<br>
</span>*Plot of Unstructured grid using vtkThreshold :*<br>
<br>
<<a href="http://vtk.1045678.n5.nabble.com/file/n5733002/vtkThreshold.png" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/file/n5733002/vtkThreshold.png</a>><br>
<br>
/***** Issue****/ *But I am facing some memory related problem, I have total<br>
551 images (series/ stack) out of which only 125 images are loading in my PC<br>
(16 GB memory installed) while using vtkThreshold anything more than that<br>
throwing error related Memory overloading, error window shown below. Please<br>
suggest me how to handle this memory allocation problem :*<br>
<br>
""ERROR: In f:\vtk\vtk-6.2.0\common\core\vtkDataArrayTemplate.txx, line 142<br>
vtkIdTypeArray (0000000001C83C90): Unable to allocate 996245250 elements of<br>
size 8 bytes.<br>
<br>
<<a href="http://vtk.1045678.n5.nabble.com/file/n5733002/Capture.png" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/file/n5733002/Capture.png</a>><br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Does-vtkImageBlend-or-vtkAppendPolyData-generate-3D-Volumetric-representation-of-2D-Image-Data-or-Poy-tp5732834p5733002.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/Does-vtkImageBlend-or-vtkAppendPolyData-generate-3D-Volumetric-representation-of-2D-Image-Data-or-Poy-tp5732834p5733002.html</a><br>
<div class="HOEnZb"><div class="h5">Sent from the VTK - Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Cory Quammen<br>R&D Engineer<br>Kitware, Inc.</div>
</div>